Closed Amronos closed 2 days ago
I haven't had time to dig into this, but it feels like a big code change for a fairly small feature. Is it the conversion from string to dictionary that requires the use of the opaque function? Another approach I would consider is moving more of the logic into the gz_server Action or even reverting the current architecture where the Action includes a launch file https://github.com/gazebosim/ros_gz/blob/2658f27fbea5dd14af2c47ac787071b4772c2757/ros_gz_bridge/ros_gz_bridge/actions/ros_gz_bridge.py#L146-L150
and instead have the ros_gz_bridge.launch.py
file use the Action. It seems like we have more flexibility there.
Is it the conversion from string to dictionary that requires the use of the opaque function?
Yes.
or even reverting the current architecture where the Action includes a launch file and instead have the
ros_gz_bridge.launch.py
file use the Action. It seems like we have more flexibility there.
That does sound like a good idea.
Any updates on this PR?
Does this test work for you? (remember to update the path to the bridge config file).
ros2 launch ros_gz_sim ros_gz_sim.launch bridge_name:=ros_gz_bridge config_file:=/home/caguero/ros_gz_ws/src/ros_gz/ros_gz_bridge/test/config/full.yaml world_sdf_file:=empty.sdf use_composition:=True create_own_container:=True
I haven't specifically run this command, but I have used the ros_gz_sim.launch.py
launch file inside another python launch file with composition enabled.
Does this test work for you? (remember to update the path to the bridge config file).
ros2 launch ros_gz_sim ros_gz_sim.launch bridge_name:=ros_gz_bridge config_file:=/home/caguero/ros_gz_ws/src/ros_gz/ros_gz_bridge/test/config/full.yaml world_sdf_file:=empty.sdf use_composition:=True create_own_container:=True
I haven't specifically run this command, but I have used the
ros_gz_sim.launch.py
launch file inside another python launch file with composition enabled.
I'm getting an error that I don't get with the ros2
branch:
[INFO] [launch]: All log files can be found below /home/caguero/.ros/log/2024-11-14-17-40-26-288785-cold-1915140
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'str' object has no attribute 'perform'
The XML launch file should work now.
Should I add the bridge_params
argument to the other launch files?
The XML launch file should work now. Should I add the
bridge_params
argument to the other launch files?
That'd be great!
Should be ready to merge now!
@Amronos , out of curiosity, were you able to solve the latest issue (duplicated nodes)?
@Amronos , out of curiosity, were you able to solve the latest issue (duplicated nodes)?
Yes, it was fixed in commit f2d6cda. The PR should be ready to merge.
@caguero Can this also be backported to Jazzy? If yes, #629 should be backported first.
https://github.com/Mergifyio backport jazzy
backport jazzy
🎉 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 ofbridge_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.