解决joint_state_publisher_gui-2] process has died

在进行ros仿真时在rviz中打开模型报错

[joint_state_publisher_gui-2] process has died [pid 6498, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher_gui/joint_state_publisher_gui __name:=joint_state_publisher_gui __log:=/home/cch/.ros/log/4dbf6d0e-60e1-11ed-ae2d-347df6e04dc7/joint_state_publisher_gui-2.log].
log file: /home/cch/.ros/log/4dbf6d0e-60e1-11ed-ae2d-347df6e04dc7/joint_state_publisher_gui-2*.log

解决方案
1.首先检查一下自己是否安装了joint-state-publisher-gui这个功能包,如果未安装则使用以下命令安装,注意自己的ros版本。

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

2.检查一下自己的urdf文件当中是否有注释,把urdf文件当中的注释都删掉。
3.检查自己的报错信息是否有ModuleNotFoundError: No module named ’ '

process[rviz-4]: started with pid [3824]
Traceback (most recent call last):
  File "/opt/ros/melodic/lib/joint_state_publisher_gui/joint_state_publisher_gui", line 39, in <module>
    import rospy
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/__init__.py", line 49, in <module>
    from .client import spin, myargv, init_node, \
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/client.py", line 52, in <module>
    import roslib
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in <module>
    from roslib.launcher import load_manifest  # noqa: F401
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in <module>
    import rospkg
ModuleNotFoundError: No module named 'rospkg'

这个问题是缺少必要的python包,可使用以下命令进行安装

pip install 包名

你可能感兴趣的:(教程,ubuntu,linux,python)