Frankx  0.2.0
A High-Level Motion API for Franka
gripper.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cmath>
4 #include <iostream>
5 #include <future>
6 
7 #include <franka/exception.h>
8 #include <franka/gripper.h>
9 
10 
11 namespace frankx {
12 
13 class Gripper: public franka::Gripper {
14  const double width_calibration {0.004}; // [m], Difference from gripper jaws
15  const double min_width {0.002}; // [m]
16 
21  double last_clamp_width; // [m]
22 
23 public:
24  static constexpr double max_speed {0.1}; // [m/s]
25 
27  explicit Gripper(const std::string& fci_ip, double speed = 0.04, double force = 20.0);
28 
29  double gripper_force {20.0}; // [N]
30  double gripper_speed {0.04}; // [m/s]
31  bool has_error {false};
32 
33  const double max_width {0.081 + width_calibration}; // [m]
34 
35  double width() const;
36  bool isGrasping() const;
37 
38  bool move(double width); // [m]
39  bool move_unsafe(double width); // [m]
40  std::future<bool> moveAsync(double width); // [m]
41 
42  bool open();
43  bool clamp();
44  bool clamp(double min_clamping_width);
45 
46  bool release();
47  bool release(double width); // [m]
48  bool releaseRelative(double width); // [m]
49 
50 
51  ::franka::GripperState get_state();
52 };
53 
54 } // namepace frankx
frankx.gripper.Gripper
Definition: gripper.py:6
frankx
Definition: __init__.py:1
frankx::Gripper::has_error
bool has_error
Definition: gripper.hpp:31
frankx::Gripper::max_speed
static constexpr double max_speed
Definition: gripper.hpp:24
frankx::Gripper::gripper_speed
double gripper_speed
Definition: gripper.hpp:30
frankx::Gripper::max_width
const double max_width
Definition: gripper.hpp:33
frankx::Gripper::gripper_force
double gripper_force
Definition: gripper.hpp:29