staubli_driver_ros2 main
ROS2 control driver for Staubli robots
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
staubli_robot_driver::MockRobotServer Class Reference

Mock robot server to simulate a Staubli robot for testing purposes. More...

#include <mock_robot_server.hpp>

Classes

struct  NetworkConfig
 Configuration structure for the communication. More...
 

Public Member Functions

 MockRobotServer ()
 Constructor.
 
 ~MockRobotServer ()
 Destructor.
 
bool init (const NetworkConfig &config)
 Initialize the mock robot server with the given network configuration.
 
bool is_ready () const
 Check if mock robot server is initialized and ready.
 
bool disconnect ()
 Disconnect the mock robot server.
 
bool send_mock_robot_state (const RobotStateMessage &state)
 Send a robot state message from the mock robot server.
 
bool send_mock_diagnostic_data (const DiagnosticDataMessage &data)
 Send a diagnostic data message from the mock robot server.
 
bool get_last_received_command (RobotCommandMessage &command, MessageStatus &status)
 Receive a command message sent to the mock robot server.
 

Detailed Description

Mock robot server to simulate a Staubli robot for testing purposes.

Warning
This class is a mock and does not implement all functionalities of the real Robot...

Constructor & Destructor Documentation

◆ MockRobotServer()

staubli_robot_driver::MockRobotServer::MockRobotServer ( )

Constructor.

◆ ~MockRobotServer()

staubli_robot_driver::MockRobotServer::~MockRobotServer ( )

Destructor.

Member Function Documentation

◆ init()

bool staubli_robot_driver::MockRobotServer::init ( const NetworkConfig config)

Initialize the mock robot server with the given network configuration.

Parameters
configNetwork configuration
Returns
True if initialization was successful, false otherwise

◆ is_ready()

bool staubli_robot_driver::MockRobotServer::is_ready ( ) const

Check if mock robot server is initialized and ready.

Returns
True if ready, false otherwise

◆ disconnect()

bool staubli_robot_driver::MockRobotServer::disconnect ( )

Disconnect the mock robot server.

Returns
True if disconnected successfully, false otherwise

◆ send_mock_robot_state()

bool staubli_robot_driver::MockRobotServer::send_mock_robot_state ( const RobotStateMessage state)

Send a robot state message from the mock robot server.

Parameters
stateMock robot state message to send
Returns
true if the message was sent successfully, false otherwise

◆ send_mock_diagnostic_data()

bool staubli_robot_driver::MockRobotServer::send_mock_diagnostic_data ( const DiagnosticDataMessage data)

Send a diagnostic data message from the mock robot server.

Parameters
dataMock diagnostic data message to send
Returns
true if the message was sent successfully, false otherwise

◆ get_last_received_command()

bool staubli_robot_driver::MockRobotServer::get_last_received_command ( RobotCommandMessage command,
MessageStatus status 
)

Receive a command message sent to the mock robot server.

Parameters
commandOutput command message
Returns
True if a message was received successfully, false otherwise

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