7.9 Spawning Multiple XACRO Robot Models into Gazebo error

In the course notes for the above section it shows the below for the gazebo bridge node code

   # ROS-Gazebo Bridge
    gz_bridge = Node(
        package="ros_gz_bridge",
        executable="parameter_bridge",
        name="gz_bridge",
        arguments=[
            "/clock" + "@rosgraph_msgs/msg/Clock" + "[gz.msgs.Clock",
            "/cmd_vel" + "@geometry_msgs/msg/Twist" + "@gz.msgs.Twist",
            "/tf" + "@tf2_msgs/msg/TFMessage" + "[gz.msgs.Pose_V",
            "/odom" + "@nav_msgs/msg/Odometry" + "[gz.msgs.Odometry",
            "/joint_states" + "@sensor_msgs/msg/JointState" + "[gz.msgs.Model",
        ],
        remappings=[
            # there are no remappings for this robot description
        ],
        output="screen",
    )

This did not work for me and I had to add the namespace of each robot to the topics I needed. The below worked for me. Was there a typo in the course notes or did I do something wrong?

  "/clock" + "@rosgraph_msgs/msg/Clock" + "[gz.msgs.Clock",
            "/robot1/cmd_vel" + "@geometry_msgs/msg/Twist" + "@gz.msgs.Twist",
            "/robot2/cmd_vel" + "@geometry_msgs/msg/Twist" + "@gz.msgs.Twist",
            "/tf" + "@tf2_msgs/msg/TFMessage" + "[gz.msgs.Pose_V",
            "/robot1/odom" + "@nav_msgs/msg/Odometry" + "[gz.msgs.Odometry",
            "/robot2/odom" + "@nav_msgs/msg/Odometry" + "[gz.msgs.Odometry",
            "/robot1/joint_states" + "@sensor_msgs/msg/JointState" + "[gz.msgs.Model",
            "/robot2/joint_states" + "@sensor_msgs/msg/JointState" + "[gz.msgs.Model",

Hello @phillip.jr.hogan ,

You’re totally right. This is a mistake in the course notebook. We will update it right now to add the proper namespaces. Many thanks for your feedback and keep pushing your robotics learning!

Best,

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.