问题:
roslaunch mrobot_description display_mrobot_chassis_urdf.launch
但是红色报错:
RLException: [display_mrobot_chassis_urdf.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
解决:
首先我认为打开终端的位置错了,原本在~/catkin_ws/src/ros_exploring-master/robot_mrobot/mrobot_description/launch打开的终端,于是到~/catkin_ws打开终端,再次执行了运行launch文件的指令,可以打开launch文件了,但是有报错和警告如下:
[WARN] [1721288956.380755]: The 'use_gui' parameter was specified, which is deprecated. We'll attempt to find and run the GUI, but if this fails you should install the 'joint_state_publisher_gui' package instead and run that. This backwards compatibility option will be removed in Noetic.
[ERROR] [1721288956.382017]: Could not find the GUI, install the 'joint_state_publisher_gui' package
[joint_state_publisher-2] process has died [pid 78660, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/hrj/.ros/log/3ab06ec8-44da-11ef-ae93-000c29b49a7a/joint_state_publisher-2.log].
log file: /home/hrj/.ros/log/3ab06ec8-44da-11ef-ae93-000c29b49a7a/joint_state_publisher-2*.log
================================================================================REQUIRED process [rviz-4] has died!
process has finished cleanly
log file: /home/hrj/.ros/log/3ab06ec8-44da-11ef-ae93-000c29b49a7a/rviz-4*.log
Initiating shutdown!
================================================================================
猜测是因为没有gui的package,于是安装:(这里melodic换成自己的版本!)
sudo apt-get install ros-melodic-joint-state-publisher-gui
就可以打开文件了,也有gui界面了,但是还有黄色警告。
在display_mrobot_chassis_urdf.launch这个文件中所有的joint_state_publisher用joint_state_publisher_gui替换掉,记得保存。警告也消失了!