在编译Fast-Planner过程中遇到了一些问题,因此记录一下。系统运行环境:Ubuntu20.04 ros-noetic。
1. 提示错误:
error: no match for ‘operator=’ (operand types are ‘Eigen::internal::enable_if<true, Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double> >::type’ {aka ‘Eigen::IndexedView<Eigen::Matrix<double, -1, -1>, double, double>’} and ‘double’)
212 | 2) * j * (j - 1) * (j - 2) * pow(ts, i + j - 5) / (i + j - 5);
| ^
.
.
.
make[2]: *** [Fast-Planner/fast_planner/poly_traj/CMakeFiles/poly_traj.dir/build.make:63:Fast-Planner/fast_planner/poly_traj/CMakeFiles/poly_traj.dir/src/polynomial_traj.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:3152:Fast-Planner/fast_planner/poly_traj/CMakeFiles/poly_traj.dir/all] 错误 2
make: *** [Makefile:141:all] 错误 2
Invoking "make -j2 -l2" failed
解决方法:1. 将for (double i = 3; i < order; i += 1) for (double j = 3; j < order; j += 1)
中的double 替换为 int (但是不知道后续是否会导致加加速度精度受到影响) 2. 将Eigen的版本替换为 3.3(经测试将原版本为Eigen3.4替换为Eigen3.3.7可以通过编译)
经过测试以上两种方法均可行。
https://github.com/HKUST-Aerial-Robotics/Fast-Planner/issues/92
2.提示错误:
fatal error: multi_map_server/MultiOccupancyGrid.h: 没有那个文件或目录
5 | #include <multi_map_server/MultiOccupancyGrid.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
解决方法:增加四个头文件放在/devel/include/multi_map_server/下
或放在/src/uav_simulator/Utils/multi_map_server/include/multi_map_server/下,具体可见https://blog.csdn.net/qq_42869979/article/details/120460405