Flexiv RDK APIs  2.1
tool.hpp
Go to the documentation of this file.
1 
6 #ifndef FLEXIV_RDK_TOOL_HPP_
7 #define FLEXIV_RDK_TOOL_HPP_
8 
9 #include "robot.hpp"
10 
11 namespace flexiv::rdk {
12 
18 struct ToolParams
19 {
21  double mass = 0.0;
22 
24  std::array<double, 3> CoM = {};
25 
27  std::array<double, 6> inertia = {};
28 
32  std::array<double, kPoseSize> tcp_location = {};
33 };
34 
40 class Tool
41 {
42 public:
48  Tool(const Robot& robot);
49  virtual ~Tool();
50 
57  std::vector<std::string> list() const;
58 
69  std::string name(JointGroup group) const;
70 
78  bool exist(const std::string& name) const;
79 
91 
100  ToolParams params(const std::string& name) const;
101 
112  void Add(const std::string& name, const ToolParams& params);
113 
128  void Switch(JointGroup group, const std::string& name);
129 
140  void Update(const std::string& name, const ToolParams& params);
141 
152  void Remove(const std::string& name);
153 
178  ToolParams CalibratePayloadParams(bool tool_mounted);
179 
180 private:
181  class Impl;
182  std::unique_ptr<Impl> pimpl_;
183 };
184 
185 } /* namespace flexiv::rdk */
186 
187 #endif /* FLEXIV_RDK_TOOL_HPP_ */
Main interface to control the robot, containing several function categories and background services.
Definition: robot.hpp:24
Interface to manage tools of the robot. All updates take effect immediately without a power cycle....
Definition: tool.hpp:41
std::vector< std::string > list() const
[Blocking] A list of all configured tools.
bool exist(const std::string &name) const
[Blocking] Whether the specified tool already exists.
void Update(const std::string &name, const ToolParams &params)
[Blocking] Update the parameters of an existing tool.
std::string name(JointGroup group) const
[Blocking] Name of the active tool currently used by the specified joint group.
void Remove(const std::string &name)
[Blocking] Remove an existing tool.
ToolParams params(const std::string &name) const
[Blocking] Parameters of the specified tool.
void Add(const std::string &name, const ToolParams &params)
[Blocking] Add a new tool with user-specified parameters.
void Switch(JointGroup group, const std::string &name)
[Blocking] Switch active tool for the specified joint group. All following operations will default to...
Tool(const Robot &robot)
[Non-blocking] Instantiate the robot tool interface.
ToolParams params(JointGroup group) const
[Blocking] Parameters of the active tool currently used by the specified joint group.
ToolParams CalibratePayloadParams(bool tool_mounted)
[Blocking] Calibrate the payload parameters (mass, CoM, and inertia) of a tool.
JointGroup
All possible joint groups of the robot.
Definition: data.hpp:58
Data structure containing robot tool parameters.
Definition: tool.hpp:19
std::array< double, kPoseSize > tcp_location
Definition: tool.hpp:32
std::array< double, 3 > CoM
Definition: tool.hpp:24
std::array< double, 6 > inertia
Definition: tool.hpp:27