rby1-sdk
Loading...
Searching...
No Matches
rb::Robot< T > Class Template Reference

Robot control interface. More...

#include <robot.h>

Inheritance diagram for rb::Robot< T >:

Public Types

using ModelType = T
 

Public Member Functions

bool BrakeEngage (const std::string &dev_name) const
 Engage the brake for a device.
 
bool BrakeRelease (const std::string &dev_name) const
 Release the brake for a device.
 
bool CancelControl () const
 Cancel current control operation.
 
bool Connect (int max_retries=5, int timeout_ms=1000, std::function< bool()> signal_check=nullptr)
 Attempts to establish a connection with the robot.
 
bool ConnectWifi (const std::string &ssid, const std::string &password="", bool use_dhcp=true, const std::string &ip_address="", const std::string &gateway="", const std::vector< std::string > &dns={}) const
 Connect to WiFi network.
 
bool Control (std::function< ControlInput< T >(const ControlState< T > &)> control, int port=0, int priority=1)
 Start a blocking real-time control loop using a custom control callback.
 
std::unique_ptr< RobotCommandStreamHandler< T > > CreateCommandStream (int priority=1)
 Create a command stream for continuous command sending.
 
bool DisableControlManager () const
 Disable the control manager.
 
void Disconnect ()
 Disconnect from the robot.
 
bool DisconnectWifi () const
 Disconnect from WiFi network.
 
bool DownloadFile (const std::string &path, std::ostream &output) const
 Download a file from the robot.
 
bool DownloadFileToCallback (const std::string &path, std::function< void(const char *, size_t)> on_chunk) const
 Download a file from the robot using a callback function.
 
bool EnableControlManager (bool unlimited_mode_enabled=false) const
 Enable the control manager.
 
void FactoryResetAllParameters () const
 Factory reset all parameters to their default values.
 
bool FactoryResetParameter (const std::string &name) const
 Factory reset a parameter to its default value.
 
std::string GetAddress ()
 Get the robot's network address.
 
ControlManagerState GetControlManagerState () const
 Get control manager state.
 
std::shared_ptr< dyn::Robot< T::kRobotDOF > > GetDynamics (const std::string &urdf_model="")
 Get robot dynamics model.
 
std::vector< std::string > GetFaultLogList () const
 Get fault log list.
 
std::vector< rb::PIDGainGetHeadPositionPIDGains () const
 Get head position PID gains.
 
std::vector< LogGetLastLog (unsigned int count) const
 Get last log entries.
 
std::vector< rb::PIDGainGetLeftArmPositionPIDGains () const
 Get left arm position PID gains.
 
std::string GetParameter (const std::string &name) const
 Get a robot parameter value.
 
std::vector< std::pair< std::string, int > > GetParameterList () const
 Get list of available parameters.
 
rb::PIDGain GetPositionPIDGain (const std::string &dev_name) const
 Get position PID gain for a specific device.
 
std::vector< rb::PIDGainGetRightArmPositionPIDGains () const
 Get right arm position PID gains.
 
RobotInfo GetRobotInfo () const
 Retrieves static information about the robot.
 
std::string GetRobotModel () const
 Get robot model information.
 
std::vector< SerialDeviceGetSerialDeviceList () const
 Get list of available serial devices on the robot.
 
RobotState< T > GetState () const
 Get current robot state.
 
std::tuple< struct timespec, std::string, std::string > GetSystemTime () const
 Get robot system time.
 
double GetTimeScale () const
 Get the current time scale factor.
 
std::vector< rb::PIDGainGetTorsoPositionPIDGains () const
 Get torso position PID gains.
 
std::optional< WifiStatusGetWifiStatus () const
 Get WiFi connection status.
 
bool HasEstablishedTimeSync ()
 Check if time synchronization has been established.
 
bool HomeOffsetReset (const std::string &dev_name) const
 Reset home offset for a device.
 
bool ImportRobotModel (const std::string &name, const std::string &model) const
 Import robot model.
 
bool IsConnected () const
 Checks whether the robot is currently connected.
 
bool IsPowerOn (const std::string &dev_name) const
 Check if a device is powered on.
 
bool IsServoOn (const std::string &dev_name) const
 Check if servo control is enabled for a device.
 
std::unique_ptr< SerialStreamOpenSerialStream (const std::string &device_path, int buadrate, int bytesize, char parity, int stopbits) const
 Open a serial stream.
 
