无效的 roslaunch XML 语法:格式不正确



我在尝试运行 video_file.launch 时遇到错误,该文件包含以下内容:

<?xml version="1.0"?>
<launch>
<!-- launch video stream -->
<include file="$(find video_stream_opencv)/launch/camera.launch" >
<!-- node name and ros graph name -->
<arg name="camera_name" value="videofile" />
<!-- full path to the video file -->
<!-- wget http://techslides.com/demos/sample-videos/small.mp4 -O /tmp/small.mp4 -->
<arg name="video_stream_provider" value="/tmp/small.mp4" />
<!-- set camera fps to (video files not affected) -->
<!-- <arg name="set_camera_fps" value="30"/> -->
<!-- set buffer queue size of frame capturing to -->
<arg name="buffer_queue_size" value="1000" />
<!-- throttling the querying of frames to -->
<arg name="fps" value="30" />
<!-- setting frame_id -->
<arg name="frame_id" value="videofile_frame" />
<!-- camera info loading, take care as it needs the "file:///" at the start , e.g.:
"file:///$(find your_camera_package)/config/your_camera.yaml" -->
<arg name="camera_info_url" value="" />
<!-- flip the image horizontally (mirror it) -->
<arg name="flip_horizontal" value="false" />
<!-- flip the image vertically -->
<arg name="flip_vertical" value="false" />
<!-- enable looping playback -->
<arg name="loop_videofile" value="true" />
<!-- visualize on an image_view window the stream generated -->
<arg name="visualize" value="true" />
</include>
</launch>

这是我得到的错误:

无效的 roslaunch XML 语法:格式不正确(无效标记(:第 1 行,第 5 列

代码与 中的代码相同:

https://github.com/ros-drivers/video_stream_opencv

确保在文件名后附加.launch扩展名,如 ROS 文档中所述:

许多 ROS 软件包都带有"启动文件",您可以使用它们运行:

roslaunch package_name file.launch

如果省略文件扩展名,则会发生相同的错误。

XML不允许在 XML 声明(<?xml .... ?>部分(之前出现空格。在解析之前删除它。

最新更新