|
staubli_driver_ros2 main
ROS2 control driver for Staubli robots
|
Class for handling bidirectional UDP communication. More...
#include <udp_socket.hpp>
Public Member Functions | |
| UDPSocket () | |
| ~UDPSocket () override | |
| bool | connect (const std::string &remote_address, uint16_t remote_port, uint16_t local_port) override |
| Connect to the remote endpoint. | |
| bool | connect (const std::string &remote_address, uint16_t remote_port, const std::string &local_address, uint16_t local_port) override |
| Connect to the remote endpoint with specific local address. | |
| bool | disconnect () override |
| Disconnect from the remote endpoint. | |
| bool | is_connected () const override |
| Check if the connection is established. | |
| bool | send (std::vector< uint8_t > &data) override |
| Send data to the remote endpoint. | |
| bool | receive_once (int timeout_ms, std::vector< uint8_t > &data) override |
| Receive data from socket (blocking with timeout) | |
| bool | start_receive_thread (std::function< void(std::vector< uint8_t > &, size_t)> reception_callback) override |
| Start a receive thread that calls the provided reception_callback when data is received. | |
| bool | stop_receive_thread () override |
| Stop the receive thread. | |
| bool | is_receiving () const override |
| Check if the receive thread is running. | |
Public Member Functions inherited from staubli_robot_driver::Socket | |
| Socket ()=default | |
| Default constructor. | |
| virtual | ~Socket ()=default |
| Virtual destructor. | |
Class for handling bidirectional UDP communication.
| staubli_robot_driver::UDPSocket::UDPSocket | ( | ) |
|
override |
|
overridevirtual |
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 |
Implements staubli_robot_driver::Socket.
|
overridevirtual |
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 |
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Disconnect from the remote endpoint.
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Check if the connection is established.
Implements staubli_robot_driver::Socket.
Send data to the remote endpoint.
| data | Data to send |
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Receive data from socket (blocking with timeout)
| timeout_ms | Timeout in milliseconds |
| data | Will be filled with received data |
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Start a receive thread that calls the provided reception_callback when data is received.
| reception_callback | Function to call when data is received |
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Stop the receive thread.
Implements staubli_robot_driver::Socket.
|
overridevirtual |
Check if the receive thread is running.
Implements staubli_robot_driver::Socket.