During the ROS learning process, I encountered a problem: RLException: [xx.launch] is neither a launch file in package [x] nor is [x] a launch file name
The problem that arises:
In ROS learning, when compiling under the workspace, an error is suddenly reported, and the error is as follows :
RLException: [racecar.launch] is neither a launch file in package [racecar_gazebo] nor is [racecar_gazebo] a launch file name
The traceback for the exception was written to the log file
This error occurs because the environment variable has not been added! ! !
solution
You can add environment variables to
add environment variables is not the only way
Here are two methods, both of which have their own advantages
method one
Make sure to execute it when creating the workspacecatkin_make
Directly on the command line, enter the workspace, and execute the following command:
source ./devel/setup.bash
In this way, you can directly operate on the command line, and it looks relatively simple in a short time. Straighten it out every time you're not sure source
.
Method Two
Modify the environment variable file directly
- Open the file ./bashrc on the command line, the command is as follows:
sudo gedit ~/.bashrc
- Add the following statement at the end of the file:
source ~/work_ws/devel/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/work_ws/
Note: It is worth noting that work_ws here is the path of my ROS work, which is your ros workspace
- Restart bashrc and directly execute the following statement
source ~/.bashrc
- Check if the ROS path is added
echo $ROS_PACKAGE_PATH
If the setting is successful, the added path will be displayed directly.
OVER!!!