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

Unable to select model argument for urdf-tutorial package

asked 2015-11-17 01:26:51 -0600

rbaleksandar gravatar image

updated 2015-11-17 02:11:54 -0600

Hi!

I'm looking into the tutorials on URDF (ROS Indigo), robot_state_publisher etc. In this tutorial it is stated that

roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf

should start rviz (launch parameters stored inside display.launch) with the selected model. Sadly I'm getting the error that such file cannot be found:

rosuser:~$ roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf
... logging to /home/rosuser/.ros/log/336d620e-8d02-11e5-b0c5-90fba64806be/roslaunch-latadmin-ros-7550.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 298, in main
    p.start()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 260, in start
    self._start_infrastructure()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 209, in _start_infrastructure
    self._load_config()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 124, in _load_config
    roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
    loader.load(f, config, verbose=verbose)
  File "/opt/ros/indigo/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/indigo/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/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 646, in _recurse_load
    self._param_tag(tag, context, ros_config, verbose=verbose)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
    return f(*args, **kwds)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 264, in _param_tag
    value = self.param_value(verbose, name, ptype, *vals)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/loader.py", line 463, in param_value
    with open(textfile, 'r') as f:
IOError: [Errno 2] No such file or directory: u'urdf/01-myfirst.urdf'

I also read the lines below:

This launch file assumes that 01-myfirst.urdf is in the urdf subdirectory of the directory that you type the command in. Otherwise, you should say model:='$(find pkg-name)/urdf/01-myfirst.urdf' where pkg-name is the name of the package that the file is in (single quotes required)

I tried both with an installed version of the package and a fresh download of the package inside my catkin workspace but in both cases I'm getting the same error. I have checked and the urdf folder is there along with the specified file (last line of the following terminal output):

rosuser:/opt/ros/indigo/share/urdf_tutorial$ ls -R
.:
cmake  images  launch  package.xml  urdf  urdf.rviz  urdf.vcg

./cmake:
urdf_tutorialConfig-version.cmake  urdf_tutorialConfig.cmake

./images:
flexible.png  materials.png  multipleshapes.png  myfirst.png  origins.png  visual.png

./launch:
display.launch  gazebo.launch  xacrodisplay.launch

./urdf:
01-myfirst.urdf  02-multipleshapes.urdf  03-origins.urdf  04-materials.urdf  05-visual.urdf  06-flexible ...
(more)
edit retag flag offensive close merge delete

Comments

Please add the exact error message to your original post (use the edit button/link). Also: which version of ROS, how installed, etc.

gvdhoorn gravatar image gvdhoorn  ( 2015-11-17 01:44:26 -0600 )edit

Done, although the error message doesn't say much (even by looking at the trace) and also I don't get the "how installed" part.

rbaleksandar gravatar image rbaleksandar  ( 2015-11-17 02:13:50 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-11-17 03:38:24 -0600

gvdhoorn gravatar image

updated 2015-11-17 04:29:51 -0600

rosuser:~$ roslaunch urdf_tutorial display.launch model:=urdf/01-myfirst.urdf
[..]
IOError: [Errno 2] No such file or directory: u'urdf/01-myfirst.urdf'

according to this, you are invoking roslaunch from your home directory (~). As the tutorial explains:

This launch file assumes that 01-myfirst.urdf is in the urdf subdirectory of the directory that you type the command in.

While the wording could be a bit better, it essentially tells you that you can only give display.launch a relative path to 01-myfirst.urdf if you are actually in a directory that is the direct parent of the urdf directory.

Your home directory is not the direct parent of the /opt/ros/indigo/share/urdf_tutorial/urdf directory, hence the error.

Either do a roscd urdf_tutorial before trying to launch display.launch or use the alternative way to launch it (change pkg-name to urdf_tutorial):

Otherwise, you should say model:='$(find pkg-name)/urdf/01-myfirst.urdf' where pkg-name is the name of the package that the file is in (single quotes required)

This form should work no matter what your current working directory is.


edit: I've changed the wording of the quoted section of the tutorial to be more clear about relative vs absolute paths to files in the urdf_tutorial package.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-11-17 01:26:51 -0600

Seen: 892 times

Last updated: Nov 17 '15