The client class. More...
#include <creos/client.hpp>
Public Member Functions | |
Client (std::string_view host, unsigned port) | |
Constructor for the client. | |
Client (std::string_view host) | |
Constructor for the client. | |
Client () | |
Default constructor for the client. | |
void | unsubscribe (SubscriptionId id) |
Unsubscribe from a data source. | |
ISensorsInterface * | sensors () |
Get the sensors interface. | |
const ISensorsInterface * | sensors () const |
IPowerManagementInterface * | power_management () |
Get the power management interface. | |
const IPowerManagementInterface * | power_management () const |
ISetpointControlInterface * | setpoint_control () |
Get the setpoint control interface. | |
const ISetpointControlInterface * | setpoint_control () const |
ITransformsInterface * | transforms () |
Get the transforms interface. | |
const ITransformsInterface * | transforms () const |
ISystemInfoInterface * | system_info () |
Get the system info interface. | |
const ISystemInfoInterface * | system_info () const |
IDiagnosticsInterface * | diagnostics () |
Get the diagnostics interface. | |
const IDiagnosticsInterface * | diagnostics () const |
The client class.
This class is used to interact with the CreOS Agent.
creos::Client::Client | ( | std::string_view | host, |
unsigned | port ) |
Constructor for the client.
This constructor creates a new client object and connects to the specified host and port.
host | The host to connect to. |
port | The port to connect to. |
creos::ConnectionError | If the client could not connect to the host. |
creos::Client::Client | ( | std::string_view | host | ) |
Constructor for the client.
This constructor creates a new client object and connects to the specified host using the default port. You can change the default port by setting the CREOS_PORT environment variable.
host | The host to connect to. |
creos::ConnectionError | If the client could not connect to the host. |
creos::Client::Client | ( | ) |
Default constructor for the client.
This constructor creates a new client object and connects to the default host and port. You can change the default host and port by setting the CREOS_HOST and CREOS_PORT environment variables.
IDiagnosticsInterface * creos::Client::diagnostics | ( | ) |
Get the diagnostics interface.
The diagnostics interface is used to get diagnostic information from the robot. This information can be used to monitor the health of the robot and detect any issues that may arise.
nullptr
if the interface is not available. IPowerManagementInterface * creos::Client::power_management | ( | ) |
Get the power management interface.
The power management interface is used to control the power state of the robot. It can be used to put the robot into a low power mode to conserve energy.
nullptr
if the interface is not available. ISensorsInterface * creos::Client::sensors | ( | ) |
Get the sensors interface.
The sensors interface is used to get sensor data from sensors on the robot.
nullptr
if the interface is not available. ISetpointControlInterface * creos::Client::setpoint_control | ( | ) |
Get the setpoint control interface.
The setpoint control interface is used to send setpoint control commands to the robot.
nullptr
if the interface is not available. ISystemInfoInterface * creos::Client::system_info | ( | ) |
Get the system info interface.
The system info interface is used to get information about the robot, like the name and serial number.
nullptr
if the interface is not available. ITransformsInterface * creos::Client::transforms | ( | ) |
Get the transforms interface.
The transforms interface is used to get information about the relationships between different coordinate frames. A coordinate frame is a frame of reference used to define the position and orientation of different parts of the robot.
The transformations can be static or dynamic. Static transformations do not change often, like the transformation from the main body of the robot to a fixed sensor. Dynamic transformations can change continuously, like the transformation from the main body of the robot to the tip of a mounted robot arm.
nullptr
if the interface is not available. void creos::Client::unsubscribe | ( | SubscriptionId | id | ) |
Unsubscribe from a data source.
id | The subscription ID. |
InvalidArgumentError | If the subscription ID is invalid. |