Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'relay_sources' option #108

Open
wants to merge 3 commits into
base: ros2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions joint_state_publisher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Parameters
* `use_mimic_tags` (bool) - Whether to honor `<mimic>` tags in the URDF. Defaults to True.
* `use_smallest_joint_limits` (bool) - Whether to honor `<safety_controller>` tags in the URDF. Defaults to True.
* `source_list` (array of strings) - Each string in this array represents a topic name. For each string, create a subscription to the named topic of type `sensor_msgs/msg/JointStates`. Publication to that topic will update the joints named in the message. Defaults to an empty array.
* `relay_sources` (bool) - Whether to immediately republish messages coming in on topics from `source_list`. Makes for smoother joints sometimes. Defaults to False.
* `delta` (double) - How much to automatically move joints during each iteration. Defaults to 0.0.

#### Mapped Parameters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def __init__(self, description_file):
ParameterDescriptor(type=ParameterType.PARAMETER_INTEGER))
self.declare_ros_parameter('source_list', [],
ParameterDescriptor(type=ParameterType.PARAMETER_STRING_ARRAY))
self.declare_ros_parameter('relay_sources', False,
ParameterDescriptor(type=ParameterType.PARAMETER_BOOL))
self.declare_ros_parameter('use_mimic_tags', True,
ParameterDescriptor(type=ParameterType.PARAMETER_BOOL))
self.declare_ros_parameter('use_smallest_joint_limits', True,
Expand Down Expand Up @@ -459,6 +461,9 @@ def source_cb(self, msg):
if self.source_update_cb is not None:
self.source_update_cb()

if self.get_param('relay_sources'):
self.pub.publish(msg)

def set_source_update_cb(self, user_cb):
self.source_update_cb = user_cb

Expand Down