What to do if ROS_PACKAGE_PATH is showing up blank?

asked 2019-09-26 17:51:30 -0500

asaw gravatar image

updated 2019-09-27 04:02:53 -0500

gvdhoorn gravatar image

When I try to run "roscore", I get an error saying:

Invalid <param> tag: Cannot load command parameter [rosversion]: command [rosversion roslaunch] returned with code [1]. 
Param xml is <param command="rosversion roslaunch" name="rosversion"/>

When I try the command: rosversion roslaunch, I get cannot locate [roslaunch].

I think the issue is that my ROS_PACKAGE_PATH is empty. When I type echo $ROS_PACKAGE_PATH it shows up empty. I've tried including it in my .bashrc file (adding export ROS_PACKAGE_PATH=/opt/ros/kinetic/share to my bashrc file) but this doesn't work either. When I manually type export ROS_PACKAGE_PATH=/opt/ros/kinetic/share, I am then able to start roscore. However, when I open up a new terminal I get the same original error.

edit retag flag offensive close merge delete


You shouldn't need to change your ROS_PACKAGE_PATH manually.

Just making sure: you run source /opt/ros/kinetic/setup.bash in each terminal that you open, or you have that line added to your .bashrc. Correct?

If not: that would be most likely the cause of your problems.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-27 04:03:49 -0500 )edit

To to be clear. have you re-run your .bashrc after modifying it, if not your changes will have no effect. You can so this either by opening a new terminal window or using the command source ~/.bashrc

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-09-27 05:36:28 -0500 )edit

All true, but manually modifying or setting ROS_PACKAGE_PATH is only needed in (very) rare circumstances.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-27 05:39:52 -0500 )edit

@gvdhoorn: Yes, I have that line in my bashrc. And yes, I re-ran my bashrc after modifying it so that’s not the issue. Any other ideas what the issue might be?

asaw gravatar image asaw  ( 2019-09-27 07:30:43 -0500 )edit

Please start by telling us much more than you do now. How did you install ROS (link to any tutorials/instructions used)? What is the output of lsb_release -a (assuming you are on a Debian-like OS)? And the output of uname -a?

I re-ran my bashrc after modifying

you cannot "run" your .bashrc. You have to source it. Or open a new terminal.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-27 07:34:12 -0500 )edit