我在启动小车模型的launch文件,老是报错:
czf@czf-virtual-machine:~/ros2$ ros2 launch ros2car_sim display.launch.xml
[INFO] [launch]: All log files can be found below /home/czf/.ros/log/2024-09-20-14-13-30-719270-czf-virtual-machine-14234
[INFO] [launch]: Default logging verbosity is set to INFO
[ERROR] [launch]: Caught exception in launch (see debug for traceback): Caught multiple exceptions when trying to load file of format [xml]:
- InvalidFrontendLaunchFileError: Caught multiple exceptions when trying to load file of format [xml]:
- ParseError: unclosed token: line 1, column 0
- RuntimeError: Expected only one root
- SyntaxError: invalid syntax (display.launch.xml, line 1)
我的launch文件:
czf@czf-virtual-machine:~/ros2$ cat ~/ros2/src/ros2car_sim/launch/display.launch.xml
<?xml version="1.0" encoding="UTF-8">
<launch xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.ros2.org/schema/launch">
<!-- 参数定义 -->
<arg name="model" default="$(find ros2car_sim)/urdf/car.xacro"/>
<arg name="rvizconfig" default="$(find ros2car_sim)/rviz/car.rviz"/>
<!-- 生成机器人描述 -->
<let name="robot_description" value="$(command 'xacro $(arg model)')"/>
<!-- 发布机器人状态 -->
<node name="robot_state_publisher" pkg="robot_state_publisher" executable="robot_state_publisher" output="screen">
<param name="robot_description" value="$(var robot_description)"/>
</node>
<!-- 启动rviz2并加载配置文件以显示机器人 -->
<node name="rviz2" pkg="rviz2" executable="rviz2" output="screen">
<param name="config" value="$(arg rvizconfig)"/>
</node>
</launch>
各位uu看看是怎么回事