|
sas
Modularised monitoring, logging, and control of robots.
|
Server interface for robot driver ROS topics. More...
#include <sas_robot_driver_server.hpp>
Public Member Functions | |
| RobotDriverServer (const RobotDriverServer &)=delete | |
| RobotDriverServer (const std::shared_ptr< Node > &node, const std::string &node_prefix="GET_FROM_NODE") | |
| Construct a new RobotDriverServer. | |
| VectorXd | get_target_joint_positions () const |
| Get the most recent target joint positions received from clients. | |
| VectorXd | get_target_joint_velocities () const |
| Get the most recent target joint velocities received from clients. | |
| VectorXd | get_target_joint_forces () const |
| Get the most recent target joint forces received from clients. | |
| VectorXi | get_homing_signal () const |
| Get the last received homing signal vector. | |
| VectorXi | get_clear_positions_signal () |
| Get the last received clear positions signal vector. | |
| RobotDriver::Functionality | get_currently_active_functionality () const |
| Get the currently active functionality of the robot driver. | |
| bool | is_enabled (const RobotDriver::Functionality &supported_functionality=RobotDriver::Functionality::PositionControl) const |
| Check whether the server supports and is enabled for a functionality. | |
| void | send_joint_states (const VectorXd &joint_positions, const VectorXd &joint_velocities, const VectorXd &joint_forces) |
| Publish joint states (positions, velocities and forces) to clients. | |
| void | send_joint_limits (const std::tuple< VectorXd, VectorXd > &joint_limits) |
| Publish joint limits (min and max) to clients. | |
| void | send_home_state (const VectorXi &home_state) |
| Publish the home state vector to clients. | |
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > | get_watchdog_time_point_from_the_client () const |
| Get the time point received from the client for watchdog synchronization. | |
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > | get_watchdog_time_point_from_the_server () const |
| Get the time point captured on the server for watchdog synchronization. | |
| bool | get_watchdog_trigger_status () const |
| Get the current watchdog trigger status as last received from the client. | |
| bool | is_watchdog_enabled () const |
| Query whether the watchdog is enabled on the server. | |
| double | get_watchdog_period () const |
| Get the configured watchdog period in seconds. | |
| double | get_watchdog_maximum_acceptable_delay () const |
| Get the configured maximum acceptable delay for the watchdog in seconds. | |
| bool | get_shutdown_signal () const |
| Get the current shutdown signal state as last received from clients. | |
Server interface for robot driver ROS topics.
RobotDriverServer exposes publishers for joint states, joint limits and home state, and subscribes to control-related topics (target joint commands, homing/clear signals and watchdog triggers). It provides getters for the latest received commands, watchdog information and shutdown signal.
| sas::RobotDriverServer::RobotDriverServer | ( | const std::shared_ptr< Node > & | node, |
| const std::string & | node_prefix = "GET_FROM_NODE" |
||
| ) |
Construct a new RobotDriverServer.
| node | Shared pointer to the rclcpp::Node used for communication. |
| node_prefix | Prefix used to compose ROS topic names (defaults to "GET_FROM_NODE"). |
| VectorXi sas::RobotDriverServer::get_clear_positions_signal | ( | ) |
Get the last received clear positions signal vector.
RobotDriverProvider::get_clear_positions_signal. Getting the clear positions signal also clears it.
| RobotDriver::Functionality sas::RobotDriverServer::get_currently_active_functionality | ( | ) | const |
Get the currently active functionality of the robot driver.
| VectorXi sas::RobotDriverServer::get_homing_signal | ( | ) | const |
Get the last received homing signal vector.
get_homing_signal
| bool sas::RobotDriverServer::get_shutdown_signal | ( | ) | const |
Get the current shutdown signal state as last received from clients.
RobotDriverServer::get_shutdown_signal returns the shutdown signal sent by the client. If no client sent any signal, this method returns false.
| VectorXd sas::RobotDriverServer::get_target_joint_forces | ( | ) | const |
Get the most recent target joint forces received from clients.
| VectorXd sas::RobotDriverServer::get_target_joint_positions | ( | ) | const |
Get the most recent target joint positions received from clients.
| VectorXd sas::RobotDriverServer::get_target_joint_velocities | ( | ) | const |
Get the most recent target joint velocities received from clients.
| double sas::RobotDriverServer::get_watchdog_maximum_acceptable_delay | ( | ) | const |
Get the configured maximum acceptable delay for the watchdog in seconds.
RobotDriverServer::get_watchdog_maximum_acceptable_delay returns the maximum acceptable delay in seconds. This delay could be related to unsynchronised clocks between different computers or network delays.
| double sas::RobotDriverServer::get_watchdog_period | ( | ) | const |
Get the configured watchdog period in seconds.
RobotDriverServer::get_watchdog_period returns the watchdog period.
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > sas::RobotDriverServer::get_watchdog_time_point_from_the_client | ( | ) | const |
Get the time point received from the client for watchdog synchronization.
RobotDriverServer::get_watchdog_trigger_time_point returns the time point received by the Watchdog functionality. This time point corresponds to the moment the signal was sent, as recorded by the client computer's clock.
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > sas::RobotDriverServer::get_watchdog_time_point_from_the_server | ( | ) | const |
Get the time point captured on the server for watchdog synchronization.
RobotDriverServer::get_watchdog_trigger_time_point_when_received returns the time point when the watchdog signal is received. This time point uses the computer's clock on which the server (robot) is running.
| bool sas::RobotDriverServer::get_watchdog_trigger_status | ( | ) | const |
Get the current watchdog trigger status as last received from the client.
RobotDriverServer::get_watchdog_trigger_status returns the status received by the Watchdog functionality.
| bool sas::RobotDriverServer::is_enabled | ( | const RobotDriver::Functionality & | supported_functionality = RobotDriver::Functionality::PositionControl | ) | const |
Check whether the server supports and is enabled for a functionality.
| supported_functionality | The functionality to check (default: PositionControl). |
| bool sas::RobotDriverServer::is_watchdog_enabled | ( | ) | const |
Query whether the watchdog is enabled on the server.
RobotDriverServer::is_watchdog_enabled returns true if the Watchdog functionality is enabled.
| void sas::RobotDriverServer::send_home_state | ( | const VectorXi & | home_state | ) |
Publish the home state vector to clients.
| home_state | Vector representing home states per joint. |
| void sas::RobotDriverServer::send_joint_limits | ( | const std::tuple< VectorXd, VectorXd > & | joint_limits | ) |
Publish joint limits (min and max) to clients.
| joint_limits | Tuple containing (min_limits, max_limits). |
| void sas::RobotDriverServer::send_joint_states | ( | const VectorXd & | joint_positions, |
| const VectorXd & | joint_velocities, | ||
| const VectorXd & | joint_forces | ||
| ) |
Publish joint states (positions, velocities and forces) to clients.
Sends the current joint states through ROS.
| joint_positions | Vector of joint positions. |
| joint_velocities | Vector of joint velocities. |
| joint_forces | Vector of joint forces. |
| joint_positions | vector of . If not needed, use joint_positions=VectorXd(). |
| joint_velocities. | If not needed, use joint_velocities=VectorXd(). |
| joint_forces. | If not needed, use joint_forces=VectorXd(). |