Flexiv RDK APIs  1.6.0
gripper.hpp
Go to the documentation of this file.
1 
6 #ifndef FLEXIV_RDK_GRIPPER_HPP_
7 #define FLEXIV_RDK_GRIPPER_HPP_
8 
9 #include "robot.hpp"
10 #include <memory>
11 
12 namespace flexiv {
13 namespace rdk {
14 
21 {
23  std::string name = {};
24 
26  double max_width = {};
27 
29  double min_width = {};
30 
32  double max_force = {};
33 
35  double min_force = {};
36 
38  double max_vel = {};
39 
41  double min_vel = {};
42 };
43 
50 {
52  double width = {};
53 
56  double force = {};
57 
59  bool is_moving = {};
60 };
61 
69 std::ostream& operator<<(std::ostream& ostream, const GripperStates& gripper_states);
70 
77 class Gripper
78 {
79 public:
85  Gripper(const Robot& robot);
86  virtual ~Gripper();
87 
101  void Enable(const std::string& name);
102 
109  void Disable();
110 
120  void Init();
121 
131  void Grasp(double force);
132 
144  void Move(double width, double velocity, double force_limit = 0);
145 
152  void Stop();
153 
158  const GripperParams params() const;
159 
165  const GripperStates states() const;
166 
167 private:
168  class Impl;
169  std::unique_ptr<Impl> pimpl_;
170 };
171 
172 } /* namespace rdk */
173 } /* namespace flexiv */
174 
175 #endif /* FLEXIV_RDK_GRIPPER_HPP_ */
Interface with the robot gripper. Because gripper is also a type of device, this API uses the same un...
Definition: gripper.hpp:78
const GripperStates states() const
[Non-blocking] Current states data of the enabled gripper.
void Stop()
[Blocking] Stop the gripper and hold its current finger width.
void Move(double width, double velocity, double force_limit=0)
[Blocking] Move the gripper fingers with position control.
void Init()
[Blocking] Manually trigger the initialization of the enabled gripper. This step is not needed for gr...
void Disable()
[Blocking] Disable the currently enabled gripper, similar to Device::Disable().
const GripperParams params() const
[Non-blocking] Parameters of the currently enabled gripper.
void Enable(const std::string &name)
[Blocking] Enable the specified gripper as a device, same as Device::Enable().
void Grasp(double force)
[Blocking] Grasp with direct force control. Requires the mounted gripper to support direct force cont...
Gripper(const Robot &robot)
[Non-blocking] Create an instance and initialize gripper control interface.
Main interface with the robot, containing several function categories and background services.
Definition: robot.hpp:25
std::ostream & operator<<(std::ostream &ostream, const RobotInfo &robot_info)
Operator overloading to out stream all robot info in JSON format: {"info_1": [val1,...
Data structure containing the gripper parameters.
Definition: gripper.hpp:21
Data structure containing the gripper states.
Definition: gripper.hpp:50