bool PowerOff (const std::string &dev_name) const
 Power off a device.
 
bool PowerOn (const std::string &dev_name) const
 Power on a device.
 
void ResetAllParameters () const
 Reset all parameters to their default values.
 
void ResetAllParametersToDefault () const
 
bool ResetBatteryConfig () const
 Reset battery configuration to default.
 
bool ResetFaultControlManager () const
 Reset fault in the control manager.
 
bool ResetNetworkSetting () const
 Reset network settings to default.
 
bool ResetOdometry (double angle, const Eigen::Vector< double, 2 > &position)
 Reset odometry to specified values.
 
bool ResetParameter (const std::string &name) const
 Reset a parameter to its default value.
 
bool ResetParameterToDefault (const std::string &name) const
 
std::vector< WifiNetworkScanWifi () const
 Scan for available WiFi networks.
 
std::unique_ptr< RobotCommandHandler< T > > SendCommand (const RobotCommandBuilder &builder, int priority=1)
 Send a command to the robot.
 
bool ServoOff (const std::string &dev_name) const
 Disable servo control for a device.
 
bool ServoOn (const std::string &dev_name) const
 Enable servo control for a device.
 
bool SetBatteryConfig (double cutoff_voltage, double fully_charged_voltage, const std::array< double, 4 > &coefficients)
 Set battery configuration.
 
bool SetBatteryLevel (double level) const
 Set battery level.
 
bool SetLEDColor (const Color &color, double duration=1, double transition_time=0, bool blinking=false, double blinking_freq=1)
 Set LED color.
 
bool SetParameter (const std::string &name, const std::string &value, bool write_db=true)
 Set a robot parameter.
 
bool SetPositionDGain (const std::string &dev_name, uint16_t d_gain) const
 Set position derivative gain for a device.
 
bool SetPositionIGain (const std::string &dev_name, uint16_t i_gain) const
 Set position integral gain for a device.
 
bool SetPositionPGain (const std::string &dev_name, uint16_t p_gain) const
 Set position proportional gain for a device.
 
bool SetPositionPIDGain (const std::string &dev_name, const rb::PIDGain &pid_gain) const
 Set position PID gains for a device.
 
bool SetPositionPIDGain (const std::string &dev_name, uint16_t p_gain, uint16_t i_gain, uint16_t d_gain) const
 Set position PID gains for a device.
 
bool SetPresetPosition (const std::string &joint_name) const
 Set preset position for a joint (only available for PVL-based motors).
 
bool SetSystemTime (struct timespec utc_time, std::optional< std::string > time_zone=std::nullopt) const
 Set robot system time.
 
double SetTimeScale (double time_scale) const
 Set the time scale for motion execution.
 
bool SetToolFlangeDigitalOutput (const std::string &name, unsigned int channel, bool state) const
 Set the digital output state of a specific channel on the tool flange.
 
bool SetToolFlangeDigitalOutputDual (const std::string &name, bool state_0, bool state_1) const
 Set the digital output states of two channels on the tool flange simultaneously.
 
bool SetToolFlangeOutputVoltage (const std::string &name, int voltage) const
 Set tool flange output voltage.
 
void StartLogStream (const std::function< void(const std::vector< Log > &)> &cb, double rate)
 Start log stream callback.
 
void StartStateUpdate (const std::function< void(const RobotState< T > &)> &cb, double rate)
 Start state update callback.
 
void StartStateUpdate (const std::function< void(const RobotState< T > &, const ControlManagerState &)> &cb, double rate)
 Start state update callback with control manager state.
 
bool StartTimeSync (long period_sec=10)
 Start time synchronization.
 
void StopLogStream ()
 Stop log stream callback.
 
void StopStateUpdate ()
 Stop state update callback.
 
bool StopTimeSync ()
 Stop time synchronization.
 
bool SyncTime ()
 Synchronize time with the robot.
 
bool WaitForControlReady (long timeout_ms) const
 Wait until the robot is ready to accept control commands.
 

Static Public Member Functions

static std::shared_ptr< Robot< T > > Create (std::string address)
 Create a robot instance.
 

Detailed Description

template<typename T>
class rb::Robot< T >

Robot control interface.

Provides high-level control interface for robot operations including connection management, power control, and command execution.

Template Parameters
TRobot model type

Member Function Documentation

◆ BrakeEngage()

