Ask Your Question
1

Confusion with ROS_PACKAGE_PATH

asked 2013-08-01 05:06:10 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi everyone, I know this is a basic question but I require some guidance. I am new to linux and ROS so I understand this is a basic question.

I have currently installed ROS fuerte and the folder is in the /opt/ros/fuerte on my file system.

I was following the tutorial here: link:www.ros.org/wiki/ROS/Tutorials/InstallingandConfiguringROSEnvironment">text

but realised that I have not configured the ROS_ROOT or ROS_PACKAGE_PATH so I entered the commands provided. However, how do I check if I am successful with these commands? The command for the ROS_PACKAGE_PATH is: export ROS_PACKAGE_PATH=/home/user/ros/ros-pkg:/another/path

so I created a folder called rospackagepath so the line above becomes: ROS_PACKAGE_PATH=/home/user/ros/ros-pkg:/rospackagepath

However the file is empty. Also, I do not have a user folder so should I have something like? ROS_PACKAGE_PATH=/home/ros-pkg:/rospackagepath ?

Thanks for your help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2013-08-01 06:24:44 -0500

tbh gravatar image

updated 2013-08-05 11:04:05 -0500

ROS_ROOT and ROS_PACKAGE_PATH are environment variables, not files. They tell the operating system where to look for all the ROS stuff on your computer. Have a look here for more info. You want ROS_PACKAGE_PATH to include all the directories where your ros code is.

In linux, the echo command prints things out. To print out the values of system variables, you'd use the $ symbol before the variable. So echo $ROS_PACKAGE_PATH will show you what ROS_PACKAGE_PATH currently is. Type man echo for more info about echo.

In linux, / is the root of the filesystem. You probably don't want to put stuff there. Have a look at the FHS wikipedia page for more info about what normally goes in each directory in linux.

When they say 'user', they mean whatever your user name is. /home/<your user name here> is considered your home directory. Type whoami to figure out what your user name is, and type cd ~ to go to your home directory.

EDIT

Yes, you'll have to change /another/path. In fact, any folder that has ros packages that you want to be able to access needs to be on the ROS_PACKAGE_PATH. What folders there are depends on you and your needs.

For example, the default packages are in /opt/ros/fuerte/share/ros, /opt/ros/fuerte/stacks and /opt/ros/fuerte/share. Then the standard ROS_PACKAGE_PATH would be

/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros

However, lets also say you made two directories in your home folder for holding ros workspaces: dirA and dirB. Then you'd want to add them to the ROS_PACKAGE_PATH, like so:

/home/jay/dirA:/home/jay/dirB:/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros

In that case, dirA would be searched before dirB. To give preference to dirB packages, you'd use

/home/jay/dirB:/home/jay/dirA:/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros

EDIT 2:

So for one workspace I do: export ROS_PACKAGE_PATH=/home/user/ros/ros-pkg//opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros ?

almost. Don't forget the colon between paths. It should be

export ROS_PACKAGE_PATH=/home/jay/ros/ros-pkg:/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros

And that assumes there is a folder called ros/ros-pkg in your home directory where all your code is.

My intentions are to use the ARDrone so I assume I have to change the above eventually? Would you use two workspaces to work on two different robots?

That's up to you. Have a look at rosws if you're going to use multiple workspaces, though. Also note that the new build system, catkin, doesn't use ROS_PACKAGE_PATH.

EDIT 3:

Okay I am starting to piece it all together from the tutorial also. The tutorial makes a 'fuerte_workspace' folder with setup.* folders and a sandbox folder.

Actually, setup.bash (and the like ... (more)

edit flag offensive delete link more

Comments

Thank you for your kind reply. I have replaced my user name with user as you explained very clearly to me and my ROS_PACKAGE_PATH variable now points to /home/jay/ros/ros-pkg:/another/path. I assume /another/path should be replaced also but I do not know what that is referring to.

JP gravatar image JP  ( 2013-08-01 07:15:01 -0500 )edit

So for one workspace I do: export ROS_PACKAGE_PATH=/home/user/ros/ros-pkg//opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros ? My intentions are to use the ARDrone so I assume I have to change the above eventually? Would you use two workspaces to work on two different robots?

JP gravatar image JP  ( 2013-08-01 10:20:39 -0500 )edit

Okay I am starting to piece it all together from the tutorial also. The tutorial makes a 'fuerte_workspace' folder with setup.* folders and a sandbox folder. Should /ros/ros-pkg have only setup.* or should I copy my fuerte folder from /opt ? Thanks so much for the help

JP gravatar image JP  ( 2013-08-01 10:53:03 -0500 )edit

Could anyone clarify what the row/ros-pkg should be? Thank you!

JP gravatar image JP  ( 2013-08-05 09:38:41 -0500 )edit

Thank you for all your comments!!

JP gravatar image JP  ( 2013-08-06 07:42:38 -0500 )edit

Just to check one more thing (I know Im being paranoid but want to check). When I echo my ROS_PACKAGE_PATH, my result is:/home/jay/fuerte_workspace/sandbox:/opt/ros/fuerte/stacks:/opt/ros/fuerte/share:/opt/ros/fuerte/share/ros ...

JP gravatar image JP  ( 2013-08-06 08:24:05 -0500 )edit

... The tutorial has: /home/your_user_name/fuerte_workspace/sandbox:/opt/ros/fuerte/share:/opt/ros/fuerte/stacks Does the order between ':' matter and why do I have the additional /opt/ros/fuerte/stacks ? Thanks!

JP gravatar image JP  ( 2013-08-06 08:24:55 -0500 )edit

Re-read the very first link for the answer to your first question. As to your second question: /opt/ros/fuerte/share/ros is a subdirectory of /opt/ros/fuerte/share. So your path is more specific than the tutorial's as to which directories to look in.

tbh gravatar image tbh  ( 2013-08-06 08:39:38 -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

2 followers

Stats

Asked: 2013-08-01 05:06:10 -0500

Seen: 6,345 times

Last updated: Aug 05 '13