5 #include <franka/exception.h>
6 #include <franka/gripper.h>
14 using std::runtime_error::runtime_error;
22 explicit Gripper(
const std::string &franka_address) : franka::
Gripper(franka_address) {}
40 double width,
double speed,
double force,
double epsilon_inner = 0.005,
double epsilon_outer = 0.005)
const;
55 bool open(
double speed);
63 std::future<bool>
openAsync(
double speed);
80 [[nodiscard]]
inline double width()
const {
88 return state().is_grasped;
95 return state().max_width;
101 [[nodiscard]]
inline franka::GripperState
state()
const {
A wrapper around the franka::Gripper class that adds asynchronous functionality.
Definition: gripper.hpp:20
double width() const
Current opening width of the gripper [m].
Definition: gripper.hpp:80
std::future< bool > moveAsync(double width, double speed) const
Asynchronous variant of the franka::Gripper::move function.
Definition: gripper.cpp:10
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:87
std::future< bool > graspAsync(double width, double speed, double force, double epsilon_inner=0.005, double epsilon_outer=0.005) const
Asynchronous variant of the franka::Gripper::grasp function.
Definition: gripper.cpp:5
std::future< bool > openAsync(double speed)
Asynchronous variant of the open function.
Definition: gripper.cpp:18
std::future< bool > homingAsync()
Asynchronous variant of the franka::Gripper::homing function.
Definition: gripper.cpp:22
std::future< bool > stopAsync()
Asynchronous variant of the franka::Gripper::stop function.
Definition: gripper.cpp:26
franka::GripperState state() const
Current gripper state.
Definition: gripper.hpp:101
Gripper(Gripper &&gripper) noexcept
Definition: gripper.hpp:24
Gripper(const std::string &franka_address)
Definition: gripper.hpp:22
Definition: gripper.cpp:3
Exception thrown by the gripper class.
Definition: gripper.hpp:13