Example 2.6 problem in roslaunch

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

while compiling
roslaunch my_package my_package_launch_file.launch

Hi @oihanealcuaz
can you hare your launch file?

I type
cat my_package_launch_file.launch
and nothing shows

Ohh then you have to fill it in! That’s why it says that the file lacks the correct syntax. Because it’s empty!

1 Like

how can i fill it? its my first day in ROS

Hi @oihanealcuaz ,

Welcome to this Community!

Since you are on ROS Basics course, the contents of the launch file should be mentioned in the course notes itself. Please refer back to the course cotes to find a sample of launch file.
Re-create the same contents of the launch file for your current package.

Regards,
Girish

Hello @oihanealcuaz,

I managed to replicate exactly the same error you reported. I did so by deleting the content of my launch file. Then, what @Voltedge guessed is correct.
To solve it, open your launch file and paste:

<launch>
    <!-- My Package launch file -->
    <node pkg="my_package" type="simple.py" name="ObiWan"  output="screen">
    </node>
</launch>

This also explains why “cat my_package_launch_file.launch” shows nothing. The cat command allows users to view the data contained within bag files, helping with debugging, analysis, and understanding of recorded information in ROS.

Additionally, to add my two cents, I recommend you run:

rospack profile

Because sometimes ROS does not detect new packages. So, you refresh it, and you will be able to do a roslaunch.