ROS2 launch文件运行出错

我在启动小车模型的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看看是怎么回事

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值