您的位置:首页 > 编程语言 > Qt开发

(ros/qt报错) FATAL: ROS_MASTER_URI is not defined in the environment

2015-12-24 16:02 591 查看
安装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.


主要原因是因为没有从bash里面启动qt,所以qt的环境变量里面没有ros的变量环境.

解决办法,主要是从bash中启动qt,根本原因是要在ros环境变量执行之后再执行qt

我的解决办法是在.bashrc中添加如下语句

alias qt=/opt/Qt5/Tools/QtCreator/bin/qtcreator


设置了别名,每次启动qt从终端中启动qt,这样就能确保环境变量正确



author: wsh

email: tongzhuodenilove@163.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: