Flexiv RDK APIs  1.7.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 min_width = {};
27 
29  double max_width = {};
30 
32  double min_vel = {};
33 
35  double max_vel = {};
36 
38  double min_force = {};
39 
41  double max_force = {};
42 };
43 
50 {
52  double width = {};
53 
56  double force = {};
57 
59  bool is_moving = {};
60 };
61 
68 std::ostream& operator<<(std::ostream& ostream, const GripperStates& gripper_states);
69 
76 class Gripper
77 {
78 public:
84  Gripper(const Robot& robot);
85  virtual ~Gripper();
86 
100  void Enable(const std::string& name);
101 
108  void Disable();
109 
119  void Init();
120 
131  void Grasp(double force);
132 
146  void Move(double width, double velocity, double force_limit);
147 
154  void Stop();
155 
161 
167 
168 private:
169  class Impl;
170  std::unique_ptr<Impl> pimpl_;
171 };
172 
173 } /* namespace rdk */
174 } /* namespace flexiv */
175 
176 #endif /* FLEXIV_RDK_GRIPPER_HPP_ */
Interface to control the gripper installed on the robot. Because gripper is also a type of robot devi...
Definition: gripper.hpp:77
GripperStates states() const
[Non-blocking] Current states data of the enabled gripper.
GripperParams params() const
[Non-blocking] Parameters of the currently enabled gripper.
void Move(double width, double velocity, double force_limit)
[Blocking] Move the gripper fingers with position control.
void Stop()
[Blocking] Stop the gripper and hold its current finger width.
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.
void Enable(const std::string &name)
[Blocking] Enable the specified gripper as a robot device.
void Grasp(double force)
[Blocking] Grasp with direct force control. This function requires the enabled gripper to support dir...
Gripper(const Robot &robot)
[Non-blocking] Instantiate the gripper control interface.
Main interface to control the robot, containing several function categories and background services.
Definition: robot.hpp:25
std::ostream & operator<<(std::ostream &ostream, const RobotEvent &robot_event)
Operator overloading to out stream all members of RobotEvent in JSON format.
Data structure containing the gripper parameters.
Definition: gripper.hpp:21
Data structure containing the gripper states.
Definition: gripper.hpp:50