(ros/qt报错) FATAL: ROS_MASTER_URI is not defined in the environment
安装qt之后,明明打开roscore但是qt运行跟ros有关的节点时报错:
[FATAL] [1450943695.306401842]: ROS_MASTER_URI is not defined in the environment. Either type the following or (preferrably) add this to your ~/.bashrc file in order set up your local machine as a ROS master:
export ROS_MASTER_URI=http://localhost:11311
then, type 'roscore' in another shell to actually launch the master program.
当用qt打开cmakelist时,出现找不到cantkin_make 也是这个原因, qt启动时,没有加载ros环境变量,所以必须从终端启动ros
Traceback (most recent call last):
File "/home/wsh/download_wsh_backup/IGV02-SW-build/catkin_generated/generate_cached_setup.py", line 20, in
from catkin.environment_cache import generate_environment_script
ImportError: No module named catkin.environment_cache
主要原因是因为没有从bash里面启动qt,所以qt的环境变量里面没有ros的变量环境.
解决办法,主要是从bash中启动qt,根本原因是要在ros环境变量执行之后再执行qt
我的解决办法是在.bashrc中添加如下语句
alias qt=/opt/Qt5/Tools/QtCreator/bin/qtcreator
设置了别名,每次启动qt从终端中启动qt,这样就能确保环境变量正确
【(ros/qt报错) FATAL: ROS_MASTER_URI is not defined in the environment】
文章图片
author: wsh
email: tongzhuodenilove@163.com
推荐阅读
- 接口|axios接口报错-参数类型错误解决
- 在珠海賞植物──【粉花夾竹桃】Rose|在珠海賞植物──【粉花夾竹桃】Rose oleander
- 打开Anaconda|打开Anaconda Navigator 时报错 error 5 拒绝访问
- 运行报错Cannot|运行报错Cannot find module '@babel/compat-data/corejs3-shipped-proposals’
- 故障分析 | MongoDB 5.0 报错 Illegal instruction 解决
- 被mybatis-generator-gui-0.6.1报错坑到的那些事(二)
- weex|weex run ios 报错 /bin/sh: pod: command not found 解决方案
- 伦敦市长萨迪克汗Crossrail受挫,转进准备引入租金管控。
- 使用yum命令报错File|使用yum命令报错File "/usr/bin/yum", line 30 except KeyboardInterrupt, e:
- git本地仓库推送到远程仓库报错