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

Errors in setting up ROS tutorial workspace in "tf tutorials"

asked 2011-03-14 10:27:44 -0600

vincent gravatar image

updated 2011-03-21 08:25:00 -0600

mmwise gravatar image

Hi everyone,

I am learning ROS (ROS cturtle) from the tutorials. I got an error when setting up the ROS tutorial workspace in "tf/tutorials".

It asked me to:

Create a file named ~/tutorials.rosinstall with the following content:

- other: local-name: workspace

To overlay on cturtle:

rosinstall ~/tutorials /opt/ros/cturtle ~/tutorials.rosinstall

I got confused with the term "workspace". I assume i gotta replace it with my working directory. I put it like

 - other: local-name: ~/tutorials.

Then I run

 rosinstall ~/tutorials /opt/ros/cturtle ~/tutorials.rosinstall

It prompts me an error:

rosinstall operating on /home/vincent/tutorials from specifications in rosinstall files  /home/vincent/tutorials/.rosinstall, /opt/ros/cturtle, /home/vincent/tutorials.rosinstall processing config_uri /opt/ros/cturtle ahhhhhhhh, yaml parse error: mapping values are not allowed here   in "/home/vincent/tutorials.rosinstall", line 3, column 19 Usage: rosinstall PATH [<options> ...] [URI]... 

rosinstall: error: None

Deleting the space between "local-name" and "~/tutorials" in that command-line solved this error. But got another error:

rosinstall operating on /home/vincent/tutorials from specifications in rosinstall files  /home/vincent/tutorials/.rosinstall, /opt/ros/cturtle, /home/vincent/tutorials.rosinstall
processing config_uri /opt/ros/cturtle
Traceback (most recent call last):
  File "/usr/local/bin/rosinstall", line 5, in <module>
    pkg_resources.run_script('rosinstall==0.5.16', 'rosinstall')
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 461, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1194, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.6/dist-packages/rosinstall-0.5.16-py2.6.egg/EGG-INFO/scripts/rosinstall", line 556, in <module>
    sys.exit(not rosinstall_main(sys.argv))
  File "/usr/local/lib/python2.6/dist-packages/rosinstall-0.5.16-py2.6.egg/EGG-INFO/scripts/rosinstall", line 506, in rosinstall_main
    result = insert_source_yaml(source_yaml, a, observed_paths, aggregate_source_yaml)
  File "/usr/local/lib/python2.6/dist-packages/rosinstall-0.5.16-py2.6.egg/EGG-INFO/scripts/rosinstall", line 386, in insert_source_yaml
    path = element[k]['local-name']
TypeError: string indices must be integers, not str

And I also tried replacing "workspace" with "/opt/ros/cturtle/stack" or "/opt/ros/cturtle/ros" or "/opt/ros/cturtle". They gave basically the same errors.

Can someone help me out? Probably obvious to everyone else, please excuse my dumbness.-_-

edit retag flag offensive close merge delete

4 Answers

Sort by ยป oldest newest most voted
1

answered 2011-03-14 10:41:47 -0600

tfoote gravatar image

Indeed that was bad syntax. I've updated the tutorial to correctly read

- other: { local-name: workspace }
edit flag offensive delete link more

Comments

So I should type exactly the same code without replacing "workspace" with some directory path? I tried that and it worked fine, just want to make sure 'cause I don't quite understand this part.
vincent gravatar image vincent  ( 2011-03-14 11:33:31 -0600 )edit
The rosinstall file designates the path "workspace" inside ~/tutorials to be in your ROS_PACKAGE_PATH. You can change it to be whatever you want, it is a relative path from where rosinstall is pointed.
tfoote gravatar image tfoote  ( 2011-03-14 11:41:56 -0600 )edit
Thanks a lot, that's clear to me now~ But here comes another problem..It would be great if you could take time look at the question below... Thank you in advance~
vincent gravatar image vincent  ( 2011-03-14 11:48:54 -0600 )edit
1

answered 2011-03-16 04:17:07 -0600

dornhege gravatar image

Well there is ros-cturtle-ros-tutorials as a deb package and there is http://www.ros.org/wiki/ros_pkg_tutorials. IIRC you don't need that stack though. So you can use any directory in your ROS_PACKAGE_PATH.

edit flag offensive delete link more

Comments

Thank you for reminding me. I checked that link before, it was listed as a ROS stack. But at that time I didn't know how to download that... Actually i'm totally a newbie to the linux world:-) And I am thinking maybe u want to remove the '.' at the end of the link you provided.
vincent gravatar image vincent  ( 2011-03-16 10:33:29 -0600 )edit
1

answered 2011-03-14 23:33:17 -0600

dornhege gravatar image

Some new thoughts here: I'm guessing in the tutorial the "ros_pkg_tutorials" just means some working directory. I can use another name as I want. For instance, I create the folder ~/tutorials/workspace and append that to ROS_PACKAGE_PATH. Then I'll cd to that folder and create the "learning_tf" package. Is it correct?

This is what you should do. Use the path created before and execute roscreate-pkg there.

edit flag offensive delete link more

Comments

Cool, thanks~
vincent gravatar image vincent  ( 2011-03-15 09:32:52 -0600 )edit
0

answered 2011-03-14 11:46:22 -0600

vincent gravatar image

updated 2011-03-14 12:33:41 -0600

Another problem is from another part of the tf/tutorial Writing a tf broadcaster (C++).

It reads:

Before we get started, you need to create a new ros package for this project. In the sandbox folder, create a package called learning_tf that depends on tf, roscpp, rospy and turtlesim:

 $ roscd ros_pkg_tutorials
 $ roscreate-pkg learning_tf tf roscpp rospy turtle_teleop
 $ rosmake learning_tf

I typed roscd ros_pkg_tutorials. But it said no package found. Do I need to install this? I've found ros_pkg_tutorials is listed as a stack. I tried sudo apt-get install but it couldn't find ros_pkg_tutorials.

(BTW, I installed ROS cturtle as PR2: ROS plus PR2-specific stacks, including PR2 simulator ).

Some new thoughts here: I'm guessing in the tutorial the "ros_pkg_tutorials" just means some working directory. I can use another name as I want. For instance, I create the folder ~/tutorials/workspace and append that to ROS_PACKAGE_PATH. Then I'll cd to that folder and create the "learning_tf" package. Is it correct?

Vincent

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-03-14 10:27:44 -0600

Seen: 814 times

Last updated: Mar 16 '11