ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Invalid roslaunch XML syntax: not well-formed (invalid token)

asked 2016-01-19 20:02:46 -0600

jamni gravatar image

updated 2018-11-28 13:38:23 -0600

jayess gravatar image

hi

<launch>
   <!-- Camera Node -->
   <node name="$(arg camera_name)" pkg="uvc_camera" type="uvc_camera_node" output="screen" ns="$(arg camera_name)">
       <param name="device" type="string" value="$(arg device)" />
       <param name="camera_info_url" type="string" value="package://mcptam/calibrations/$(arg camera_name).yaml" />
   </node>
   <!-- camera_calibrator node -->
   <node name="camera_calibrator" pkg="mcptam" type="camera_calibrator" output="screen">
      <param name="cam_name" type="string" value="$(arg camera_name)"/>
      <param name="image_transport" type="string" value="compressed"/>
      <param name="image_topic" type="string" value="image_raw" />
      <param name="info_topic" type="string" value="camera_info"/>
  </node></launch>

this is my launch file but i got a message

Invalid roslaunch XML syntax: not well-formed (invalid token): line 1, column 0

which part is wrong??

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2016-01-20 00:01:24 -0600

ahendrix gravatar image

I don't see anything obviously wrong with your launch file.

"Line 1, column 0" is the first character in your launch file. I see a <, which should be valid, but perhaps you have a non-printing character in the file or something?

You can try to confirm by looking at a binary dump of the file (try hexdump -C mylaunch.launch).

You can also just create a new launch file, and retype the whole thing. (Don't copy/paste. there's a decent chance you'll copy the offending character into the new file)

edit flag offensive delete link more

Comments

1

thanks for your answer :) i try to confirm the binary dump, but there is no wrong things. and i erase all the things and re-type the launch file(not copy and paste), it doesn't work too :(

there is another command like roslaunch?

jamni gravatar image jamni  ( 2016-01-20 19:42:23 -0600 )edit

Try removing things from your launch file until it works, and then slowly re-add them until you identify the problem. The most basic launch file <launch></launch> should work (and do nothing).

ahendrix gravatar image ahendrix  ( 2016-01-20 19:55:53 -0600 )edit

Im having the same issue where can i locate that roslaunch file ??

sneibus gravatar image sneibus  ( 2020-10-07 06:59:27 -0600 )edit
10

answered 2016-12-02 11:36:16 -0600

CWallbridge gravatar image

This may also occur if you are not referring to your launch file properly when you use the roslaunch command as it attempts to essentially run an empty file, for example:

roslaunch node_launch run

Instead of:

roslaunch node_launch run.launch

Where your launch file is called "run.launch".

edit flag offensive delete link more

Comments

Thanks a lot! Totally forgot about it while using tab to auto-complete.

Nishanth97 gravatar image Nishanth97  ( 2018-02-01 21:03:11 -0600 )edit
0

answered 2016-01-20 01:22:00 -0600

crazymumu gravatar image

Maybe try like this.

<launch>
   <!-- Camera Node -->
   <node name="$(arg camera_name)" pkg="uvc_camera" type="uvc_camera_node" output="screen" ns="$(arg camera_name)">
       <param name="device" type="string" value="$(arg device)" />
       <param name="camera_info_url" type="string" value="package://mcptam/calibrations/$(arg camera_name).yaml" />
   </node>
   <!-- camera_calibrator node -->
   <node name="camera_calibrator" pkg="mcptam" type="camera_calibrator" output="screen">
      <param name="cam_name" type="string" value="$(arg camera_name)"/>
      <param name="image_transport" type="string" value="compressed"/>
      <param name="image_topic" type="string" value="image_raw" />
      <param name="info_topic" type="string" value="camera_info"/>
  </node>
</launch>
edit flag offensive delete link more

Comments

1

Can you describe what you've changed compared to the posted launch file?

ahendrix gravatar image ahendrix  ( 2016-01-20 01:32:14 -0600 )edit

last line. It said the first line was wrong. May be this didn't change anything.

crazymumu gravatar image crazymumu  ( 2016-01-20 01:39:07 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-01-19 20:02:46 -0600

Seen: 32,784 times

Last updated: Nov 28 '18