3

安装ROS Kinetic包(Ubuntu 16.04)时,即humanoid_navigation,执行catkin_make时报错。没有这个包,catkin_make 运行不会出错。一切都按照说明完成https://emanual.robotis.com/docs/en/platform/op3/recovery/#op3-manual-installation

[ 97%] Building CXX object humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o
/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Linking CXX executable /home/user/catkin_ws/devel/lib/footstep_planner/footstep_planner_node
[ 97%] Built target footstep_planner_node
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed

出现此错误后,在src中从github https://github.com/PointCloudLibrary/pcl安装pcl ,运行catkin make,报错

/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

请帮忙!

4

4 回答 4

0

问题是在 PCL 1.7.2 中,UniformSampling 位于“keypoints”模块中,而在 1.8.0 中,它已移至“filters”模块中。

请检查您的 PCL 版本

于 2021-09-22T13:32:49.573 回答
0

您最近是否终止/中断了任何构建?这可能是因为目标代码没有成功生成。一种方法是使用包清理 build 和 devel 文件夹的相关内容,然后再次构建。

更新!!!所以我复制了你的问题并按照我的步骤来解决它们。就我而言,我的 ros_control 包和 pcl 有问题。不是它有效。干杯!!!

[100%] Linking CXX executable 
/home/aadi/catkin_ws/devel/lib/robot_state_publisher/state_publisher
[100%] Built target joint_state_listener
[100%] Built target state_publisher
[100%] Built target robot_state_publisher
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
于 2021-03-24T12:18:17.900 回答
0

您可以尝试以下

cd ~/catkin_ws/src
wget https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.8.1.zip
unzip pcl-1.8.1.zip
cd pcl-pcl-1.8.1
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j4
sudo make install -j4
cd ~/catkin_ws && catkin_make

如果你之前已经安装了另一个 pcl 版本,进入这个库并输入

sudo make uninstall
make uninstall

然后删除此目录。

于 2021-11-23T13:56:44.343 回答
0

好的,我有一个可行的解决方案:

nano /home/<user>/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp

并更改为以下内容:

//#include <pcl/filters/uniform_sampling.h>
#include <pcl/keypoints/uniform_sampling.h>

然后去运行 catkin_make cd ~/catkin_ws && catkin_make

它现在应该可以正常工作了。

于 2021-11-23T15:05:22.110 回答