Ask Your Question
0

ROS path relocation error

asked 2011-06-23 08:23:29 -0500

Khiya gravatar image

updated 2014-01-28 17:09:55 -0500

ngrennan gravatar image

Hello all,

I recently moved my main ros directory and now I cannot start executables like roslaunch, rosmake, or rosdep. I had made sure to edit my setup.sh file so I'm very confused about what's gone wrong. Details:

When I first installed Diamondback, roscd would take me to /opt/ros/diamondback/ros. Everything worked fine, but I foudn it just a bit annoying so I moved the whole diamondback directory to /home/khiya/ and changed the environment variables in setup.sh (located in the diamondback directory) accordingly. roscd now takes me straight to /home/khiya/diamondback/ros, but when I tried running any executables, such as roslaunch (kinda crucial, I know) I got this error:

     :~/diamondback/ros$ roscore
        Traceback (most recent call last):
          File "/home/khiya/diamondback/ros/bin/roscore", line 34, in <module>
            from ros import roslaunch
          File "/home/khiya/diamondback/ros/core/roslib/src/ros/__init__.py", line 56, in __getattr__
            raise ImportError("Cannot import module '%s': \n%s"%(name, str(e)))
        ImportError: Cannot import module 'roslaunch': 
        Cannot locate installation of package roslaunch: 
    /home/khiya/diamondback/ros/bin/rospack: error while loading shared libraries: 
librospack.so: cannot open shared object file: No such file or directory. 
ROS_ROOT[/home/khiya/diamondback/ros] 
ROS_PACKAGE_PATH[/home/khiya/sandbox/hrl_rfid:/home/khiya/ros_tutorials:
/home/khiya/diamondback/stacks]

(The last 5 lines are one continuous line, I just chopped it up for easier reading, in case that's important). The error seems to be saying that the directory /home/khiya/diamondback/ros/bin doesn't contain any of those important executables, but I can cd there and see that they're there. Do I need to tweak something in librospack.so?

Thanks very much,

Khiya

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-06-23 23:41:11 -0500

Lorenz gravatar image

Generally, it is a really bad idea to just rename/move ROS packages without recompiling them. To me it seems that you installed ROS from debian packages and then just moved the whole installation which basically will interfere with your package manager. People normally don't do that :)

The reason why you are running into problems is RPATH. It's a property that can be set for linux libraries and binaries and it specifies the absolute path to libraries used by that binary. If you now move the whole tree, these paths will be wrong and binaries will be unable to find the required libraries.

Instead of moving the whole tree you can do a source-based installation in your home, but I wouldn't recommend that. Instead you normally make an overlay in your home. You can find some interesting information about that here and here.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-06-23 08:23:29 -0500

Seen: 1,987 times

Last updated: Jun 23 '11