0
$\begingroup$

Rosanswers logo

Working through this tutorial on navigation package: http://wiki.ros.org/navigation/Tutorials/RobotSetup I built the launch files as directed. The first one launches OK. The second one fails.

Launch file with issue:


<launch>
  <master auto="start"/>

  <!-- Run the map server -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find catkin_ws)/map.pgm map_resolution"/>

  <!--- Run AMCL -->
  <include file="$(find amcl)/examples/amcl_diff.launch" />

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="global_costmap" />
&lt;rosparam file="$(find my_robot_name_2dnav)/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find my_robot_name_2dnav)/local_costmap_params.yaml" command="load" />
&lt;rosparam file="$(find my_robot_name_2dnav)/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find my_robot_name_2dnav)/base_local_planner_params.yaml" command="load" />
  </node>
</launch>

The error code:

Traceback (most recent call last):
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
    p.start()
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
    self._start_infrastructure()
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
    self._load_config()
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader.load(f, config, verbose=verbose)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 730, in load
    self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 702, in _load_launch
    self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 638, in _recurse_load
    n = self._node_tag(tag, context, ros_config, default_machine, verbose=verbose)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
    return f(*args, **kwds)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 379, in _node_tag
    'launch-prefix', 'required'))
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 202, in opt_attrs
    return [self.resolve_args(tag_value(tag,a), context) for a in attrs]
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 183, in resolve_args
    return substitution_args.resolve_args(args, context=context.resolve_dict, resolve_anon=self.resolve_anon)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 312, in resolve_args
    resolved = _resolve_args(resolved, context, resolve_anon, commands)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 325, in _resolve_args
    resolved = commands[command](resolved, a, args, context)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 141, in _find
    source_path_to_packages=source_path_to_packages)
  File "/opt/ros/jade/lib/python2.7/dist-packages/roslaunch/substitution_args.py", line 184, in _find_executable
    full_path = _get_executable_path(rp.get_path(args[0]), path)
  File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 200, in get_path
    raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: catkin_ws
ROS path [0]=/opt/ros/jade/share/ros
ROS path [1]=/home/linux
ROS path [2]=/home/linux/catkin_ws
ROS path [3]=/home/linux/catkin_ws/src
ROS path [4]=/opt/ros/jade/share
ROS path [5]=/opt/ros/jade/stacks
linux@linux-Latitude-D630:~/catkin_ws/src/my_robot_name_2dnav$

It is referring a folder (catkin_ws) as a resource. I'm not sure what to make of that. The error shows the ROS Package Path and it's definitely there. I have sourced it from opt folder and rebuilt without help.

To see what happens if I get past that error, I deleted the map_server line from the file and ran again and got this error.

[roslaunch][INFO] 2016-06-07 21:40:29,606: starting in server mode
[roslaunch.parent][INFO] 2016-06-07 21:40:29,606: starting roslaunch parent run
[roslaunch][INFO] 2016-06-07 21:40:29,607: loading roscore config file /opt/ros/jade/etc/ros/roscore.xml
[roslaunch][INFO] 2016-06-07 21:40:29,810: Added core node of type [rosout/rosout] in namespace [/]
[roslaunch.config][INFO] 2016-06-07 21:40:29,810: loading config file move_base.launch
[roslaunch][INFO] 2016-06-07 21:40:29,919: Added node of type [amcl/amcl] in namespace [/]
[roslaunch][ERROR] 2016-06-07 21:40:29,957: error loading  tag: 
    file does not exist [/home/linux/catkin_ws/src/my_robot_name_2dnav/costmap_common_params.yaml]
XML is 

[rospy.core][INFO] 2016-06-07 21:40:29,958: signal_shutdown [atexit]

The file it says doesn't exist, does exist and the path is correct. So with the succession of errors, it looks like I have a configuration problem, but can't figure out what the issue is.

Any help is appreciated.


Originally posted by billy on ROS Answers with karma: 1850 on 2016-06-08

Post score: 0


Original comments

Comment by gvdhoorn on 2016-06-16:
If you feel your question has been answered, please indicate that by ticking the checkmark to the left of the answer. That will clearly mark the question as answered in the question list.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

 <node name="map_server" pkg="map_server" type="map_server" args="$(find catkin_ws)/map.pgm map_resolution"/> 

the problem is in this line in your launch file: you are asking roslaunch to search for a package called catkin_ws, which it can't find. Hence the ResourceNotFound exception.

You can only ask roslaunch to look for packages, not directories, and if you look at the launch file example given in the tutorial you linked, you'll see that is exactly what they do:

  <node name="map_server" pkg="map_server" type="map_server" args="$(find my_map_package)/my_map.pgm my_map_resolution"/>

Notice the $(find my_map_package).


Originally posted by gvdhoorn with karma: 86574 on 2016-06-08

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by billy on 2016-06-08:
If there was an emoji on the board with a forehead slap, I would use that here. Thank you for taking the time to explain.

Any idea what causes the file-does-not-exist error? Is it possible that the duplicated line causes an issue? It was in the tutorial so I left it in.

Comment by gvdhoorn on 2016-06-09:
? I'm not sure I understand: there is no duplicated line (at least not in the launch file you posted). You seem to have altered the map_server node args, substituting catkin_ws (which is a directory) for my_map_package (an actual pkg). roslaunch can't search for dirs, only pkgs.

Comment by billy on 2016-06-09:
GVD, I was unable to fix the file-does-not-exist rationally, so I deleted and created a new one. That corrected it. Launch file is functioning now. Now I'm on to the next issue of AMCL not recognizing the robot pose. Thanks again for your help. If you guys weren't here to help, I'd be screwed.

Comment by gvdhoorn on 2016-06-09:
Well, basically you put catkin_ws as an argument to the $(find ..) substitution arg. That will cause roslaunch to go looking for a package called catkin_ws. There is no package called 'catkin_ws'. It is a directory. Pkgs have package.xml files. roslaunch only finds pkgs.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.