Add a way to pass extra parameters to ros_gz_bridge (backport #628) #648
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🎉 New feature
Closes #624
Summary
Added a new argument
bridge_params
to allow users to pass extra parameters toros_gz_bridge
when using the launch file. An example of these parameters would beqos_overrides
I have changed the node declarations to an opaque function so that I can get the value of
bridge_params
.bridge_params
is converted from string to dictionary and then passed to the parameters of theros_gz_bridge
node.The way I have done all of this is complicated and so please do tell me if there is an easier way to do this.
Test it
To test this something like the following command can be used:
ros2 launch ros_gz_bridge ros_gz_bridge.launch.py bridge_name:=ros_gz_bridge config_file:=<path_to_your_YAML_file> bridge_params:="'qos_overrides./topic_name.publisher.durability': 'transient_local', 'qos_overrides./another_topic_name.publisher.durability': 'transient_local'"
Then to check if the qos overrides have applied:
ros2 topic info /topic_name --verbose
ros2 topic info /another_topic_name --verbose
Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.This is an automatic backport of pull request #628 done by Mergify.