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

Roslaunch Traceback (most recent call last)

asked 2011-11-02 09:34:46 -0600

Maneesh gravatar image

updated 2014-01-28 17:10:42 -0600

ngrennan gravatar image

hey,

i am getting a new type of error which i am not aware of how to resolve it.... if anyone knows how to reolve this issue please let me know... the error message i am receiving is :

youbot@youbot-laptop:~$ roslaunch
Traceback (most recent call last):
  File "/opt/ros/diamondback/ros/bin/roslaunch", line 2, in <module>
   from ros import roslaunch
  File "/opt/ros/diamondback/ros/core/roslib/src/ros/__init__.py", line 57, in __getattr__
    return __import__(name)
ImportError: No module named roslaunch

if anyone has any idea regarding this please let me know...thanks in advance....

regards,

Maneesh

edit retag flag offensive close merge delete

Comments

Sounds like problems with the python path. What does a "echo $PYTHONPATH" output? Are you changing PYTHONPATH after sourcing the ros setup file in your ~/.bashrc?
Felix Endres gravatar image Felix Endres  ( 2011-11-02 21:54:31 -0600 )edit
Hey thanks for responding, the output of the export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH}, and yes after the ros setup, I am adding a line " $export ROS_PACKAGE_PATH=/home/youbot/ros_stacks" in the setup.sh
Maneesh gravatar image Maneesh  ( 2011-11-03 01:42:01 -0600 )edit
along with the above lines, I had few more lines of error, i read somewhere that, if you delete the .pyc file and change the name of the .py file the error goes off, and it did... was that the right solution???? Well i tried the same thing with above and it didnt work...
Maneesh gravatar image Maneesh  ( 2011-11-03 01:55:28 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-11-03 03:08:43 -0600

joq gravatar image

updated 2011-11-03 04:47:11 -0600

Sounds like you redefined $ROS_PACKAGE_PATH so it no longer includes the stacks of the ROS distribution. That could explain your import failure.

The root problem seems to be misunderstanding environment variables, so here is the corrected export command, as explained in several comments below:

export ROS_PACKAGE_PATH=/home/maneesh/ros_stacks:$ROS_PACKAGE_PATH
edit flag offensive delete link more

Comments

So how do i go about eliminating this failure / error, so that i can go ahead and launch gazebo with the ros command.... I am sorry, i am very much new to this and I have less knowledge in this field... if you can help with this, it would be grateful....
Maneesh gravatar image Maneesh  ( 2011-11-03 03:14:25 -0600 )edit
I dint delete any line or path from the setup.sh, just added an additional line, which is export ROS_PACKAGE_PATH=/home/youbot/ros_stacks..... however, there was another line : export ROS_PACKAGE_PATH=/opt/ros/diamondback/stacks....which still present in the setup.sh.... is this causing the problem?
Maneesh gravatar image Maneesh  ( 2011-11-03 03:21:55 -0600 )edit
You must keep the original ROS_PACKAGE_PATH and prepend or append to it. Use: export ROS_PACKAGE_PATH=/home/youbot/ros_stacks:$ROS_PACKAGE_PATH
Felix Endres gravatar image Felix Endres  ( 2011-11-03 04:07:20 -0600 )edit
Yes, i tried that, but still i am getting the error... let me post the contents of the setup.sh file, that might help...
Maneesh gravatar image Maneesh  ( 2011-11-03 04:31:37 -0600 )edit
export ROS_ROOT=/opt/ros/diamondback/ros export PATH=${ROS_ROOT}/bin:${PATH} export PYTHONPATH=${ROS_ROOT}/core/roslib/src:${PYTHONPATH} export ROS_PACKAGE_PATH=/opt/ros/diamondback/stacks export ROS_PACKAGE_PATH=/home/maneesh/ros_stacks
Maneesh gravatar image Maneesh  ( 2011-11-03 04:32:12 -0600 )edit
and the last line was : if [ ! "$ROS_MASTER_URI" ] ; then export ROS_MASTER_URI=http://localhost:11311 ; fi now please let me know what i need to modify in order to get rid of this error....:)
Maneesh gravatar image Maneesh  ( 2011-11-03 04:34:27 -0600 )edit
As others have noted, you need to *append* to your ROS_PACKAGE_PATH. The sample you pasted *redefines* it. Append looks like "export ROS_PACKAGE_PATH=/home/maneesh/ros_stacks:$ROS_PACKAGE_PATH"
kwc gravatar image kwc  ( 2011-11-03 04:39:42 -0600 )edit
Thank you so much for your help guys, it seems to be working fine now..... the process works....:)
Maneesh gravatar image Maneesh  ( 2011-11-03 05:10:36 -0600 )edit

Question Tools

Stats

Asked: 2011-11-02 09:34:46 -0600

Seen: 5,761 times

Last updated: Nov 03 '11