ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

parameter_bridge with collection of topic in command line on ROS2 FOXY

asked 2022-03-09 14:21:16 -0600

kak13 gravatar image

Question,

I wanted to run ros2 run ros_ign_bridge parameter_bridge in the command line on ros2 foxy.

So, my topic list look like this:

'/model/freenove_smart_car/cmd_vel@geometry_msgs/msg/Twist@ignition.msgs.Twist',
                   '/model/freenove_smart_car/odometry@nav_msgs/msg/Odometry@ignition.msgs.Odometry',
                   '/ultrasonic0@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan',
                   '/IR1/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                   '/IR2/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                   '/IR0/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                   '/S0@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/S1@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/M0@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/M1@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/M2@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/M3@std_msgs/msg/Float64@ignition.msgs.Double',
                   '/model/freenove_smart_car/battery/linear_battery/state@sensor_msgs/msg/BatteryState@ignition.msgs.BatteryState'

Those topics are from ignition Fortress or real life freenove smart car.

So, when I ran it in the command line like this;

`ros2 run ros_ign_bridge parameter_bridge '/model/freenove_smart_car/cmd_vel@geometry_msgs/msg/Twist@ignition.msgs.Twist',
                       '/model/freenove_smart_car/odometry@nav_msgs/msg/Odometry@ignition.msgs.Odometry',
                       '/ultrasonic0@sensor_msgs/msg/LaserScan@ignition.msgs.LaserScan',
                       '/IR1/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                       '/IR2/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                       '/IR0/image@sensor_msgs/msg/Image@ignition.msgs.Image',
                       '/S0@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/S1@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/M0@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/M1@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/M2@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/M3@std_msgs/msg/Float64@ignition.msgs.Double',
                       '/model/freenove_smart_car/battery/linear_battery/state@sensor_msgs/msg/BatteryState@ignition.msgs.BatteryState'

Obviously, it didn't work. So when I run with one topic, it works well. When I run with two topics, the first topic failed and the last topic is working properly.

So, the question is how do you pass the collection of topic to the command line? Just more than one topic, actually.

Thank you so much for your time!

edit retag flag offensive close merge delete

Comments

did u solve the problem? im facing the same problem

iimata gravatar image iimata  ( 2022-08-17 05:10:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-08-17 05:26:32 -0600

iimata gravatar image

updated 2022-08-17 07:02:18 -0600

i solved it by creating a yaml file(galactic)..

topics:
  -
    topic: /tf
    type: tf2_msgs/msg/TFMessage
    queue_size: 1
  -
    topic: /depth_scan
    type: sensor_msgs/msg/LaserScan
    queue_size: 1

rosparam load bridge.yaml && source /opt/ros/galactic/setup.bash && ros2 run ros1_bridge parameter_bridge
edit flag offensive delete link more

Comments

Just a note for future readers - earlier in the question was ROS 2 Foxy, here you have ROS 2 Galactic

ljaniec gravatar image ljaniec  ( 2022-08-17 06:46:23 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2022-03-09 14:21:16 -0600

Seen: 351 times

Last updated: Aug 17 '22