Flexiv RDK APIs  1.6.0
device.hpp
Go to the documentation of this file.
1 
6 #ifndef FLEXIV_RDK_DEVICE_HPP_
7 #define FLEXIV_RDK_DEVICE_HPP_
8 
9 #include "robot.hpp"
10 #include <map>
11 
12 namespace flexiv {
13 namespace rdk {
14 
19 class Device
20 {
21 public:
27  Device(const Robot& robot);
28  virtual ~Device();
29 
37  const std::map<std::string, bool> list() const;
38 
46  bool exist(const std::string& name) const;
47 
58  const std::map<std::string,
59  std::variant<int, double, std::string, std::vector<double>, std::vector<std::string>>>
60  params(const std::string& name) const;
61 
69  void Enable(const std::string& name);
70 
78  void Disable(const std::string& name);
79 
90  void Command(const std::string& name,
91  const std::map<std::string, std::variant<bool, int, double>>& commands);
92 
93 private:
94  class Impl;
95  std::unique_ptr<Impl> pimpl_;
96 };
97 
98 } /* namespace rdk */
99 } /* namespace flexiv */
100 
101 #endif /* FLEXIV_RDK_DEVICE_HPP_ */
Interface with the robot device(s).
Definition: device.hpp:20
void Enable(const std::string &name)
[Blocking] Enable the specified device.
const std::map< std::string, bool > list() const
[Blocking] Get a list of existing devices and their status (enabled/disabled).
void Command(const std::string &name, const std::map< std::string, std::variant< bool, int, double >> &commands)
[Blocking] Send command(s) for the specified device.
Device(const Robot &robot)
[Non-blocking] Create an instance and initialize device control interface.
void Disable(const std::string &name)
[Blocking] Disable the specified device.
const std::map< std::string, std::variant< int, double, std::string, std::vector< double >, std::vector< std::string > > > params(const std::string &name) const
[Blocking] Get configuration parameters of the specified device.
bool exist(const std::string &name) const
[Blocking] Whether the specified device already exists.
Main interface with the robot, containing several function categories and background services.
Definition: robot.hpp:25