Package path not as explained

My script seemed to run when the directory was removed from the path. I got the error the lesson mentioned but the robot moved anyway.

Have I messed something up?

wow :astonished: but i have no answer :slight_smile:

Hello there!

First thing, can you explain more what you did before arriving to this state.

It looks like you did some changes (like delating your repo) but you didn’t rebuild the work space nor source. If it is the case, don’t forgot to always rebuild ansd source everytime you do any change in your workspace otherwise you won’t be able to see what you updated.

Hi @Droidling ,

According to your screenshot, the path to your catkin workspace packages is missing because it does not appear in the environment variable ROS_PACKAGE_PATH.
You can follow the instructions in section “3.4.3 Setting a variable with export” of the course to solve this problem and read for more details.
So my quick solution for this problem is just executing this command to add the path to the environment variable in your terminal before running the rosrun command:

export ROS_PACKAGE_PATH="/home/user/catkin_ws/src:/home/simulations/public_sim_ws/src:/opt/ros/kinetic/share"

I hope you would solve your problem with this solution.

Tung Ngo

Hi @Droidling,
According to your screenshot, you have more environment variables than what is shown in the course as an example.

As you can see here when you execute the following command: export | grep ROS in the course example there are seven environment variables that contain the character ROS, but in your screenshot there are the same seven environment variables but you have also four more. One more difference I found on your terminal is that on environment variable SELECTED_ROS_DISTRO=“noetic”. You sholud check if than your environment variable ROS_PACKAGE_PATH before export command
(export ROS_PACKAGE_PATH=“/home/user/catkin_ws/src:/home/simulations/public_sim_ws/src:/opt/ros/kinetic/share”)
had this shape ROS_PACKAGE_PATH=“/home/user/catkin_ws/src:/home/simulations/public_sim_ws/src:/opt/ros/noetic/share” instead of the one shown in the course example. In the course example they have kinetic instead of noetic. To sum up, you have extra environment variables that probably even after exporting wrong shape of ROS_PACKAGE_PACK make the script still run.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.