(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.


主要原因是因为没有从bash里面启动qt,所以qt的环境变量里面没有ros的变量环境.
解决办法,主要是从bash中启动qt,根本原因是要在ros环境变量执行之后再执行qt

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

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


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



author: wsh

email: [email protected]

你可能感兴趣的:(ROS,qt5)