0
$\begingroup$

Rosanswers logo

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?


Originally posted by David Lu on ROS Answers with karma: 10932 on 2012-03-01

Post score: 1


Original comments

Comment by David Lu on 2012-07-05:
Update here: http://answers.ros.org/question/38038/c1-vs-c2-pr2-filesystem-organization/

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by kwc with karma: 12244 on 2012-03-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by David Lu on 2012-03-02:
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.

Comment by tfoote on 2012-03-05:
You can also trigger a cache rebuild by running rospack --profile

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.