Flexiv RDK APIs  1.6.0
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 {
12 namespace rdk {
13 
19 struct ToolParams
20 {
22  double mass = 0.0;
23 
25  std::array<double, 3> CoM = {};
26 
28  std::array<double, 6> inertia = {};
29 
33  std::array<double, kPoseSize> tcp_location = {};
34 };
35 
41 class Tool
42 {
43 public:
49  Tool(const Robot& robot);
50  virtual ~Tool();
51 
58  const std::vector<std::string> list() const;
59 
66  const std::string name() const;
67 
75  bool exist(const std::string& name) const;
76 
83  const ToolParams params() const;
84 
93  const ToolParams params(const std::string& name) const;
94 
105  void Add(const std::string& name, const ToolParams& params);
106 
117  void Switch(const std::string& name);
118 
129  void Update(const std::string& name, const ToolParams& params);
130 
140  void Remove(const std::string& name);
141 
142 private:
143  class Impl;
144  std::unique_ptr<Impl> pimpl_;
145 };
146 
147 } /* namespace rdk */
148 } /* namespace flexiv */
149 
150 #endif /* FLEXIV_RDK_TOOL_HPP_ */
Main interface with the robot, containing several function categories and background services.
Definition: robot.hpp:25
Interface to online update and interact with the robot tools. All updates will take effect immediatel...
Definition: tool.hpp:42
void Switch(const std::string &name)
[Blocking] Switch to an existing tool. All following robot operations will default to use this tool.
const std::vector< std::string > list() const
[Blocking] Get a name 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.
const ToolParams params() const
[Blocking] Get parameters of the tool that the robot is currently using.
void Remove(const std::string &name)
[Blocking] Remove an existing tool.
void Add(const std::string &name, const ToolParams &params)
[Blocking] Add a new tool with user-specified parameters.
const ToolParams params(const std::string &name) const
[Blocking] Get parameters of the specified tool.
Tool(const Robot &robot)
[Non-blocking] Create an instance and initialize the interface.
const std::string name() const
[Blocking] Get name of the tool that the robot is currently using.
Data structure containing robot tool parameters.
Definition: tool.hpp:20
std::array< double, kPoseSize > tcp_location
Definition: tool.hpp:33
std::array< double, 3 > CoM
Definition: tool.hpp:25
std::array< double, 6 > inertia
Definition: tool.hpp:28