I am new to ROS2 and I encounter some strange parsing error when I try to launch my gazebo simulation.
I am using ROS2 Iron on a Ubuntu 22.04 VM
Here is my project repository
That repo works fine since I am following this tutorial series and I have the same robot model as the tutorial. The issue is that as soon as I change the robot_base.xacro errors pop up
new robot_base.xacro:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" >
<xacro:include filename="inertial_macros.xacro" />
<material name="white">
<color rgba="1 1 1 1" />
</material>
<material name="orange">
<color rgba= "1 0.3 0.1 1"/>
</material>
<material name="blue">
<color rgba="0.2 0.2 1 1"/>
</material>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
<material name="red">
<color rgba="1 0 0 1"/>
</material>
<!-- BASE LINK -->
<link name="base_link">
</link>
<!-- CHASSIS LINK -->
<!-- dimensiuni sasiu: 780x600mm
dimensiune profil: 40x40mm
L profil: 700mm
l profil: 600mm
Distanta mijloc sasiu - centru roti: 43.5mm
-->
<joint name="chassis_joint" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin xyz="-0.39 0 0.0435"/>
</joint>
<link name="chassis">
<visual> <!-- Back Profile -->
<origin xyz="0.02 0 0"/>
<geometry>
<box size="0.04 0.6 0.04"/>
</geometry>
<material name="white"/>
</visual>
<visual> <!-- Front Profile -->
<origin xyz="0.76 0 0"/>
<geometry>
<box size="0.04 0.6 0.04"/>
</geometry>
<material name="white"/>
</visual>
<visual> <!-- Right Profile -->
<origin xyz="0.39 0.28 0"/>
<geometry>
<box size="0.7 0.04 0.04"/>
</geometry>
<material name="black"/>
</visual>
<visual> <!-- Left Profile -->
<origin xyz="0.39 -0.28 0"/>
<geometry>
<box size="0.7 0.04 0.04"/>
</geometry>
<material name="black"/>
</visual>
<collision> <!-- Colision -->
<origin xyz="0.39 0 0"/>
<geometry>
<box size="0.78 0.6 0.04"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_hollow_frame mass="3.224" x="0.78" y="0.6" z="0.04">
<origin xyz="0.39 0 0" rpy="0 0 0" />
</xacro:inertial_hollow_frame>
</link>
<gazebo reference="chassis">
<material>Gazebo/White</material>
</gazebo>
<!-- RIGHT WHEEL LINK -->
<joint name="right_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="right_wheel"/>
<origin xyz="0 -0.2125 0" rpy="${pi/2} 0 0"/>
<axis xyz="0 0 -1"/>
</joint>
<link name="right_wheel">
<visual>
<geometry>
<cylinder radius="0.05" length="0.04"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<geometry>
<sphere radius="0.05"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.05">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_cylinder>
</link>
<gazebo reference="right_wheel">
<material>Gazebo/Orange</material>
</gazebo>
<!-- LEFT WHEEL LINK -->
<joint name="left_wheel_joint" type="continuous">
<parent link="base_link"/>
<child link="left_wheel"/>
<origin xyz="0 0.2125 0" rpy="-${pi/2} 0 0"/>
<axis xyz="0 0 1"/>
</joint>
<link name="left_wheel">
<visual>
<geometry>
<cylinder radius="0.05" length="0.04"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<geometry>
<sphere radius="0.05"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_cylinder mass="0.1" length="0.04" radius="0.05">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_cylinder>
</link>
<gazebo reference="left_wheel">
<material>Gazebo/Orange</material>
</gazebo>
<!-- CASTER WHEEL LINKS -->
<!--
distanta centru roata - profil superior: 77.75mm
distanta X si Y centru roata - margine profil: 94.75mm
distanta roti L: 590.50mm
distanta roti l: 410.50mm
-->
<!-- Caster wheel 1 -->
<joint name="caster_wheel_1_joint" type="fixed">
<parent link="chassis"/>
<child link="caster_wheel_1"/>
<origin xyz="0.09475 0.20525 -0.05"/>
</joint>
<link name="caster_wheel_1">
<visual>
<geometry>
<sphere radius="0.03775"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<sphere radius="0.03775"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_sphere mass="0.1" radius="0.03775">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
</link>
<gazebo reference="caster_wheel_1">
<material>Gazebo/Blue</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo>
<!-- Caster wheel 2 -->
<joint name="caster_wheel_2_joint" type="fixed">
<parent link="chassis"/>
<child link="caster_wheel_2"/>
<origin xyz="0.09475 -0.20525 -0.05"/>
</joint>
<link name="caster_wheel_2">
<visual>
<geometry>
<sphere radius="0.03775"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<sphere radius="0.03775"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_sphere mass="0.1" radius="0.03775">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
</link>
<gazebo reference="caster_wheel_2">
<material>Gazebo/Blue</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo>
<!-- Caster wheel 3 -->
<joint name="caster_wheel_3_joint" type="fixed">
<parent link="chassis"/>
<child link="caster_wheel_3"/>
<origin xyz="0.68525 0.20525 -0.05"/>
</joint>
<link name="caster_wheel_3">
<visual>
<geometry>
<sphere radius="0.03775"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<sphere radius="0.03775"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_sphere mass="0.1" radius="0.03775">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
</link>
<gazebo reference="caster_wheel_3">
<material>Gazebo/Blue</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo>
<!-- Caster wheel 4 -->
<joint name="caster_wheel_4_joint" type="fixed">
<parent link="chassis"/>
<child link="caster_wheel_4"/>
<origin xyz="0.68525 -0.20525 -0.05"/>
</joint>
<link name="caster_wheel_4">
<visual>
<geometry>
<sphere radius="0.03775"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<sphere radius="0.03775"/>
</geometry>
</collision>
<!-- Inertia -->
<xacro:inertial_sphere mass="0.1" radius="0.03775">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
</link>
<gazebo reference="caster_wheel_4">
<material>Gazebo/Blue</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo>
After I launch launch_sim.launch.py with verbose set to true I get the following:
[INFO] [launch]: All log files can be found below /home/cosmin2/.ros/log/2024-05-03-22-59-12-824954-cosmin2-virtual-machine-13244
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [robot_state_publisher-1]: process started with pid [13247]
[INFO] [gzserver-2]: process started with pid [13249]
[INFO] [gzclient-3]: process started with pid [13253]
[INFO] [spawn_entity.py-4]: process started with pid [13257]
[INFO] [spawner-5]: process started with pid [13266]
[INFO] [spawner-6]: process started with pid [13269]
[robot_state_publisher-1] [INFO] [1714766353.685402402] [robot_state_publisher]: got segment base_link
[robot_state_publisher-1] [INFO] [1714766353.685606128] [robot_state_publisher]: got segment caster_wheel_1
[robot_state_publisher-1] [INFO] [1714766353.685624282] [robot_state_publisher]: got segment caster_wheel_2
[robot_state_publisher-1] [INFO] [1714766353.685629840] [robot_state_publisher]: got segment caster_wheel_3
[robot_state_publisher-1] [INFO] [1714766353.685634300] [robot_state_publisher]: got segment caster_wheel_4
[robot_state_publisher-1] [INFO] [1714766353.685638681] [robot_state_publisher]: got segment chassis
[robot_state_publisher-1] [INFO] [1714766353.685642963] [robot_state_publisher]: got segment laser_frame
[robot_state_publisher-1] [INFO] [1714766353.685647412] [robot_state_publisher]: got segment left_wheel
[robot_state_publisher-1] [INFO] [1714766353.685651823] [robot_state_publisher]: got segment right_wheel
[gzclient-3] Gazebo multi-robot simulator, version 11.10.2
[gzclient-3] Copyright (C) 2012 Open Source Robotics Foundation.
[gzclient-3] Released under the Apache 2 License.
[gzclient-3] http://gazebosim.org
[gzclient-3]
[gzserver-2] Gazebo multi-robot simulator, version 11.10.2
[gzserver-2] Copyright (C) 2012 Open Source Robotics Foundation.
[gzserver-2] Released under the Apache 2 License.
[gzserver-2] http://gazebosim.org
[gzserver-2]
[spawn_entity.py-4] [INFO] [1714766354.846650665] [spawn_entity]: Spawn Entity started
[spawn_entity.py-4] [INFO] [1714766354.847499410] [spawn_entity]: Loading entity published on topic robot_description
[spawn_entity.py-4] /opt/ros/iron/lib/python3.10/site-packages/rclpy/qos.py:313: UserWarning: DurabilityPolicy.RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL is deprecated. Use DurabilityPolicy.TRANSIENT_LOCAL instead.
[spawn_entity.py-4] warnings.warn(
[spawn_entity.py-4] [INFO] [1714766354.851522390] [spawn_entity]: Waiting for entity xml on robot_description
[spawn_entity.py-4] [INFO] [1714766354.864362381] [spawn_entity]: Waiting for service /spawn_entity, timeout = 30
[spawn_entity.py-4] [INFO] [1714766354.865216983] [spawn_entity]: Waiting for service /spawn_entity
[gzserver-2] [Msg] Waiting for master.
[gzserver-2] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gzserver-2] [Msg] Publicized address: 192.168.137.133
[gzserver-2] [Err] [Server.cc:472] Could not open file[]
[gzserver-2] [Wrn] [Server.cc:381] Falling back on worlds/empty.world
[spawn_entity.py-4] [INFO] [1714766355.625444755] [spawn_entity]: Calling service /spawn_entity
[gzclient-3] [Msg] Waiting for master.
[gzclient-3] [Msg] Connected to gazebo master @ http://127.0.0.1:11345
[gzclient-3] [Msg] Publicized address: 192.168.137.133
[gzclient-3] [Msg] Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[gzclient-3] [Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
[spawn_entity.py-4] [INFO] [1714766355.998466139] [spawn_entity]: Spawn status: SpawnEntity: Successfully spawned entity [my_bot]
[gzserver-2] [WARN] [1714766356.002695081] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead.
[gzserver-2] [WARN] [1714766356.022324627] [rcl]: Found remap rule '~/out:=scan'. This syntax is deprecated. Use '--ros-args --remap ~/out:=scan' instead.
[gzserver-2] [INFO] [1714766356.140084871] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-2] [INFO] [1714766356.156231225] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-2] [INFO] [1714766356.156629779] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-2] [INFO] [1714766356.166773711] [gazebo_ros2_control]: connected to service!! robot_state_publisher
[gzserver-2] [INFO] [1714766356.176026834] [gazebo_ros2_control]: Received urdf from param server, parsing...
[INFO] [spawn_entity.py-4]: process has finished cleanly [pid 13257]
[gzserver-2] [INFO] [1714766356.177329179] [gazebo_ros2_control]: Loading parameter files /home/cosmin2/test/install/amr_platform/share/amr_platform/config/my_controllers.yaml
[gzserver-2] [rcutils|error_handling.c:65] an error string (message, file name, or formatted message) will be truncated
[gzserver-2] [ERROR] [1714766356.177995399] [gazebo_ros2_control]: parser error Couldn't parse parameter override rule: '--param robot_description:=<?xml version="1.0" ?><!-- =================================================================================== --><!-- | This document was autogenerated by xacro from /home/cosmin2/test/install/amr_platform/share/amr_platform/description/robot.urdf.xacro | --><!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | --><!-- =================================================================================== --><robot name="robot"><!-- Specify some standard inertial calculations https://en.wikipedia.org/wiki/List_of_moments_of_inertia --><!-- These make use of xacro's mathematical functionality --><material name="white"><color rgba="1 1 1 1"/></material><mate, at ./src/rcl/arguments.c:343
[gzserver-2]
[gzclient-3] context mismatch in svga_surface_destroy
[gzclient-3] context mismatch in svga_surface_destroy
[spawner-6] [INFO] [1714766356.832308955] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1714766356.840711631] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-6] [INFO] [1714766358.844338192] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1714766358.850024120] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[gzserver-2] [Msg] Loading world file [/usr/share/gazebo-11/worlds/empty.world]
[spawner-6] [INFO] [1714766360.856146653] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1714766360.861986117] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-6] [INFO] [1714766362.866226563] [spawner_joint_broad]: Waiting for '/controller_manager' node to exist
[spawner-5] [INFO] [1714766362.875041967] [spawner_diff_cont]: Waiting for '/controller_manager' node to exist
[spawner-5] [ERROR] [1714766364.887472807] [spawner_diff_cont]: Controller manager not available
[spawner-6] [ERROR] [1714766364.887747489] [spawner_joint_broad]: Controller manager not available
[ERROR] [spawner-6]: process has died [pid 13269, exit code 1, cmd '/opt/ros/iron/lib/controller_manager/spawner joint_broad --ros-args'].
[ERROR] [spawner-5]: process has died [pid 13266, exit code 1, cmd '/opt/ros/iron/lib/controller_manager/spawner diff_cont --ros-args'].
The issue is with:
[gzserver-2] [ERROR] [1714766356.177995399] [gazebo_ros2_control]: parser error Couldn't parse parameter override rule: '--param robot_description:=<?xml version="1.0" ?><!-- =================================================================================== --><!-- | This document was autogenerated by xacro from /home/cosmin2/test/install/amr_platform/share/amr_platform/description/robot.urdf.xacro | --><!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | --><!-- =================================================================================== --><robot name="robot"><!-- Specify some standard inertial calculations https://en.wikipedia.org/wiki/List_of_moments_of_inertia --><!-- These make use of xacro's mathematical functionality --><material name="white"><color rgba="1 1 1 1"/></material><mate, at ./src/rcl/arguments.c:343
Whatever I do I cannot manage to get rid of it. Tried to modify only a line of the working robot_base.xacro of the tutorial but as soon as I do that it breaks. The new robot_base.xacro that I want to use(the one from above) used to work just fine until a few weeks ago.