ROS报错解决记录

ROS报错解决记录

    • 1、`ResourceNotFound`
    • 2、Roboware新建python节点后在rosrun找不到该节点
    • 3、`joint_state_publisher_gui`


1、ResourceNotFound

问题:

raise ResourceNotFound(name, ros_paths=self._ros_paths)
ResourceNotFound: franka_description

解决方法:

sudo apt-get install ros-kinetic-franka-description

2、Roboware新建python节点后在rosrun找不到该节点

问题:
用 Roboware 新建 python 节点后在终端敲入rosrun后找不到功能包下新建的python节点,即 tab 不出来(已source)。

解决方法:
找不到节点的原因是因为 .py 文件没有执行权限(虽然我不知道为什么cpp文件不需要权限,感觉是因为python是解释性语言需要执行权限去执行,而 cpp 本身是不需要执行的,而是去编译链接)。

  1. cd 到新建 python 节点中的目录下。
  2. 给此新建的 python 文件添加执行权限。
    chmod a+x [python文件名].py
    

3、joint_state_publisher_gui

问题:


<launch>
  <arg name="gui" default="True" />
  <param name="robot_description" command="$(find xacro)/xacro --inorder $(find motion_planning)/urdf/ur5_ag95.urdf.xacro" />
  <param name="use_gui" value="$(arg gui)"/>
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find dh_description)/urdf/AG-95_hand.rviz" required="true"/>
launch>
[WARN] [1591580355.136441]: 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] [1591580355.136915]: Could not find the GUI, install the 'joint_state_publisher_gui' package

解决方法:

首先安装相应的包

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

然后将所有joint_state_publisher改为joint_state_publisher_gui,如下所示:


<launch>
  <arg name="gui" default="True" />
  <param name="robot_description" command="$(find xacro)/xacro --inorder $(find motion_planning)/urdf/ur5_ag95.urdf.xacro" />
  <param name="use_gui" value="$(arg gui)"/>
  <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find dh_description)/urdf/AG-95_hand.rviz" required="true"/>
launch>

注意:注释要全英文,否则会报错。


你可能感兴趣的:(ROS,Ubuntu问题)