Robotics StackExchange | Archived questions

XML syntax error while running a launch file

I am using ROS melodic on ubuntu 18.04. I was trying to run the following launch file:

<launch>
    <param name="teleop_topic" value="/turtle1/cmd_vel"/>
    <!-- Loading teleop parameter file -->
    <rosparam command="load" file="$(find gesture_teleop)/config/teleop_config.yaml"/>
    <!-- Launching ros serial nodes -->
    <node name="rosserial_server_node" pkg="rosserial_python" type="serial_node.py" args="$(arg port)" output="screen"/>
    <!-- Starting gesture teleop node -->
    <node name="gesture_teleop_node" pkg="gesture_teleop" type="gesture_teleop.py" output="screen"/>
    <!-- Starting turtlebot 2D simualation -->
    <node name="turtlebot_node" pkg="turtlesim" type="turtlesim_node" output="screen"/>
</launch>

However , it gave an error:

RLException: Invalid roslaunch XML syntax: no element found: line 1, column 0
The traceback for the exception was written to the log file

What exactly is the error in the first line?

Asked by N5m5sis26 on 2021-12-09 15:06:52 UTC

Comments

Pls look at prior answers and note the things that you have tried: https://answers.ros.org/question/224549/invalid-roslaunch-xml-syntax-not-well-formed-invalid-token/

Asked by osilva on 2021-12-09 18:47:23 UTC

Hi. Please paste the exact command you are using to 'run' the launch file. This error happens when you call the launch file using 'rosrun' command. I think you are trying rosrun to launch the file which is not correct.

Asked by Muhammad Umar on 2021-12-09 20:33:45 UTC

Answers

There's nothing obviously wrong with the launch file content you copy/pasted. The most common reason to get this error is if the launch file you specified on the roslaunch command line is actually empty (has no xml tags.)

Are you maybe generating this file at startup?

Asked by Mike Scheutzow on 2021-12-09 20:20:24 UTC

Comments

yes, that was the case with me. I was saving and editing the same file somewhere else

Asked by Shivam on 2022-12-17 19:45:47 UTC