Ask Your Question
1

Rospack Caching Failure

asked 2012-03-01 10:10:55 -0600

David Lu gravatar image

updated 2014-11-22 17:05:12 -0600

ngrennan gravatar image

I'm trying to run a custom version of move_base on our PR2. The code works fine elsewhere. When running move_base with a launch file or rosrun, however, it runs the standard version and not my version.

$ echo $ROS_PACKAGE_PATH
/home/dlu/ros:/opt/ros/electric/stacks

$ rospack find move_base
/home/dlu/ros/nav_experimental/move_base

I put a custom ROS_INFO message into the move_base code. And running the code directly from the directory works fine.

$ bin/move_base 
[ INFO] [1330639556.246247279]: Subscribed to Topics: base_scan_marking base_scan tilt_scan ground_object_cloud
[ INFO] [1330639556.266441874]: Subscribe Now!
[ INFO] [1330639556.267763437]: Requesting the map...

However, running using a launch file and/or rosrun does not work (instead running the old version).

$ rosrun move_base move_base 
[ INFO] [1330639542.607175443]: Subscribed to Topics: base_scan_marking base_scan tilt_scan ground_object_cloud
[ INFO] [1330639542.626603667]: Requesting the map...

Edit: rosrun move_base move_base works if the package is properly set in ~/.ros/rospack_cache, however, roslaunch resets the value in rospack_cache to the standard electric version.

Edit 2: I believe the problem lies in the fact that my launch file includes pr2.machine, which includes this line:

 <machine name="c1" address="c1" ros-root="$(env ROS_ROOT)" ros-package-path="$(env ROS_PACKAGE_PATH)"  default="true" />

I don't think my ROS_PACKAGE_PATH is being set in the correct place, thus explaining this problem and the tab-complete problem described below. I currently export it (with my modification) in .bashrc right after sourcing setup.bash. Is there a better place to set it?

edit retag flag offensive close merge delete

Comments

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-03-02 05:11:31 -0600

kwc gravatar image

The problem description no longer describes the steps to reducing the problem, so I can only guess.

roslaunch doesn't "reset" the rospack_cache. Only rospack is capable of writing to the rospack_cache. roslaunch is capable of invoking rospack, which can cause changes to the cache value, but changes would only occur if the environment variables were different. In fact, the top of the cache file shows what environment variables were set to when the cache was written.

So, the problem implies that the environment variables are being reset, which can occur, for example, if your launch file sets these environment variables running remotely, or if you are attempting to hack the main PR2 bringup, which has its own mechanisms for setting environment variables.

edit flag offensive delete link more

Comments

Perhaps narrowing the problem, the roscd autocomplete doesn't automatically suggest things in my repo, i.e. only stuff in electric. Only once I manually type something from my repo does it correctly autocomplete. I'm setting ROS_PACKAGE_PATH in my bashrc, but that doesn't lead to proper caching.

David Lu gravatar imageDavid Lu ( 2012-03-02 09:16:05 -0600 )edit

You can also trigger a cache rebuild by running rospack --profile

tfoote gravatar imagetfoote ( 2012-03-05 10:27:51 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2012-03-01 10:10:55 -0600

Seen: 583 times

Last updated: Mar 11 '12