Skip to content

Commit

Permalink
Allow publisher to always publish by setting the threshold to zero. (#22
Browse files Browse the repository at this point in the history
)

* 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 a799b53.

* Update the documentation instead (-1).
  • Loading branch information
yongtang authored May 6, 2024
1 parent 37a98e6 commit 8440454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<param name="joint_commands_topic">/my_topic_joint_commands</param>`.
* joint_states_topic: (default: "/robot_joint_states"). Example: `<param name="joint_states_topic">/my_topic_joint_states</param>`.
* 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: `<param name="trigger_joint_command_threshold">0.001</param>`.
* 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: `<param name="trigger_joint_command_threshold">0.001</param>`.
* 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: `<param name="sum_wrapped_joint_states">true</param>`.

#### Per-joint Parameters
Expand Down

0 comments on commit 8440454

Please sign in to comment.