Ask Your Question
1

rospack cache per workspace?

asked 2013-12-09 03:59:39 -0500

dornhege gravatar image

The rospack cache is currently build user-wide. I often switch between workspaces that contain different sets of packages or the same package at different locations.

I heavily rely on tab-completion. Rospack does everything correctly here, i.e. I've never seen it switch to a wrong package location. However, when I switch the workspace and then observe a now new to rospack package again roscd (caused by rospack I assume) hangs until I either put in the package manually or it has found it.

Is there any way to preserve the rospack cache for a specific workspace?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-12-09 06:00:49 -0500

Dirk Thomas gravatar image

No, that is currently not possible.

edit flag offensive delete link more

Comments

Unfortunately that's what I thought.

dornhege gravatar imagedornhege ( 2013-12-09 06:07:00 -0500 )edit
1

`rospack` could use an environment specific cache file. But I guess it would take quite some effort to implement.

Dirk Thomas gravatar imageDirk Thomas ( 2013-12-09 06:10:13 -0500 )edit

So I checked out the sources. Would it be sufficient to (maybe optionally) use $ROS_WORKSPACE to determine the path to put the cache files? roscd, etc. should just use rospack then, right? If you think that is feasible I'd be willing to provide a patch.

dornhege gravatar imagedornhege ( 2013-12-09 22:08:43 -0500 )edit
1

$ROS_WORKSPACE is not an "official" variable of ROS. It is only defined and used by some of the tools. The cache should be ROS_PACKAGE_PATH specific. The cache file(s) should stay in the same location as they are currently (`~/.ros/`). Yes, commands like roscd use rospack.

Dirk Thomas gravatar imageDirk Thomas ( 2013-12-10 09:32:39 -0500 )edit

OK, in that case it's not trivial to do unfortunately.

dornhege gravatar imagedornhege ( 2013-12-10 22:25:02 -0500 )edit

Let me give this one more shot: What do you think about naming the files: rospack_cache_MD5SUM_OF_$ROS_PACKAGE_PATH? This would lead to package path specific caches nicely hidden in ~/.ros. After thinking about this for a while it doesn't seem to be that hacky to me any more.

dornhege gravatar imagedornhege ( 2013-12-11 03:18:55 -0500 )edit

Yes, that would be good.

Dirk Thomas gravatar imageDirk Thomas ( 2013-12-11 06:00:43 -0500 )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: 2013-12-09 03:59:39 -0500

Seen: 264 times

Last updated: Dec 09 '13