• ROS报错:joint-state-publisher报错


    1. [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.
    2. [ERROR] [1664518996.208012]: Could not find the GUI, install the 'joint_state_publisher_gui' package
    3. [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].
    4. 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配置助手配置完一个机械臂后,进行检查看配置的正确性。

    出现关节空间发布者问题,关节空间状态会出错,其中图中标识处会标红。

     确定完问题,开始解决。

    1. "1.0"?>
    2. <launch>
    3. <arg name="limited" default="True" doc="If true, limits joint range (-PI, PI) on all joints." />
    4. <arg name="add_gripper" default="false" doc="If true, will load xarm5 with gripper from UFACTORY attached." />
    5. <arg name="joint_state_source" default="[/joint_states]" />
    6. <arg name="joint_state_publisher_gui" default="true" />
    7. <include file="$(find xarm_description)/launch/xarm7_upload.launch" >
    8. <arg name="limited" value="$(arg limited)"/>
    9. <arg name="add_gripper" value="$(arg add_gripper)" />
    10. include>
    11. <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">
    12. <param name="use_gui" value="$(arg joint_state_publisher_gui)"/>
    13. <rosparam param="source_list" subst_value="True">$(arg joint_state_source)rosparam>
    14. node>
    15. <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    16. <arg name="config" default="true" />
    17. <arg unless="$(arg config)" name="command_args" value="" />
    18. <arg if="$(arg config)" name="command_args" value="-d $(find xarm_description)/launch/display.rviz" />
    19. <node name="rviz" pkg="rviz" type="rviz" args="$(arg command_args)" output="screen"/>
    20. launch>

    解决:在这个位置,moveit!自动生成的一般都会出现这个问题,没有_gui,将其填上。

      <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">

    再次运行,仍会报错。

    1. ERROR: cannot launch node of type [joint_state_publisher_gui/joint_state_publisher_gui]: joint_state_publisher_gui
    2. ROS path [0]=/opt/ros/melodic/share/ros
    3. ROS path [1]=/home/rosmelodic/catkin_ws/src
    4. ROS path [2]=/opt/ros/melodic/share

    出现无法启动这个类型的节点,同时下面给出了ros_melodic根目录的路径。

    解决:安装需要的插件。

    sudo apt-get install ros-melodic-joint-state-publisher-gui
    

    再次运行。

    右侧为可以控制关节空间状态的插件,左侧是rviz在展示(display)机械臂,也正是这个launch文件的功能 。

  • 相关阅读:
    7.nginx常用功能模块
    ADRC自抗扰控制从Simulink仿真到PLC控制实现
    从零到一搭建基础架构(8)-业务服务接入基础架构
    ipad下载的文件在哪里可以找到
    一、第一个 MyBatis 程序(实现简单的曾删改查)
    learn C++ NO.4 ——类和对象(2)
    【SpringBoot框架篇】29.Jpa+vue实现单模型的低代码平台
    趣测系统搭建APP源码开发,娱乐丰富生活的选择!
    笔记-Python lambda
    24、京东只换不修服务,电脑经常蓝屏申请只换不休记录
  • 原文地址:https://blog.csdn.net/wzfafabga/article/details/127123248