template<typename T >
bool rb::Robot< T >::BrakeEngage ( const std::string & dev_name) const

Engage the brake for a device.

Parameters
dev_nameDevice name (joint name) to engage brake. Supports regex patterns.
Returns
True if successful, false otherwise.

◆ BrakeRelease()

template<typename T >
bool rb::Robot< T >::BrakeRelease ( const std::string & dev_name) const

Release the brake for a device.

Parameters
dev_nameDevice name (joint name) to release brake. Supports regex patterns.
Returns
True if successful, false otherwise.

◆ CancelControl()

template<typename T >
bool rb::Robot< T >::CancelControl ( ) const

Cancel current control operation.

Returns
True if successful, false otherwise.

◆ Connect()

template<typename T >
bool rb::Robot< T >::Connect ( int max_retries = 5,
int timeout_ms = 1000,
std::function< bool()> signal_check = nullptr )

Attempts to establish a connection with the robot.

Parameters
max_retriesMaximum number of retries to connect (default: 5).
timeout_msTimeout in milliseconds for each connection attempt (default: 1000).
signal_checkOptional function to check for a signal (e.g., Ctrl+C). If provided, the connection will be aborted if this function returns false.
Returns
True if the connection was successful, false otherwise.

◆ ConnectWifi()

template<typename T >
bool rb::Robot< T >::ConnectWifi ( const std::string & ssid,
const std::string & password = "",
bool use_dhcp = true,
const std::string & ip_address = "",
const std::string & gateway = "",
const std::vector< std::string > & dns = {} ) const

Connect to WiFi network.

Parameters
ssidWiFi network name.
passwordWiFi password (default: empty string).
use_dhcpUse DHCP for automatic IP configuration (default: true).
ip_addressStatic IP address (default: empty string).
gatewayGateway address (default: empty string).
dnsDNS servers (default: empty vector).
Returns
True if successful, false otherwise.

◆ Control()

template<typename T >
bool rb::Robot< T >::Control ( std::function< ControlInput< T >(const ControlState< T > &)> control,
int port = 0,
int priority = 1 )

Start a blocking real-time control loop using a custom control callback.

This function runs a UDP-based real-time loop that repeatedly calls the user-provided control callback. The loop exits when the callback returns a ControlInput with finish=true, or when an error/abort occurs.

Parameters
controlA callable that accepts a ControlState and returns a ControlInput.
portUDP port to bind for the RT server. Use 0 to let the OS choose an available port (default: 0).
priorityCommand priority sent with the RT control request (default: 1).
Returns
True if the loop terminated because the callback set finish=true in ControlInput, false if the loop ended due to an error or abort.

◆ Create()

template<typename T >
static std::shared_ptr< Robot< T > > rb::Robot< T >::Create ( std::string address)
static

Create a robot instance.

Parameters
addressRobot network address, e.g. "192.168.1.100:50051".
Returns
std::shared_ptr<Robot<T>> Robot instance.

◆ CreateCommandStream()

template<typename T >
std::unique_ptr< RobotCommandStreamHandler< T > > rb::Robot< T >::CreateCommandStream ( int priority = 1)

Create a command stream for continuous command sending.

Parameters
priorityCommand priority (default: 1).
Returns
std::unique_ptr<RobotCommandStreamHandler<T>> Command stream handler.

◆ DisableControlManager()

template<typename T >
bool rb::Robot< T >::DisableControlManager ( ) const

Disable the control manager.

Returns
True if successful, false otherwise.

◆ DisconnectWifi()

template<typename T >
bool rb::Robot< T >::DisconnectWifi ( ) const

Disconnect from WiFi network.

Returns
True if successful, false otherwise.

◆ DownloadFile()

template<typename T >
bool rb::Robot< T >::DownloadFile ( const std::string & path,
std::ostream & output ) const

Download a file from the robot.

Parameters
pathFile path on the robot.
outputOutput stream to write the file content.
Returns
True if successful, false otherwise.

◆ DownloadFileToCallback()

template<typename T >
bool rb::Robot< T >::DownloadFileToCallback ( const std::string & path,
std::function< void(const char *, size_t)> on_chunk ) const

Download a file from the robot using a callback function.

Parameters
pathFile path on the robot.
on_chunkCallback function called for each chunk of data.
Returns
True if successful, false otherwise.

◆ EnableControlManager()

template<typename T >
bool rb::Robot< T >::EnableControlManager ( bool unlimited_mode_enabled = false) const

