Client interface for robot driver ROS topics.
More...
#include <sas_robot_driver_client.hpp>
|
| enum class | MODE_BLACKLIST_FLAG { JOINT_CONTROL =0
, JOINT_MONITORING
, WATCHDOG_CONTROL
} |
| | Flags used to blacklist client modes when constructing the client.
|
| |
Client interface for robot driver ROS topics.
RobotDriverClient provides helpers to publish target joint commands and control signals, and to subscribe to feedback topics such as joint states, joint limits and home state. It supports optional mode blacklisting to disable certain functionalities from the client side.
◆ RobotDriverClient()
| sas::RobotDriverClient::RobotDriverClient |
( |
const std::shared_ptr< Node > & |
node, |
|
|
const std::string |
topic_prefix = "GET_FROM_NODE", |
|
|
const std::vector< MODE_BLACKLIST_FLAG > & |
blacklisted_modes = std::vector<MODE_BLACKLIST_FLAG>{} |
|
) |
| |
Construct a new RobotDriverClient.
- Parameters
-
| node | Shared pointer to the rclcpp::Node used for communication. |
| topic_prefix | Topic prefix used to compose topic/service names. Defaults to "GET_FROM_NODE". |
| blacklisted_modes | Optional list of modes to blacklist/disable on the client side. |
◆ get_home_states()
| VectorXi sas::RobotDriverClient::get_home_states |
( |
| ) |
const |
Get the last received home states vector.
- Returns
- VectorXi Home states per joint.
◆ get_joint_forces()
| VectorXd sas::RobotDriverClient::get_joint_forces |
( |
| ) |
const |
Get the last received joint forces.
- Returns
- VectorXd Joint forces vector.
◆ get_joint_limits()
| std::tuple< VectorXd, VectorXd > sas::RobotDriverClient::get_joint_limits |
( |
| ) |
const |
Retrieve the joint limits as a tuple (min, max).
- Returns
- std::tuple<VectorXd, VectorXd> Pair of vectors (min_limits, max_limits).
◆ get_joint_positions()
| VectorXd sas::RobotDriverClient::get_joint_positions |
( |
| ) |
const |
Get the last received joint positions.
- Returns
- VectorXd Joint positions vector.
◆ get_joint_velocities()
| VectorXd sas::RobotDriverClient::get_joint_velocities |
( |
| ) |
const |
Get the last received joint velocities.
- Returns
- VectorXd Joint velocities vector.
◆ get_topic_prefix()
| std::string sas::RobotDriverClient::get_topic_prefix |
( |
| ) |
const |
Get the configured topic prefix.
- Returns
- std::string Topic prefix used by this client.
◆ is_enabled()
| bool sas::RobotDriverClient::is_enabled |
( |
const RobotDriver::Functionality & |
supported_functionality = RobotDriver::Functionality::PositionControl | ) |
const |
Check whether the client is enabled for a given functionality.
- Parameters
-
| supported_functionality | The functionality to check (default: PositionControl). |
- Returns
- true if enabled, false otherwise.
◆ send_clear_positions_signal()
| void sas::RobotDriverClient::send_clear_positions_signal |
( |
const VectorXi & |
clear_positions_signal | ) |
|
Send a signal to clear positions on the controller side.
- Parameters
-
| clear_positions_signal | Vector of integers representing clear position commands per joint. |
◆ send_homing_signal()
| void sas::RobotDriverClient::send_homing_signal |
( |
const VectorXi & |
homing_signal | ) |
|
Send a homing signal to the robot.
- Parameters
-
| homing_signal | Vector of integers representing homing signals per joint. |
◆ send_shutdown_signal()
| void sas::RobotDriverClient::send_shutdown_signal |
( |
| ) |
|
◆ send_target_joint_forces()
| void sas::RobotDriverClient::send_target_joint_forces |
( |
const VectorXd & |
target_joint_forces | ) |
|
Publish target joint forces/torques.
- Parameters
-
| target_joint_forces | Vector containing desired joint forces/torques. |
◆ send_target_joint_positions()
| void sas::RobotDriverClient::send_target_joint_positions |
( |
const VectorXd & |
target_joint_positions | ) |
|
Publish target joint positions.
- Parameters
-
| target_joint_positions | Vector containing desired joint positions. |
◆ send_target_joint_velocities()
| void sas::RobotDriverClient::send_target_joint_velocities |
( |
const VectorXd & |
target_joint_velocities | ) |
|
Publish target joint velocities.
- Parameters
-
| target_joint_velocities | Vector containing desired joint velocities. |
◆ send_watchdog_trigger()
| void sas::RobotDriverClient::send_watchdog_trigger |
( |
const bool & |
watchdog_trigger_status, |
|
|
const double & |
period_in_seconds = 1.0, |
|
|
const double & |
maximum_acceptable_delay = 0.5 |
|
) |
| |
Trigger the watchdog from the client.
RobotDriverClient::send_watchdog_trigger sends the Watchdog trigger.
- Parameters
-
| watchdog_trigger_status | true keep watchdog alive, false to kill. |
| period_in_seconds | Watchdog period in seconds (default: 1.0). |
| maximum_acceptable_delay | Maximum acceptable delay in seconds for the watchdog (default: 0.5). |
| watchdog_trigger_status | The desired status for the Watchdog |
| period_in_seconds | The desired period in seconds. |
| maximum_acceptable_delay. | The maximum allowed difference between the timepoint sent by the client and the timepoint registered by the server. This delay could be related to unsynchronised clocks between different computers or network delays. |
The documentation for this class was generated from the following files: