File tree Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Expand file tree Collapse file tree 4 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -282,13 +282,15 @@ Parameters
282282+----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
283283| ``tf_prefix `` | string | <empty> | Urdf prefix of the corresponding arm |
284284+----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
285+ | ``inactive_timeout `` | int | 10 | Time interval (in seconds) of message inactivity after which freedrive is deactivated |
286+ +----------------------------------+--------------+----------------------------------------+------------------------------------------------------------------------------------------------------------------+
285287
286288Usage
287289"""""
288290
289- The controller provides the ``enable_freedrive_mode `` topic of type ``[std_msgs/msg/Bool] `` for handling activation and deactivation:
291+ The controller provides the ``/ enable_freedrive_mode `` topic of type ``[std_msgs/msg/Bool] `` for handling activation and deactivation:
290292
291293* to start and keep the freedrive active, it is necessary to continously publish a ``True `` msg on the indicated topic.
292294 To deal with malfunctioning on the client side, the controller deactivates the freedrive mode if messages
293- are not received anymore within the ``timeout `` parameter.
295+ are not received anymore within the ``inactive_timeout `` parameter.
294296+ to deactivate the freedrive mode is enough to publish a ``False `` msg on the indicated topic or to deactivate the controller.
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ class FreedriveModeController : public controller_interface::ControllerInterface
9494 std::shared_ptr<rclcpp::Subscription<std_msgs::msg::Bool>> enable_freedrive_mode_sub_;
9595
9696 rclcpp::TimerBase::SharedPtr freedrive_sub_timer_; // /< Timer to check on the topic
97- std::chrono::seconds timeout_interval_ = std::chrono::seconds( 2 ) ;
97+ mutable std::chrono::seconds timeout_interval_;
9898 void readFreedriveModeCmd (const std_msgs::msg::Bool::SharedPtr msg);
9999
100100 std::shared_ptr<freedrive_mode_controller::ParamListener> freedrive_param_listener_;
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ controller_interface::InterfaceConfiguration FreedriveModeController::command_in
6262 config.type = controller_interface::interface_configuration_type::INDIVIDUAL;
6363
6464 const std::string tf_prefix = freedrive_params_.tf_prefix ;
65+ timeout_interval_ = std::chrono::seconds (freedrive_params_.inactive_timeout );
6566
6667 // Get the command interfaces needed for freedrive mode from the hardware interface
6768 config.names .emplace_back (tf_prefix + " freedrive_mode/async_success" );
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ freedrive_mode_controller:
55 default_value : " " ,
66 description : " Urdf prefix of the corresponding arm"
77 }
8+ inactive_timeout : {
9+ type : int,
10+ default_value : 10,
11+ description : " Time interval (in seconds) of message inactivity after which freedrive is deactivated"
12+ }
813 check_io_successful_retries : {
914 type : int,
1015 default_value : 10,
You can’t perform that action at this time.
0 commit comments