CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
creos::ISetpointControlInterface Class Referenceabstract

The interface for sending control setpoints to an Avular robot. More...

#include <creos/setpoint_control_interface.hpp>

Public Member Functions

virtual void publishVelocityCommand (const creos_messages::Twist &cmd_vel)=0
 Publish a velocity command to the robot.
 
virtual void setControlSource (const creos_messages::ControlSource &source, int timeout_ms=5000)=0
 Set the control source of the robot.
 
virtual SubscriptionId subscribeToCurrentControlSource (const std::function< void(const creos_messages::ControlSource &)> &callback)=0
 Subscribe to the current control source of the robot.
 
virtual creos_messages::ControlSource getCurrentControlSource (int timeout_ms=1500)=0
 Get the current control source of the robot.
 
virtual void sendCommand (const creos_messages::Command command, int timeout_ms=5000)=0
 Send a command to the robot to trigger a one-time action.
 
virtual void sendCommand (const creos_messages::CommandStamped command, int timeout_ms=5000)=0
 Send a command with timestamp to the robot to trigger a one-time action.
 
virtual void publishStateReference (const creos_messages::StateReference &state_reference)=0
 Publish a state reference to the robot.
 

Static Public Attributes

static constexpr char name [] = "setpoint_control"
 
static constexpr unsigned version = 1
 

Detailed Description

The interface for sending control setpoints to an Avular robot.

Member Function Documentation

◆ getCurrentControlSource()

virtual creos_messages::ControlSource creos::ISetpointControlInterface::getCurrentControlSource ( int timeout_ms = 1500)
pure virtualOriginVertex

Get the current control source of the robot.

Parameters
timeout_msThe timeout in milliseconds.
Returns
The current control source of the robot.
Exceptions
creos::UnsupportedErrorif the robot does not support getting the control source.
creos::TimeoutErrorif the control source could not be retrieved within the timeout.
creos::Exceptionif any other error occurred while getting the data.

◆ publishStateReference()

virtual void creos::ISetpointControlInterface::publishStateReference ( const creos_messages::StateReference & state_reference)
pure virtualVertex

Publish a state reference to the robot.

Parameters
state_referenceThe state reference to publish.
Exceptions
creos::UnsupportedErrorif the robot does not support state references.
creos::PublicationErrorif an error occurs while publishing the state reference.
creos::TimeoutErrorif the state reference could not be set within the timeout.

◆ publishVelocityCommand()

virtual void creos::ISetpointControlInterface::publishVelocityCommand ( const creos_messages::Twist & cmd_vel)
pure virtualOrigin

Publish a velocity command to the robot.

This function will publish a velocity command to the robot.

Parameters
messageThe velocity command to publish.
Exceptions
creos::UnsupportedErrorif the robot does not support sending velocity commands.
creos::PublicationErrorif an error occurs while publishing the velocity command.

◆ sendCommand() [1/2]

virtual void creos::ISetpointControlInterface::sendCommand ( const creos_messages::Command command,
int timeout_ms = 5000 )
pure virtualVertex

Send a command to the robot to trigger a one-time action.

Parameters
commandThe command to send.
timeout_msThe timeout in milliseconds.
Exceptions
creos::ServiceCallErrorif the command is not accepted.
creos::UnsupportedErrorif the robot does not support commands.
creos::TimeoutErrorif the robot does not respond within the timeout.

◆ sendCommand() [2/2]

virtual void creos::ISetpointControlInterface::sendCommand ( const creos_messages::CommandStamped command,
int timeout_ms = 5000 )
pure virtualVertex

Send a command with timestamp to the robot to trigger a one-time action.

Parameters
commandThe command to send with a timestamp.
timeout_msThe timeout in milliseconds.
Exceptions
creos::ServiceCallErrorif the command is not accepted.
creos::UnsupportedErrorif the robot does not support commands.
creos::TimeoutErrorif the robot does not respond within the timeout.

◆ setControlSource()

virtual void creos::ISetpointControlInterface::setControlSource ( const creos_messages::ControlSource & source,
int timeout_ms = 5000 )
pure virtualOrigin

Set the control source of the robot.

Parameters
sourceThe control source to set.
timeout_msThe timeout in milliseconds.
Exceptions
creos::UnsupportedErrorif the robot does not support setting the control source.
creos::PublicationErrorif an error occurs while setting the control source.
creos::TimeoutErrorif the control source could not be set within the timeout.
creos::ServiceCallErrorif the control source could not be set.

◆ subscribeToCurrentControlSource()

virtual SubscriptionId creos::ISetpointControlInterface::subscribeToCurrentControlSource ( const std::function< void(const creos_messages::ControlSource &)> & callback)
pure virtualOriginVertex

Subscribe to the current control source of the robot.

Parameters
callbackThe callback to call when the control source changes.
Returns
The current control source of the robot.
Exceptions
creos::UnsupportedErrorif the robot does not support getting the control source.
creos::Exceptionif any other error occurred while setting the control source.

The documentation for this class was generated from the following file: