Gazebo | Ignition | Community
Ask Your Question
1

How to use ros_gz_bridge in roslaunch with conf yaml and readme issue ?

asked 2022-12-23 10:05:15 -0500

Luczia gravatar image

Hi !

I believe, in the equivalence array, all sensor_msgs messages

sensor_msgs/BatteryState,sensor_msgs/CameraInfo ,sensor_msgs/FluidPressure ,sensor_msgs/Image ,sensor_msgs/Imu ,sensor_msgs/JointState, sensor_msgs/LaserScan ,sensor_msgs/MagneticField ,sensor_msgs/NavSatFix ,sensor_msgs/PointCloud2

should have an extra /msgs/ in the path to work. Example : sensor_msgs /msgs/ Imu

At least, it works only this way for me and took me a few hours to figure it out.

  • Also, I am trying to launch the bridge using a YAML file, like explained in the readme.

My config works well from command line :

ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=/colcon_ws/install/trr_bringup/share/trr_bringup/config/gz_bridge.yaml

But I can't get it work from a roslaunch. It's a simple question of YAML arguments declaration but can't figure it out

I tried :

 # Gz Sim-ROS2 Bridge
    bridge = Node(
        package='ros_gz_bridge',
        executable='parameter_bridge',
        arguments=[
                 '--ros-args -p config_file:='+os.path.join(pkg_trr_bringup, 'config', 'gz_bridge.yaml')
                ],
        output='screen'
    )

Any idea

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-05 08:39:42 -0500

mls gravatar image

Hey ! A little late but if someone has the same issue :

# Bridge gazebo 
ExecuteProcess(
    cmd=[FindExecutable(name='ros2'),
        'run ros_gz_bridge parameter_bridge  --ros-args -p config_file:=YOURPATH/your_file.yaml'
         ],
    output='screen',
    shell=True
),

I suppose that's a little messy but there is no documentation for that case and it works so...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-12-23 10:05:15 -0500

Seen: 488 times

Last updated: May 05 '23