RLException: [xx.launch] is neither a launch file in package [x] nor is [x] a launch file name的解决方法

ROS学习过程中,遇到问题:RLException: [xx.launch] is neither a launch file in package [x] nor is [x] a launch file name

出现的问题:

在ROS学习中,进行工作区下编译的时候,突然报错,出现的错误如下

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

这种错误的出现,是因为坏境变量没有被添加!!!

解决方案

添加环境变量即可
添加环境变量的方法不唯一

这里介绍两种方法,两种方式各有优点

方法一

确保在建立工作空间的时候就已经执行catkin_make

直接在命令行,进入到工作空间,然后执行以下命令:

source ./devel/setup.bash

这种方式,可以直接在命令行中操作,短时间内是看着比较简单的。每次不确定的时候就可以直source一下。

方法二

直接对环境变量文件进行修改

  1. 在命令行打开文件./bashrc,命令如下:
sudo  gedit ~/.bashrc
  1. 在文件最后加入以下语句:
source ~/work_ws/devel/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/work_ws/

注意: 值得注意的是:这里的work_ws是我的ROS工作的路径,也就是你的ros的工作空间

  1. 重启bashrc,直接执行以下语句
source ~/.bashrc
  1. 查看ROS路径是否添加上
echo $ROS_PACKAGE_PATH

设置成功的话,就会直接显示添加的路径。
在这里插入图片描述

OVER!!!

根据引用和引用的信息,RLException: [wpb_simple.launch] is neither a launch file in package [wpr_simulation] nor is [wpr_simulation] a launch file name这个错误提示说明在包wpr_simulation中没有名为wpb_simple.launchlaunch文件,或者wpr_simulation不是一个有效的launch文件名。这可能是由于包中缺少了该launch文件,或者文件名填写错误导致的。 为了解决这个问题,你可以尝试以下几种方法: 1. 确认包wpr_simulation中是否存在名为wpb_simple.launch的文件。你可以使用ls命令在包的目录下查看所有的文件和文件夹,确保包含了你要使用的launch文件。 2. 如果确保包中存在该文件,那么可能是文件名填写错误导致的。你可以仔细检查launch文件的文件名是否与你在代码中调用的文件名一致,包括大小写和文件扩展名。 3. 如果你确定文件名正确,那么可能是包的路径设置有问题。你可以检查你的ROS环境变量和包路径设置,确保包wpr_simulation在ROS系统中能够被正确找到。 希望这些方法能够帮助你解决这个问题!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [RLException: [simple_launch] is neither a launch file in package [learning_launch] nor is [learning_](https://blog.csdn.net/qq_37788383/article/details/103701661)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [RLException: [xx.launch] is neither a launch file in package [x] nor is [x] a launch file name解决...](https://blog.csdn.net/qq_44164791/article/details/130351276)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值