3#include <franka/exception.h>
4#include <franka/gripper.h>
14 using std::runtime_error::runtime_error;
23 explicit Gripper(
const std::string &franka_address) : franka::
Gripper(franka_address) {}
41 double width,
double speed,
double force,
double epsilon_inner = 0.005,
double epsilon_outer = 0.005);
57 bool open(
double speed);
65 std::shared_future<bool>
openAsync(
double speed);
84 [[nodiscard]]
inline double width()
const {
return state().width; }
99 [[nodiscard]]
inline franka::GripperState
state()
const {
return readOnce(); }
102 std::shared_future<bool> current_future_;
104 std::shared_future<bool> setCurrentFuture(std::future<bool> future);
A wrapper around the franka::Gripper class that adds asynchronous functionality.
Definition gripper.hpp:21
double width() const
Current opening width of the gripper [m].
Definition gripper.hpp:84
std::shared_future< bool > graspAsync(double width, double speed, double force, double epsilon_inner=0.005, double epsilon_outer=0.005)
Asynchronous variant of the franka::Gripper::grasp function.
Definition gripper.cpp:4
double max_width() const
Maximum width of the gripper [m].
Definition gripper.hpp:94
bool open(double speed)
Opens the gripper fully.
Definition gripper.cpp:14
bool is_grasped() const
Whether the gripper is grasping.
Definition gripper.hpp:89
std::shared_future< bool > moveAsync(double width, double speed)
Asynchronous variant of the franka::Gripper::move function.
Definition gripper.cpp:10
std::shared_future< bool > openAsync(double speed)
Asynchronous variant of the open function.
Definition gripper.cpp:16
std::shared_future< bool > stopAsync()
Asynchronous variant of the franka::Gripper::stop function.
Definition gripper.cpp:24
franka::GripperState state() const
Current gripper state.
Definition gripper.hpp:99
Gripper(Gripper &&gripper) noexcept
Definition gripper.hpp:25
Gripper(const std::string &franka_address)
Definition gripper.hpp:23
std::shared_future< bool > homingAsync()
Asynchronous variant of the franka::Gripper::homing function.
Definition gripper.cpp:20
Definition dynamics_limit.cpp:8
Exception thrown by the gripper class.
Definition gripper.hpp:13