From 8440454f8fcb2d465b787a894140feb1bb3596e1 Mon Sep 17 00:00:00 2001 From: Yong Tang Date: Mon, 6 May 2024 13:39:18 -0700 Subject: [PATCH] Allow publisher to always publish by setting the threshold to zero. (#22) * Allow publisher to always publish by setting the threshold to zero. On documentation (https://github.com/PickNikRobotics/topic_based_ros2_control/blob/main/doc/user.md) trigger_joint_command_threshold can be configuration with zero so that the allow publisher to always send the joint command. However, in the code the condition was set with: ``` if (diff <= trigger_joint_command_threshold_) { return hardware_interface::return_type::OK; } ``` In case trigger_joint_command_threshold_ is set to zero, diff can still be zero so it will not trigger the send. This PR tries to address the above mentioned case. * Revert "Allow publisher to always publish by setting the threshold to zero." This reverts commit a799b539d877d1a2ca7203f5d57bc4c805df7202. * Update the documentation instead (-1). --- doc/user.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user.md b/doc/user.md index 4af5baa..e9a342d 100644 --- a/doc/user.md +++ b/doc/user.md @@ -16,7 +16,7 @@ The topic_based system interface has a few `ros2_control` urdf tags to customize * joint_commands_topic: (default: "/robot_joint_command"). Example: `/my_topic_joint_commands`. * joint_states_topic: (default: "/robot_joint_states"). Example: `/my_topic_joint_states`. -* trigger_joint_command_threshold: (default: 1e-5). Used to avoid spamming the joint command topic when the difference between the current joint state and the joint command is smaller than this value, set to zero to always send the joint command. Example: `0.001`. +* trigger_joint_command_threshold: (default: 1e-5). Used to avoid spamming the joint command topic when the difference between the current joint state and the joint command is smaller than this value, set to -1 to always send the joint command. Example: `0.001`. * sum_wrapped_joint_states: (default: "false"). Used to track the total rotation for joint states the values reported on the `joint_commands_topic` wrap from 2*pi to -2*pi when rotating in the positive direction. (Isaac Sim only reports joint states from 2*pi to -2*pi) Example: `true`. #### Per-joint Parameters