|
staubli_driver_ros2 main
ROS2 control driver for Staubli robots
|
Main interface for controlling Staubli robots. More...
#include <robot_driver.hpp>
Classes | |
| struct | NetworkConfig |
| Configuration structure for the communication. More... | |
Public Member Functions | |
| RobotDriver () | |
| Constructor. | |
| ~RobotDriver () | |
| Destructor. | |
| bool | connect (const std::string &robot_ip, int timeout_ms) |
| Connect to the robot with the default network configuration. | |
| bool | connect (const NetworkConfig &config, int timeout_ms=5000) |
| Connect to the robot with a specific network configuration. | |
| bool | disconnect () |
| Disconnect from the robot. | |
| bool | is_connected () const |
| Check if connected to the robot (does not check for message staleness) | |
| bool | send_stop_all_command () |
| Send a STOP command to the robot (halts motion and sets IOs to zero) | |
| bool | send_robot_command (const RobotCommandMessage &command) |
| Send a command to the robot. | |
| bool | read_robot_state (RobotStateMessage &state) |
| Get the current (latest) robot state. | |
| bool | read_diagnostic_data (DiagnosticDataMessage &data) |
Get the latest diagnostic data, see update_robot_state() for notes. | |
| void | set_state_staleness_timeout (rclcpp::Duration staleness_timeout=rclcpp::Duration(0, 1e8)) |
| Set the staleness timeout after which the robot state is considered stale. | |
| void | set_diagnostic_staleness_timeout (rclcpp::Duration staleness_timeout=rclcpp::Duration(0, 1e8)) |
| Set the staleness timeout after which the diagnostic data is considered stale. | |
| size_t | get_current_message_sequence () const |
| Get the sequence ID of the last valid received robot state message. | |
Protected Member Functions | |
| void | reset_data () |
| bool | is_state_msg_valid () const |
| bool | is_diagnostic_msg_valid () const |
Main interface for controlling Staubli robots.
This class provides methods to connect to a Staubli robot, send commands, and receive state and diagnostic information.
| staubli_robot_driver::RobotDriver::RobotDriver | ( | ) |
Constructor.
| staubli_robot_driver::RobotDriver::~RobotDriver | ( | ) |
Destructor.
Connect to the robot with the default network configuration.
| robot_ip | IP address of the robot |
| timeout_ms | Connection timeout in milliseconds |
| bool staubli_robot_driver::RobotDriver::connect | ( | const NetworkConfig & | config, |
| int | timeout_ms = 5000 |
||
| ) |
Connect to the robot with a specific network configuration.
| config | Network configuration |
| timeout_ms | Connection timeout in milliseconds |
| bool staubli_robot_driver::RobotDriver::disconnect | ( | ) |
Disconnect from the robot.
| bool staubli_robot_driver::RobotDriver::is_connected | ( | ) | const |
Check if connected to the robot (does not check for message staleness)
| bool staubli_robot_driver::RobotDriver::send_stop_all_command | ( | ) |
Send a STOP command to the robot (halts motion and sets IOs to zero)
| bool staubli_robot_driver::RobotDriver::send_robot_command | ( | const RobotCommandMessage & | command | ) |
Send a command to the robot.
| command | Command to send |
| bool staubli_robot_driver::RobotDriver::read_robot_state | ( | RobotStateMessage & | state | ) |
Get the current (latest) robot state.
| [out] | state | Robot state |
| bool staubli_robot_driver::RobotDriver::read_diagnostic_data | ( | DiagnosticDataMessage & | data | ) |
Get the latest diagnostic data, see update_robot_state() for notes.
| [out] | data | Diagnostic data |
| void staubli_robot_driver::RobotDriver::set_state_staleness_timeout | ( | rclcpp::Duration | staleness_timeout = rclcpp::Duration(0, 1e8) | ) |
Set the staleness timeout after which the robot state is considered stale.
| staleness_timeout | Timeout for staleness check; default is 100 ms. |
| void staubli_robot_driver::RobotDriver::set_diagnostic_staleness_timeout | ( | rclcpp::Duration | staleness_timeout = rclcpp::Duration(0, 1e8) | ) |
Set the staleness timeout after which the diagnostic data is considered stale.
| staleness_timeout | Timeout for staleness check; default is 100 ms. |
|
inline |
Get the sequence ID of the last valid received robot state message.
|
protected |
|
protected |
|
protected |