[WARN] [1664518996.207303]: 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] [1664518996.208012]: Could not find the GUI, install the 'joint_state_publisher_gui' package
[joint_state_publisher-2] process has died [pid 45929, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_state_publisher __log:=/home/rosmelodic/.ros/log/5db3fa96-4088-11ed-89d6-000c2969e545/joint_state_publisher-2.log].
log file: /home/rosmelodic/.ros/log/5db3fa96-4088-11ed-89d6-000c2969e545/joint_state_publisher-2*.log
问题出现原因:
找到想要打开的launch文件,里面用到了一个关节状态的一个发布者。
roslaunch xarm_description xarm7_rviz_display.launch
这条命令打开的是一个演示文件,常常用来在moveit配置助手配置完一个机械臂后,进行检查看配置的正确性。
出现关节空间发布者问题,关节空间状态会出错,其中图中标识处会标红。
确定完问题,开始解决。
<?xml version="1.0"?>
<launch>
<!--test cmd: roslaunch xarm_description xarm7_rviz_test.launch limited:=true-->
<arg name="limited" default="True" doc="If true, limits joint range (-PI, PI) on all joints." />
<arg name="add_gripper" default="false" doc="If true, will load xarm5 with gripper from UFACTORY attached." />
<arg name="joint_state_source" default="[/joint_states]" />
<arg name="joint_state_publisher_gui" default="true" />
<include file="$(find xarm_description)/launch/xarm7_upload.launch" >
<arg name="limited" value="$(arg limited)"/>
<arg name="add_gripper" value="$(arg add_gripper)" />
</include>
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">
<param name="use_gui" value="$(arg joint_state_publisher_gui)"/>
<rosparam param="source_list" subst_value="True">$(arg joint_state_source)</rosparam>
</node>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<arg name="config" default="true" />
<arg unless="$(arg config)" name="command_args" value="" />
<arg if="$(arg config)" name="command_args" value="-d $(find xarm_description)/launch/display.rviz" />
<node name="rviz" pkg="rviz" type="rviz" args="$(arg command_args)" output="screen"/>
</launch>
解决:在这个位置,moveit!自动生成的一般都会出现这个问题,没有_gui,将其填上。
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">
再次运行,仍会报错。
ERROR: cannot launch node of type [joint_state_publisher_gui/joint_state_publisher_gui]: joint_state_publisher_gui
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/rosmelodic/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
出现无法启动这个类型的节点,同时下面给出了ros_melodic根目录的路径。
解决:安装需要的插件。
sudo apt-get install ros-melodic-joint-state-publisher-gui
再次运行。
右侧为可以控制关节空间状态的插件,左侧是rviz在展示(display)机械臂,也正是这个launch文件的功能 。