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

Robot command stream handler for continuous command sending. More...

#include <robot.h>

Public Member Functions

void Cancel ()
 
bool IsDone () const
 Check if the command stream is complete.
 
RobotCommandFeedback RequestFeedback (int timeout_ms=1000)
 Request feedback from the current command stream.
 
RobotCommandFeedback SendCommand (const RobotCommandBuilder &builder, int timeout_ms=1000)
 Send a command through the stream.
 
void Wait ()
 Wait for the command stream to complete.
 
bool WaitFor (int timeout_ms)
 Wait for the command stream to complete with timeout.
 

Friends

class RobotImpl< T >
 

Detailed Description

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

Robot command stream handler for continuous command sending.

Provides a streaming interface for sending multiple commands to the robot in sequence while maintaining a persistent connection. This is more efficient than creating individual command handlers for each command.

Template Parameters
TRobot model type

Member Function Documentation

◆ IsDone()

template<typename T >
bool rb::RobotCommandStreamHandler< T >::IsDone ( ) const

Check if the command stream is complete.

Returns
True if the stream is done/closed, false otherwise.

◆ RequestFeedback()

template<typename T >
RobotCommandFeedback rb::RobotCommandStreamHandler< T >::RequestFeedback ( int timeout_ms = 1000)

Request feedback from the current command stream.

Requests current controller state information from the ongoing command execution. The feedback includes control errors, target vs actual positions, and execution status.

Parameters
timeout_msTimeout for receiving controller feedback in milliseconds (default: 1000).
Returns
RobotCommandFeedback Current controller state including position errors, control status, and execution progress.

◆ SendCommand()

template<typename T >
RobotCommandFeedback rb::RobotCommandStreamHandler< T >::SendCommand ( const RobotCommandBuilder & builder,
int timeout_ms = 1000 )

Send a command through the stream.

Sends a command via the established stream connection and waits for feedback. The command is executed asynchronously by the robot, and this method returns current controller state information (e.g., position error, control status).

Parameters
builderCommand builder containing the command to send.
timeout_msTimeout for receiving controller feedback in milliseconds (default: 1000). This is the time to wait for controller state information, not the command execution timeout.
Returns
RobotCommandFeedback Current controller state information including position errors, control status, and execution progress.

◆ Wait()

template<typename T >
void rb::RobotCommandStreamHandler< T >::Wait ( )

Wait for the command stream to complete.

This method blocks until the stream is closed or cancelled.

◆ WaitFor()

template<typename T >
bool rb::RobotCommandStreamHandler< T >::WaitFor ( int timeout_ms)

Wait for the command stream to complete with timeout.

Parameters
timeout_msTimeout in milliseconds.
Returns
True if stream completed, false if timeout occurred.

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