Flexiv RDK APIs  2.1
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 <map>
11 #include <memory>
12 
13 namespace flexiv::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(JointGroup group, const std::string& name);
101 
109  void Disable(JointGroup group);
110 
122  void Init(JointGroup group);
123 
135  void Grasp(JointGroup group, double force);
136 
152  void Move(JointGroup group, double width, double velocity, double force_limit);
153 
161  void Stop(JointGroup group);
162 
167  std::map<JointGroup, GripperParams> params() const;
168 
173  std::map<JointGroup, GripperStates> states() const;
174 
175 private:
176  class Impl;
177  std::unique_ptr<Impl> pimpl_;
178 };
179 
180 } /* namespace flexiv::rdk */
181 
182 #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
void Init(JointGroup group)
[Blocking] Manually trigger the initialization of the enabled gripper used by the specified joint gro...
std::map< JointGroup, GripperStates > states() const
[Non-blocking] Current states data of all enabled grippers.
void Disable(JointGroup group)
[Blocking] Disable the gripper currently used by the specified joint group.
std::map< JointGroup, GripperParams > params() const
[Non-blocking] Parameters of all enabled grippers.
void Enable(JointGroup group, const std::string &name)
[Blocking] Enable the specified gripper as a device used by the specified joint group.
void Grasp(JointGroup group, double force)
[Blocking] Command the gripper used by the specified joint group to grasp with direct force control....
void Move(JointGroup group, double width, double velocity, double force_limit)
[Blocking] Command the gripper used by the specified joint group to move the fingers with position co...
Gripper(const Robot &robot)
[Non-blocking] Instantiate the gripper control interface.
void Stop(JointGroup group)
[Blocking] Stop and hold the gripper used by the specified joint group.
Main interface to control the robot, containing several function categories and background services.
Definition: robot.hpp:24
JointGroup
All possible joint groups of the robot.
Definition: data.hpp:58
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