一、安装问题

ROS安装时rosdep_init与rosdep_update问题解决方法

解决方法

使用下面的命令替代上面两行命令

1
2
3
4
sudo apt-get install python3-pip
sudo pip3 install rosdepc
sudo rosdepc init
rosdepc update

二、环境问题

Unable to find either executable ‘empy’ or Python module ‘em’… try installing the package ‘python3-empy’

(1)问题原因

Anaconda使用的是Python3版本,但是ROS使用的Python2

(2)解决方法 1:不使用 conda 环境

1
conda deactivate

(3)解决方法 2:如果需要使用 conda 环境

通过下面命令查看自己的 python 路径

1
2
ls /usr/bin/python*
ls /usr/include/python*
在工作空间目录下,设置 python 路径,告诉 ros 使用 python3 进行编译。`
1
catkin_make -DPYTHON_EXECUTABLE=/usr/bin/python3 -DPYTHON_INCLUDE_DIR=/usr/include/python3.7m

Could not find a package configuration file provided by “某某包” with any of the following names

(1)问题原因

缺少某某包

(2)解决方法

1
sudo apt-get install ros-noetic-某某包

三、配置问题

ERROR: cannot launch node of type [robot_state_publisher/state_publisher]: Cannot locate node of type [state_publisher] in package [robot_state_publisher]. Make sure file exists in package path and permission is set to executable (chmod +x)

(1)问题原因

使用launch文件启动某个节点时出现这个问题,是因为launch文件中name、pkg、type不统一导致的。

(2)解决方法

检查launch文件,确保name、pkg、type一样,例如:

1
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />

joint state publisher gui没有显示

(1)问题描述

使用ROS进行仿真,想用joint state publisher进行机械臂控制,但是启动launch文件后没有报错信息,但也没有joint state publisher gui。

(2)解决方法

2020年开始,gui已经移出了 joint state publisher, 并且成为了一个新的package:joint state publisher gui. 之前那种使用gui参数的方式调用joint state publisher 是仍然可行的,但是不会调用gui。

在launch文件中,将joint state publisher 替换成joint__state__publisher_gui。