|
sas
Modularised monitoring, logging, and control of robots.
|
Public Types | |
| enum class | Functionality { None =0 , PositionControl , VelocityControl , ForceControl , Homing , ClearPositions , Watchdog } |
| Enumeration of optional driver functionalities. | |
Public Member Functions | |
| ~RobotDriver () | |
| Virtual destructor for RobotDriver. | |
| virtual VectorXd | get_joint_positions ()=0 |
| Get current joint positions. | |
| virtual void | set_target_joint_positions (const VectorXd &set_target_joint_positions_rad)=0 |
| Set target joint positions. | |
| virtual VectorXd | get_joint_velocities () |
| Get current joint velocities. | |
| virtual void | set_target_joint_velocities (const VectorXd &set_target_joint_velocities) |
| Set target joint velocities. | |
| virtual VectorXd | get_joint_torques () |
| Get current joint torques. | |
| virtual void | set_target_joint_torques (const VectorXd &set_target_joint_torques) |
| Set target joint torques. | |
| virtual std::tuple< VectorXd, VectorXd > | get_joint_limits () |
| Get joint limits (min, max) | |
| virtual void | set_joint_limits (const std::tuple< VectorXd, VectorXd > &joint_limits) |
| Set joint limits (min, max) | |
| void | watchdog_start (const std::chrono::nanoseconds &period) |
| Start the watchdog thread with the given period. | |
| void | watchdog_trigger (const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > &time_point_from_the_client, const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > &time_point_from_the_server, const bool &status) |
| Trigger the watchdog with timestamps from client/server and the current status. | |
| void | watchdog_set_maximum_acceptable_delay (const double &max_acceptable_delay) |
| Set the maximum acceptable delay for the watchdog (seconds) | |
| void | check_for_watchdog_exceptions () |
| Check for exceptions thrown by the watchdog thread and rethrow if present. | |
| virtual void | connect ()=0 |
| Connect to the underlying robot/hardware. | |
| virtual void | disconnect ()=0 |
| Disconnect from the underlying robot/hardware. | |
| virtual void | initialize ()=0 |
| Initialize the driver resources. | |
| virtual void | deinitialize ()=0 |
| Deinitialize the driver resources. | |
Protected Member Functions | |
| void | _watchdog_thread_function () |
| RobotDriver::_watchdog_thread_function throws an exception if the elapsed time since the last trigger exceeds the specified period. | |
| RobotDriver (const std::shared_ptr< ShutdownSignaler > &shutdown_signaler_) | |
| RobotDriver (std::atomic_bool *break_loops) | |
| RobotDriver (const RobotDriver &)=delete | |
Protected Attributes | |
| std::atomic_bool * | break_loops_ |
| std::shared_ptr< ShutdownSignaler > | shutdown_signaler_ |
| std::tuple< VectorXd, VectorXd > | joint_limits_ |
| VectorXd | joint_velocities_ |
| VectorXd | joint_torques_ |
| std::unique_ptr< sas::Clock > | clock_ |
| std::unique_ptr< std::thread > | watchdog_thread_ |
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > | time_point_from_the_client_ |
| std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > | time_point_from_the_server_ |
| bool | watchdog_status_ |
| std::mutex | mutex_watchdog_ |
| double | max_acceptable_delay_ = 0.1 |
| double | watchdog_period_ |
| std::exception_ptr | watchdog_exception_ {nullptr} |
| std::mutex | watchdog_exception_mutex_ |
| void sas::RobotDriver::check_for_watchdog_exceptions | ( | ) |
Check for exceptions thrown by the watchdog thread and rethrow if present.
RobotDriver::check_for_watchdog_exceptions this method rethrows any exception thrown in the watchdog thread control loop.
|
pure virtual |
Connect to the underlying robot/hardware.
Implemented in sas::RobotDriverExample, sas::RobotDriverPy, sas::RobotDriverROSComposer, sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, and sas::RobotDriverUR.
|
pure virtual |
Deinitialize the driver resources.
Implemented in sas::RobotDriverExample, sas::RobotDriverPy, sas::RobotDriverROSComposer, sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, and sas::RobotDriverUR.
|
pure virtual |
Disconnect from the underlying robot/hardware.
Implemented in sas::RobotDriverExample, sas::RobotDriverPy, sas::RobotDriverROSComposer, sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, and sas::RobotDriverUR.
|
virtual |
Get joint limits (min, max)
Reimplemented in sas::RobotDriverROSComposer, and sas::RobotDriverCoppeliaSim.
|
pure virtual |
Get current joint positions.
Implemented in sas::RobotDriverExample, sas::RobotDriverPy, sas::RobotDriverROSComposer, sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, and sas::RobotDriverUR.
|
virtual |
Get current joint torques.
Reimplemented in sas::RobotDriverPy, and sas::RobotDriverKuka.
|
virtual |
Get current joint velocities.
Reimplemented in sas::RobotDriverPy, and sas::RobotDriverUR.
|
pure virtual |
Initialize the driver resources.
Implemented in sas::RobotDriverExample, sas::RobotDriverPy, sas::RobotDriverROSComposer, sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, and sas::RobotDriverUR.
|
virtual |
Set joint limits (min, max)
| joint_limits | Tuple of (min_limits, max_limits) |
Reimplemented in sas::RobotDriverROSComposer, and sas::RobotDriverPy.
|
pure virtual |
Set target joint positions.
| set_target_joint_positions_rad | Target joint positions (radians) |
Implemented in sas::RobotDriverCoppeliaSim, sas::RobotDriverKuka, sas::RobotDriverUR, sas::RobotDriverExample, sas::RobotDriverPy, and sas::RobotDriverROSComposer.
|
virtual |
Set target joint torques.
| set_target_joint_torques | Target joint torques |
Reimplemented in sas::RobotDriverPy.
|
virtual |
Set target joint velocities.
| set_target_joint_velocities | Target joint velocities |
Reimplemented in sas::RobotDriverPy.
| void sas::RobotDriver::watchdog_set_maximum_acceptable_delay | ( | const double & | max_acceptable_delay | ) |
Set the maximum acceptable delay for the watchdog (seconds)
RobotDriver::watchdog_set_maximum_acceptable_delay sets the maximum acceptable clock skew to check the synchronization or potential delays between the time point of watchdog signal sent by the client and the time point when the watchdog signal was received.
| max_acceptable_delay | Maximum delay in seconds |
| max_acceptable_delay |
| void sas::RobotDriver::watchdog_start | ( | const std::chrono::nanoseconds & | period | ) |
Start the watchdog thread with the given period.
RobotDriver::watchdog_start starts the watchdog thread.
| period | Watchdog period as nanoseconds |
| period | The period of time. |
| void sas::RobotDriver::watchdog_trigger | ( | const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > & | time_point_from_the_client, |
| const std::chrono::time_point< std::chrono::system_clock, std::chrono::nanoseconds > & | time_point_from_the_server, | ||
| const bool & | status | ||
| ) |
Trigger the watchdog with timestamps from client/server and the current status.
RobotDriver::watchdog_trigger updates the trigger signal.
| time_point_from_the_client | Time point provided by the client |
| time_point_from_the_server | Time point provided by the server |
| status | Current watchdog status flag |
| time_point_from_the_client | This time point corresponds to the moment the signal was sent, as recorded by the client computer's clock. |
| time_point_from_the_server | The time point when the watchdog signal was received. This time point uses the computer's clock on which the server (robot) is running. |
| status | The desired status. If false, the driver is going to stop. |