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

问题描述:

ubuntu20.04在终端编译ros的工作空间时报错(找不到rospy、tf2等),报错如下图所示:


原因分析:

从报错提示来看,原因是缺少‘rospy’、‘tf2’等软件包。


解决方案:

因此我们通过以下指令对应安装相应的软件包即可。其中<distro>为我们对应的ROS版本,×××为软件包名。

$ sudo apt-get install ros-<distro>-×××

通过以下指令可查看我们的ROS版本。

$ rosparam get /rosdistro

例:

对于以上两个报错,在终端运行以下指令即可解决:

$ sudo apt-get install ros-noetic-rospy

$ sudo apt-get install ros-noetic-tf2*

猜你喜欢

转载自blog.csdn.net/liu520888/article/details/129132436