Enable the control manager.

Must be called before sending commands to the robot.

Parameters
unlimited_mode_enabledWhether to enable unlimited mode (default: false).
Returns
True if successful, false otherwise.

◆ FactoryResetParameter()

template<typename T >
bool rb::Robot< T >::FactoryResetParameter ( const std::string & name) const

Factory reset a parameter to its default value.

Parameters
nameParameter name.
Returns
True if successful, false otherwise.

◆ GetAddress()

template<typename T >
std::string rb::Robot< T >::GetAddress ( )

Get the robot's network address.

Returns
std::string The robot's address.

◆ GetControlManagerState()

template<typename T >
ControlManagerState rb::Robot< T >::GetControlManagerState ( ) const

Get control manager state.

Returns
ControlManagerState Current control manager state.

◆ GetDynamics()

template<typename T >
std::shared_ptr< dyn::Robot< T::kRobotDOF > > rb::Robot< T >::GetDynamics ( const std::string & urdf_model = "")

Get robot dynamics model.

Parameters
urdf_modelURDF model path (default: empty string to use robot's model).
Returns
std::shared_ptr<dyn::Robot<T::kRobotDOF>> Robot dynamics model.

◆ GetFaultLogList()

template<typename T >
std::vector< std::string > rb::Robot< T >::GetFaultLogList ( ) const

Get fault log list.

Returns
std::vector<std::string> List of fault log entries.

◆ GetHeadPositionPIDGains()

template<typename T >
std::vector< rb::PIDGain > rb::Robot< T >::GetHeadPositionPIDGains ( ) const

Get head position PID gains.

Returns
std::vector<rb::PIDGain> Vector of PID gains for head joints.

◆ GetLastLog()

template<typename T >
std::vector< Log > rb::Robot< T >::GetLastLog ( unsigned int count) const

Get last log entries.

Parameters
countNumber of log entries to retrieve.
Returns
std::vector<Log> List of log entries.

◆ GetLeftArmPositionPIDGains()

template<typename T >
std::vector< rb::PIDGain > rb::Robot< T >::GetLeftArmPositionPIDGains ( ) const

Get left arm position PID gains.

Returns
std::vector<rb::PIDGain> Vector of PID gains for left arm joints.

◆ GetParameter()

template<typename T >
std::string rb::Robot< T >::GetParameter ( const std::string & name) const

Get a robot parameter value.

Parameters
nameParameter name.
Returns
std::string Parameter value.

◆ GetParameterList()

template<typename T >
std::vector< std::pair< std::string, int > > rb::Robot< T >::GetParameterList ( ) const

Get list of available parameters.

Returns
std::vector<std::pair<std::string, int>> List of parameter names and their types.

◆ GetPositionPIDGain()

template<typename T >
rb::PIDGain rb::Robot< T >::GetPositionPIDGain ( const std::string & dev_name) const

Get position PID gain for a specific device.

Parameters
dev_nameDevice name.
Returns
rb::PIDGain PID gain for the specified device.

◆ GetRightArmPositionPIDGains()

template<typename T >
std::vector< rb::PIDGain > rb::Robot< T >::GetRightArmPositionPIDGains ( ) const

Get right arm position PID gains.

Returns
std::vector<rb::PIDGain> Vector of PID gains for right arm joints.

◆ GetRobotInfo()

template<typename T >
RobotInfo rb::Robot< T >::GetRobotInfo ( ) const

Retrieves static information about the robot.

Gets structured metadata including joint details, device names, robot model information, SDK version, and joint configuration.

Returns
RobotInfo Robot information structure.

◆ GetRobotModel()

template<typename T >
std::string rb::Robot< T >::GetRobotModel ( ) const

Get robot model information.

Returns
std::string Robot model string.

◆ GetSerialDeviceList()

template<typename T >
std::vector< SerialDevice > rb::Robot< T >::GetSerialDeviceList ( ) const

Get list of available serial devices on the robot.

Returns
std::vector<SerialDevice> List of available serial devices.

◆ GetState()

template<typename T >
RobotState< T > rb::Robot< T >::GetState ( ) const

Get current robot state.

Returns
RobotState<T> Current robot state.

◆ GetSystemTime()

template<typename T >
std::tuple< struct timespec, std::string, std::string > rb::Robot< T >::GetSystemTime ( ) const

Get robot system time.

Returns
std::tuple<struct timespec, std::string, std::string> Robot system time, timezone string, and local time string.

◆ GetTimeScale()

template<typename T >
double rb::Robot< T >::GetTimeScale ( ) const

Get the current time scale factor.

Returns
double Current time scale factor.

◆ GetTorsoPositionPIDGains()

template<typename T >
std::vector< rb::PIDGain > rb::Robot< T >::GetTorsoPositionPIDGains ( ) const

Get torso position PID gains.

Returns
std::vector<rb::PIDGain> Vector of PID gains for torso joints.

◆ GetWifiStatus()

template<typename T >
std::optional< WifiStatus > rb::Robot< T >::GetWifiStatus ( ) const

Get WiFi connection status.

Returns
std::optional<WifiStatus> Current WiFi status.

◆ HasEstablishedTimeSync()

template<typename T >
bool rb::Robot< T >::HasEstablishedTimeSync ( )

Check if time synchronization has been established.

Returns
True if time sync is established, false otherwise.

◆ HomeOffsetReset()

template<typename T >
bool rb::Robot< T >::HomeOffsetReset ( const std::string & dev_name) const

Reset home offset for a device.

Parameters
dev_nameDevice name to reset home offset. Supports regex patterns.
Returns
True if successful, false otherwise.

◆ ImportRobotModel()

template<typename T >
bool rb::Robot< T >::ImportRobotModel ( const std::string & name,
const std::string & model ) const

Import robot model.

Parameters
nameModel name.
modelModel data.
Returns
True if successful, false otherwise.

◆ IsConnected()

template<typename T >
bool rb::Robot< T >::IsConnected ( ) const
nodiscard

Checks whether the robot is currently connected.

Returns
True if the robot is connected, false otherwise.

◆ IsPowerOn()

template<typename T >
bool rb::Robot< T >::IsPowerOn ( const std::string & dev_name) const

Check if a device is powered on.

Parameters
dev_nameDevice name to check. Supports regex patterns.
Returns
True if device is powered on, false otherwise.

◆ IsServoOn()

template<typename T >
bool rb::Robot< T >::IsServoOn ( const std::string & dev_name) const

Check if servo control is enabled for a device.

Parameters
dev_nameDevice name to check. Supports regex patterns.
Returns
True if servo control is enabled, false otherwise.

◆ OpenSerialStream()

template<typename T >
std::unique_ptr< SerialStream > rb::Robot< T >::OpenSerialStream ( const std::string & device_path,
int buadrate,
int bytesize,
char parity,
int stopbits ) const

Open a serial stream.

Parameters
device_pathSerial device path.
buadrateBaud rate.
bytesizeByte size.
parityParity.
stopbitsStop bits.
Returns
std::unique_ptr<SerialStream> Serial stream instance.

◆ PowerOff()

template<typename T >
bool rb::Robot< T >::PowerOff ( const std::string & dev_name) const

Power off a device.

Parameters
dev_nameDevice name to power off. Supports regex patterns (e.g., ".*" for all devices).
Returns
True if successful, false otherwise.

◆ PowerOn()

template<typename T >
bool rb::Robot< T >::PowerOn ( const std::string & dev_name) const

Power on a device.

Parameters
dev_nameDevice name to power on. Supports regex patterns (e.g., ".*" for all devices).
Returns
True if successful, false otherwise.

◆ ResetBatteryConfig()

template<typename T >
bool rb::Robot< T >::ResetBatteryConfig ( ) const

Reset battery configuration to default.

Returns
True if successful, false otherwise.

◆ ResetFaultControlManager()

template<typename T >
bool rb::Robot< T >::ResetFaultControlManager ( ) const

Reset fault in the control manager.

Returns
True if successful, false otherwise.

◆ ResetNetworkSetting()

template<typename T >
bool rb::Robot< T >::ResetNetworkSetting ( ) const

Reset network settings to default.

Returns
True if successful, false otherwise.

◆ ResetOdometry()

template<typename T >
bool rb::Robot< T >::ResetOdometry ( double angle,
const Eigen::Vector< double, 2 > & position )

Reset odometry to specified values.

Parameters
angleNew angle [rad].
positionNew position [m]. Position is [x, y] in meters.
Returns
True if successful, false otherwise.

◆ ResetParameter()

template<typename T >
bool rb::Robot< T >::ResetParameter ( const std::string & name) const

Reset a parameter to its default value.

Parameters
nameParameter name.
Returns
True if successful, false otherwise.

◆ ScanWifi()

template<typename T >
std::vector< WifiNetwork > rb::Robot< T >::ScanWifi ( ) const

Scan for available WiFi networks.

Returns
std::vector<WifiNetwork> List of available WiFi networks.

◆ SendCommand()

template<typename T >
std::unique_ptr< RobotCommandHandler< T > > rb::Robot< T >::SendCommand ( const RobotCommandBuilder & builder,
int priority = 1 )

Send a command to the robot.

Parameters
builderCommand builder to send.
priorityCommand priority (default: 1).
Returns
std::unique_ptr<RobotCommandHandler<T>> Command handler for monitoring execution.

◆ ServoOff()

template<typename T >
bool rb::Robot< T >::ServoOff ( const std::string & dev_name) const

Disable servo control for a device.

Parameters
dev_nameDevice name to disable servo control. Supports regex patterns.
Returns
True if successful, false otherwise.

◆ ServoOn()

template<typename T >
bool rb::Robot< T >::ServoOn ( const std::string & dev_name) const

Enable servo control for a device.

Parameters
dev_nameDevice name to enable servo control. Supports regex patterns (e.g., ".*" for all devices).
Returns
True if successful, false otherwise.

◆ SetBatteryConfig()

template<typename T >
bool rb::Robot< T >::SetBatteryConfig ( double cutoff_voltage,
double fully_charged_voltage,
const std::array< double, 4 > & coefficients )

Set battery configuration.

Parameters
cutoff_voltageCutoff voltage [V].
fully_charged_voltageFully charged voltage [V].
coefficientsBattery coefficients array.
Returns
True if successful, false otherwise.

◆ SetBatteryLevel()

template<typename T >
bool rb::Robot< T >::SetBatteryLevel ( double level) const

Set battery level.

Parameters
levelBattery level percentage (0.0 to 100.0).
Returns
True if successful, false otherwise.

◆ SetLEDColor()

template<typename T >
bool rb::Robot< T >::SetLEDColor ( const Color & color,
double duration = 1,
double transition_time = 0,
bool blinking = false,
double blinking_freq = 1 )

Set LED color.

Parameters
colorLED color.
durationDuration [s] (default: 1).
transition_timeTransition time [s] (default: 0).
blinkingWhether to blink (default: false).
blinking_freqBlinking frequency [Hz] (default: 1).
Returns
True if successful, false otherwise.

◆ SetParameter()

template<typename T >
bool rb::Robot< T >::SetParameter ( const std::string & name,
const std::string & value,
bool write_db = true )

Set a robot parameter.

Parameters
nameParameter name.
valueParameter value.
write_dbWhether to write to database (default: true).
Returns
True if successful, false if matching parameter not found.

◆ SetPositionDGain()

template<typename T >
bool rb::Robot< T >::SetPositionDGain ( const std::string & dev_name,
uint16_t d_gain ) const

Set position derivative gain for a device.

Parameters
dev_nameDevice name. Supports regex patterns.
d_gainDerivative gain value.
Returns
True if successful, false otherwise.

◆ SetPositionIGain()

template<typename T >
bool rb::Robot< T >::SetPositionIGain ( const std::string & dev_name,
uint16_t i_gain ) const

Set position integral gain for a device.

Parameters
dev_nameDevice name. Supports regex patterns.
i_gainIntegral gain value.
Returns
True if successful, false otherwise.

◆ SetPositionPGain()

template<typename T >
bool rb::Robot< T >::SetPositionPGain ( const std::string & dev_name,
uint16_t p_gain ) const

Set position proportional gain for a device.

Parameters
dev_nameDevice name. Supports regex patterns.
p_gainProportional gain value.
Returns
True if successful, false otherwise.

◆ SetPositionPIDGain() [1/2]

template<typename T >
bool rb::Robot< T >::SetPositionPIDGain ( const std::string & dev_name,
const rb::PIDGain & pid_gain ) const

Set position PID gains for a device.

Parameters
dev_nameDevice name. Supports regex patterns.
pid_gainPID gain structure.
Returns
True if successful, false otherwise.

◆ SetPositionPIDGain() [2/2]

template<typename T >
bool rb::Robot< T >::SetPositionPIDGain ( const std::string & dev_name,
uint16_t p_gain,
uint16_t i_gain,
uint16_t d_gain ) const

Set position PID gains for a device.

Parameters
dev_nameDevice name. Supports regex patterns.
p_gainProportional gain value.
i_gainIntegral gain value.
d_gainDerivative gain value.
Returns
True if successful, false otherwise.

◆ SetPresetPosition()

template<typename T >
bool rb::Robot< T >::SetPresetPosition ( const std::string & joint_name) const

Set preset position for a joint (only available for PVL-based motors).

Parameters
joint_nameJoint name to set preset position.
Returns
True if successful, false otherwise.

◆ SetSystemTime()

template<typename T >
bool rb::Robot< T >::SetSystemTime ( struct timespec utc_time,
std::optional< std::string > time_zone = std::nullopt ) const

Set robot system time.

Parameters
utc_timeNew system time in UTC.
time_zoneTime zone (optional).
Returns
True if successful, false otherwise.

◆ SetTimeScale()

template<typename T >
double rb::Robot< T >::SetTimeScale ( double time_scale) const

Set the time scale for motion execution.

Parameters
time_scaleTime scale value (0.0 to 1.0). 0.0 stops motion, 1.0 is full speed.
Returns
double The set time scale factor.

◆ SetToolFlangeDigitalOutput()

template<typename T >
bool rb::Robot< T >::SetToolFlangeDigitalOutput ( const std::string & name,
unsigned int channel,
bool state ) const

Set the digital output state of a specific channel on the tool flange.

Parameters
nameArm identifier ("right" or "left").
channelDigital output channel index.
stateDesired state of the digital output (true = ON, false = OFF).
Returns
True if the command was successfully sent, false otherwise.

◆ SetToolFlangeDigitalOutputDual()

template<typename T >
bool rb::Robot< T >::SetToolFlangeDigitalOutputDual ( const std::string & name,
bool state_0,
bool state_1 ) const

Set the digital output states of two channels on the tool flange simultaneously.

Parameters
nameArm identifier ("right" or "left").
state_0Desired state for digital output channel 0 (true = ON, false = OFF).
state_1Desired state for digital output channel 1 (true = ON, false = OFF).
Returns
True if the command was successfully sent, false otherwise.

◆ SetToolFlangeOutputVoltage()

template<typename T >
bool rb::Robot< T >::SetToolFlangeOutputVoltage ( const std::string & name,
int voltage ) const

Set tool flange output voltage.

Parameters
nameTool flange name ("right" or "left").
voltageOutput voltage [V]. Common voltages: 12V, 24V. Use 0V to turn off output.
Returns
True if successful, false otherwise.

◆ StartLogStream()

template<typename T >
void rb::Robot< T >::StartLogStream ( const std::function< void(const std::vector< Log > &)> & cb,
double rate )

Start log stream callback.

Parameters
cbCallback function for log updates.
rateUpdate rate [Hz].

◆ StartStateUpdate() [1/2]

template<typename T >
void rb::Robot< T >::StartStateUpdate ( const std::function< void(const RobotState< T > &)> & cb,
double rate )

Start state update callback.

Parameters
cbCallback function for robot state updates.
rateUpdate rate [Hz].

◆ StartStateUpdate() [2/2]

template<typename T >
void rb::Robot< T >::StartStateUpdate ( const std::function< void(const RobotState< T > &, const ControlManagerState &)> & cb,
double rate )

Start state update callback with control manager state.

Parameters
cbCallback function for robot state and control manager state updates.
rateUpdate rate [Hz].

◆ StartTimeSync()

template<typename T >
bool rb::Robot< T >::StartTimeSync ( long period_sec = 10)

Start time synchronization.

Parameters
period_secSynchronization period [s] (default: 10).
Returns
True if successful, false otherwise.

◆ StopTimeSync()

template<typename T >
bool rb::Robot< T >::StopTimeSync ( )

Stop time synchronization.

Returns
True if successful, false otherwise.

◆ SyncTime()

template<typename T >
bool rb::Robot< T >::SyncTime ( )

Synchronize time with the robot.

Returns
True if successful, false otherwise.

◆ WaitForControlReady()

template<typename T >
bool rb::Robot< T >::WaitForControlReady ( long timeout_ms) const

Wait until the robot is ready to accept control commands.

Call after servo_on() and before sending control commands.

Parameters
timeout_msTimeout [ms].
Returns
True if the robot is ready to accept control, false if timeout expired.

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