gz bridge remap
Hi,
For my bridge i used a config file where topics are
gz_topic_name: '/model/cis_drone/pose'
ros_topic_name: "/cis_drone/pose"
and i used it in a launch file with
param:
-
name: "config_file"
value: "src/config/ros_gz_bridge.default.yml"
It works fine, now I want to add flexibility to this bridge so that the drone name could be changed. For this I use the remap key, but it does not work.
remap:
-
from: /model/cis_drone/pose
to: /model/$(var drone_name)/pose
then
$ ros2 launch src/gz/launch_drone.yml drone_name:=bart_1
I expect to change /model/cis_drone/pose (gazebo default topic from config file) to /model/bart_1/pose which is where data is published. I say it does not work because nothing is publish on ros node.
I also try to use command line only, and have the same pb. I can remap the ros topic, but not the gazebo topic.
[don't know if it is valuable information but the drone is spawn and thus not present in the sdf file.]
Asked by SĂ©bastienL on 2023-06-20 06:09:59 UTC
Answers
Remap will work on the ROS topic names. From your bridge config file what you want is probably to remap /cis_drone/pose
to /$(var drone_name)/pose
, without the /model
prefix that is for the Gazebo topic.
Asked by Olivier Kermorgant on 2023-06-21 02:42:47 UTC
Comments
remapping the ros node works, but as nothing is publish in /model/cis_drone/pose, nothing is publish in the ros node either. As a workaround, I used jinja to generate the config file.
Asked by SĂ©bastienL on 2023-06-21 02:59:27 UTC
Comments