|
staubli_driver_ros2 main
ROS2 control driver for Staubli robots
|
Abstract interface for communication with the robot. More...
#include <socket.hpp>
Public Member Functions | |
| Socket ()=default | |
| Default constructor. | |
| virtual | ~Socket ()=default |
| Virtual destructor. | |
| virtual bool | connect (const std::string &remote_address, uint16_t remote_port, uint16_t local_port)=0 |
| Connect to the remote endpoint. | |
| virtual bool | connect (const std::string &remote_address, uint16_t remote_port, const std::string &local_address, uint16_t local_port)=0 |
| Connect to the remote endpoint with specific local address. | |
| virtual bool | disconnect ()=0 |
| Disconnect from the remote endpoint. | |
| virtual bool | is_connected () const =0 |
| Check if the connection is established. | |
| virtual bool | send (std::vector< uint8_t > &data)=0 |
| Send data to the remote endpoint. | |
| virtual bool | receive_once (int timeout_ms, std::vector< uint8_t > &data)=0 |
| Receive data from socket (blocking with timeout) | |
| virtual bool | start_receive_thread (std::function< void(std::vector< uint8_t > &, size_t)> reception_callback)=0 |
| Start a receive thread that calls the provided reception_callback when data is received. | |
| virtual bool | stop_receive_thread ()=0 |
| Stop the receive thread. | |
| virtual bool | is_receiving () const =0 |
| Check if the receive thread is running. | |
Abstract interface for communication with the robot.
This interface defines the methods required for any communication protocol implementation (UDP / TCP)
|
default |
Default constructor.
|
virtualdefault |
Virtual destructor.
|
pure virtual |
Connect to the remote endpoint.
| remote_address | Address of the remote endpoint (format depends on protocol) |
| remote_port | Port or identifier for the remote endpoint |
| local_port | Port or identifier for the local endpoint |
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
|
pure virtual |
Connect to the remote endpoint with specific local address.
| remote_address | Address of the remote endpoint (format depends on protocol) |
| remote_port | Port or identifier for the remote endpoint |
| local_address | Local IP address to bind to (e.g., "192.168.1.100", "0.0.0.0" for any) |
| local_port | Port or identifier for the local endpoint |
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
Disconnect from the remote endpoint.
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
Check if the connection is established.
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
Send data to the remote endpoint.
| data | Data to send |
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
|
pure virtual |
Receive data from socket (blocking with timeout)
| timeout_ms | Timeout in milliseconds |
| data | Will be filled with received data |
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
|
pure virtual |
Start a receive thread that calls the provided reception_callback when data is received.
| reception_callback | Function to call when data is received |
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
Stop the receive thread.
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.
Check if the receive thread is running.
Implemented in staubli_robot_driver::TCPSocket, and staubli_robot_driver::UDPSocket.