前提:运行$ roslaunch mrobot_description display_mrobot_chassis_urdf.launch
有误
错误1:rviz直接打不开
错误显示:
RLException: [display_mrobot_with_camera.launch] is neither a launch file in package [mrobot_description] nor is [mrobot_description] a launch file name The traceback for the exception was written to the log file
解决:
1.在终端先运行sudo gedit ~/.bashrc
2.然后在打开的文档最后添加source ~/catkin_ws/devel/setup.bash
和export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/catkin_ws/
3.在终端运行source ~/.bashrc
4.在终端运行echo $ROS_PACKAGE_PATH
可以在屏幕上看到你添加的路径
结果:可以打开但是显示如下
错误2:rviz中global status显示红色错误并在终端有错误提示
错误显示:
ERROR: cannot launch node of type [robot_state_publisher/state_publisher]: Cannot locate node of type [state_publisher] in package [robot_state_publisher]. Make sure file exists in package path and permission is set to executable (chmod +x)
解决:
type="state_publisher"
改为type=“robot_state_publisher”