Interface to control the peripheral device(s) connected to the robot.  
 More...
#include <device.hpp>
 | 
|   | Device (const Robot &robot) | 
|   | [Non-blocking] Instantiate the device control interface.  More...
  | 
|   | 
| std::map< std::string, bool >  | list () const | 
|   | [Blocking] A list of existing devices and their status (enabled/disabled).  More...
  | 
|   | 
| bool  | exist (const std::string &name) const | 
|   | [Blocking] Whether the specified device already exists.  More...
  | 
|   | 
| std::map< std::string, DeviceParamDataTypes >  | params (const std::string &name) const | 
|   | [Blocking] Configuration parameters of the specified device.  More...
  | 
|   | 
| void  | Enable (const std::string &name) | 
|   | [Blocking] Enable the specified device.  More...
  | 
|   | 
| void  | Disable (const std::string &name) | 
|   | [Blocking] Disable the specified device.  More...
  | 
|   | 
| void  | Command (const std::string &name, const std::map< std::string, std::variant< bool, int, double >> &commands) | 
|   | [Blocking] Send command(s) to the specified device.  More...
  | 
|   | 
Interface to control the peripheral device(s) connected to the robot. 
Definition at line 22 of file device.hpp.
 
◆ Device()
      
        
          | flexiv::rdk::Device::Device  | 
          ( | 
          const Robot &  | 
          robot | ) | 
           | 
        
      
 
[Non-blocking] Instantiate the device control interface. 
- Parameters
 - 
  
  
 
- Exceptions
 - 
  
    | std::runtime_error | if the initialization sequence failed.  | 
  
   
 
 
◆ Command()
      
        
          | void flexiv::rdk::Device::Command  | 
          ( | 
          const std::string &  | 
          name,  | 
        
        
           | 
           | 
          const std::map< std::string, std::variant< bool, int, double >> &  | 
          commands  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
[Blocking] Send command(s) to the specified device. 
- Parameters
 - 
  
    | [in] | name | Name of the device to send command(s) to.  | 
    | [in] | commands | A map of {command_name, command_value}. For example, {{"setSpeed", 6000}, {"openLaser", true}}. All commands in the map will be sent to the device simultaneously. Make sure the command name(s) are valid and can be accepted by the specified device.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if the specified device does not exist.  | 
    | std::logic_error | if the specified device is not enabled yet.  | 
    | std::runtime_error | if failed to deliver the request to the connected robot.  | 
  
   
- Note
 - This function blocks until the request is successfully delivered. 
 
 
 
◆ Disable()
      
        
          | void flexiv::rdk::Device::Disable  | 
          ( | 
          const std::string &  | 
          name | ) | 
           | 
        
      
 
[Blocking] Disable the specified device. 
- Parameters
 - 
  
    | [in] | name | Name of the device to disable.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if the specified device does not exist.  | 
    | std::runtime_error | if failed to deliver the request to the connected robot.  | 
  
   
- Note
 - This function blocks until the request is successfully delivered. 
 
 
 
◆ Enable()
      
        
          | void flexiv::rdk::Device::Enable  | 
          ( | 
          const std::string &  | 
          name | ) | 
           | 
        
      
 
[Blocking] Enable the specified device. 
- Parameters
 - 
  
    | [in] | name | Name of the device to enable.  | 
  
   
- Exceptions
 - 
  
    | std::invalid_argument | if the specified device does not exist.  | 
    | std::runtime_error | if failed to deliver the request to the connected robot.  | 
  
   
- Note
 - This function blocks until the request is successfully delivered. 
 
 
 
◆ exist()
      
        
          | bool flexiv::rdk::Device::exist  | 
          ( | 
          const std::string &  | 
          name | ) | 
           const | 
        
      
 
[Blocking] Whether the specified device already exists. 
- Parameters
 - 
  
    | [in] | name | Name of the device to check.  | 
  
   
- Returns
 - True if the specified device exists. 
 
- Exceptions
 - 
  
    | std::runtime_error | if failed to get a reply from the connected robot.  | 
  
   
- Note
 - This function blocks until a reply is received. 
 
 
 
◆ list()
      
        
          | std::map<std::string, bool> flexiv::rdk::Device::list  | 
          ( | 
           | ) | 
           const | 
        
      
 
[Blocking] A list of existing devices and their status (enabled/disabled). 
- Returns
 - A map of {device_name, is_enabled}. For example, {{"Mirka-AIROS-550CV", true}, {"LinearRail", false}}. 
 
- Exceptions
 - 
  
    | std::runtime_error | if failed to get a reply from the connected robot.  | 
  
   
- Note
 - This function blocks until a reply is received. 
 
 
 
◆ params()
      
        
          | std::map<std::string, DeviceParamDataTypes> flexiv::rdk::Device::params  | 
          ( | 
          const std::string &  | 
          name | ) | 
           const | 
        
      
 
[Blocking] Configuration parameters of the specified device. 
- Parameters
 - 
  
    | [in] | name | Name of the device to get parameters for.  | 
  
   
- Returns
 - A map of {param_name, param_value}. Booleans are represented by int 1 and 0. For example, {{"maxVel", 0.5}, {"absolutePosition", {0.7, -0.4, 0.05}}, {"conveyorName", "conveyor0"}}. 
 
- Exceptions
 - 
  
    | std::invalid_argument | if the specified device does not exist.  | 
    | std::runtime_error | if failed to get a reply from the connected robot.  | 
  
   
- Note
 - This function blocks until a reply is received. 
 
 
 
The documentation for this class was generated from the following file: