Ask Your Question
0

How to rosmake ROS package which is in /opt/ros/***/stacks/

asked 2012-08-22 14:09:11 -0500

moyashi gravatar image

Could you tell me how to re-rosmake packages under /opt/ros/*/stacks/ ?

I installed openni_kinect package.
In order to understand how it works,
I added some ROSINFO function in some codes(For example, in openni_device.cpp).
Next, I renamed ROS_NOBUILD file to ROS_NOBUILD_ORG not to skip building this package.

Finally, I did "rosmake openni_camera", however, I got an error.
The error means
"mkdir : could not make `build' directory : not permitted".

How do I solve it?
Of course, I cannot conduct "sudo rosmake * * *".

edit retag flag offensive close merge delete

3 Answers

Sort by » oldest newest most voted
3

answered 2012-08-22 22:15:26 -0500

updated 2013-02-04 22:01:49 -0500

Just to provide some explanation to the previous answers: changing files in /opt/ros/... is a very bad idea, because first, your changes can be overwritten by APT updates, and second, it becomes very hard to isolate whether there is a bug in ROS, or a bug in your changes or other code. It is much better to copy the package you wish to change somewhere into your home directory (that way you'll have write access to it), and prepend that directory to your ROS_PACKAGE_PATH. So in order to revert to a "clean" ROS installation without your changes, you just have to remove your home dir from your ROS_PACKAGE_PATH. This is not possible if you change files directly.

edit flag offensive delete link more

Comments

Thank you for your kind answer. If I follow your guide, I think there are two same packages under ROS_PACKAGE_PATH. Even in this case, can I use these packages separately?

moyashi gravatar image moyashi  ( 2012-08-23 14:00:35 -0500 )edit

Only the first package in the path will be used. If you try to run rosmake inside the second package, you will get an error. In order to switch from one package to the other, you have to put the other package first in your path.

Martin Günther gravatar image Martin Günther  ( 2012-08-24 04:41:03 -0500 )edit

Does "the path" mean ROS_PACKAGE_PATH ? If I have "echo $ROS_PACKAGE_PATH -> /home/user/ros_workspace:/opt/ros/electric/stacks", I have to put the package I'd like to use in ros_workspace?

moyashi gravatar image moyashi  ( 2012-08-26 14:47:11 -0500 )edit

@nitasgu: Yes, exactly.

Martin Günther gravatar image Martin Günther  ( 2012-08-26 23:17:38 -0500 )edit
3

answered 2012-08-22 14:36:23 -0500

wildfire gravatar image

You'd better make a workspace and set the ROS_PACKAGE_PATH at there. Don't change something in /opt/ros.....

edit flag offensive delete link more

Comments

Thank you for your comment. I stopped trying to change some files.

moyashi gravatar image moyashi  ( 2012-08-23 13:47:11 -0500 )edit
2

answered 2012-08-22 21:35:43 -0500

KruseT gravatar image

Read here: http://www.ros.org/wiki/electric/Installation/Ubuntu/Source on how to build ROS electric from source. similar pages exist for other versions.

Do not change files in /opt/ros, do not rename ROS_NOBUILD

edit flag offensive delete link more

Comments

Thank you. Does your idea mean that if I'd like to change some files, I'd better install ros under my home directry(eg. /home/user/ros/) ?

moyashi gravatar image moyashi  ( 2012-08-23 13:50:50 -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

Stats

Asked: 2012-08-22 14:09:11 -0500

Seen: 534 times

Last updated: Feb 04 '13