Interface with the robot device(s).
More...
#include <device.hpp>
|
| Device (const Robot &robot) |
| [Non-blocking] Create an instance and initialize device control interface. More...
|
|
const std::map< std::string, bool > | list () const |
| [Blocking] Request 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...
|
|
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< int, double >> &cmds) |
| [Blocking] Send command(s) for the specified device. More...
|
|
Interface with the robot device(s).
Definition at line 19 of file device.hpp.
◆ Device()
flexiv::rdk::Device::Device |
( |
const Robot & |
robot | ) |
|
[Non-blocking] Create an instance and initialize 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< int, double >> & |
cmds |
|
) |
| |
[Blocking] Send command(s) for the specified device.
- Parameters
-
[in] | name | Name of the device to send command(s) for, must be an existing device. |
[in] | cmds | A map of {command_name, command_value}. Use int 1 and 0 to represent booleans. For example, {{"setSpeed", 6000}, {"startMotor", 1}}. |
- Exceptions
-
std::logic_error | if the specified device does not exist or 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.
- Warning
- Commanding a disabled or nonexistent device will trigger an error on the robot.
◆ Disable()
void flexiv::rdk::Device::Disable |
( |
const std::string & |
name | ) |
|
[Blocking] Disable the specified device.
- Parameters
-
[in] | name | Name of the device to disable, must be an existing device. |
- Exceptions
-
std::logic_error | 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.
- Warning
- Disabling a nonexistent device will trigger an error on the connected robot.
◆ Enable()
void flexiv::rdk::Device::Enable |
( |
const std::string & |
name | ) |
|
[Blocking] Enable the specified device.
- Parameters
-
[in] | name | Name of the device to enable, must be an existing device. |
- Exceptions
-
std::logic_error | 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.
- Warning
- Enabling a nonexistent device will trigger an error on the connected robot.
◆ 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()
const std::map<std::string, bool> flexiv::rdk::Device::list |
( |
| ) |
const |
[Blocking] Request 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.
The documentation for this class was generated from the following file: