Problem description
While Compiling dyn_small_obs_avoidance, catkin_make
report an error:
/home/xcs/catkin_ws_dyn/src/dyn_small_obs_avoidance/path_searching/src/kinodynamic_astar.cpp:919:61: error: ‘const class Eigen::ArrayWrapper<const Eigen::CwiseUnaryOp<Eigen::internal::scalar_multiple_op<double>, const Eigen::CwiseBinaryOp<Eigen::internal::scalar_difference_op<double>, const Eigen::Matrix<double, 3, 1>, const Eigen::Matrix<double, 3, 1> > > >’ has no member named ‘floor’
Vector3i idx = ((pt - origin_) * inv_resolution_).array().floor().cast<int>();
^~~~~
/home/xcs/catkin_ws_dyn/src/dyn_small_obs_avoidance/path_searching/src/kinodynamic_astar.cpp:919:74: error: expected primary-expression before ‘int’
Vector3i idx = ((pt - origin_) * inv_resolution_).array().floor().cast<int>();
dyn_small_obs_avoidance/path_searching/CMakeFiles/path_searching.dir/build.make:62: recipe for target 'dyn_small_obs_avoidance/path_searching/CMakeFiles/path_searching.dir/src/kinodynamic_astar.cpp.o' failed
make[2]: *** [dyn_small_obs_avoidance/path_searching/CMakeFiles/path_searching.dir/src/kinodynamic_astar.cpp.o] Error 1
CMakeFiles/Makefile2:1260: recipe for target 'dyn_small_obs_avoidance/path_searching/CMakeFiles/path_searching.dir/all' failed
make[1]: *** [dyn_small_obs_avoidance/path_searching/CMakeFiles/path_searching.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
Cause analysis:
By modifying the location where the error occurs, it is found that the error still exists, and the judgment error has nothing to do with the code itself
referring to other posts, I found that the previously installed version of eigen
is eigen3.2.1
, which may be too low
try upgrading the eigen
version.
Solution:
1. Uninstall the eigen
sudo updatedb
locate eigen3
sudo rm -rf /usr/include/eigen3 /usr/lib/cmake/eigen3 /usr/share/doc/libeigen3-dev /usr/share/pkgconfig/eigen3.pc /var/lib/dpkg/info/libeigen3-dev.list /var/lib/dpkg/info/libeigen3-dev.md5sums
2. Installation dependency
sudo apt-get install libopenblas-dev
sudo apt-get install --no-install-recommends libboost1.58-all-dev
sudo apt-get install libx11-dev
sudo apt-get install libgl1-mesa-dev
sudo apt-get install libglu1-mesa-dev
sudo apt-get install freeglut3-dev
sudo apt-get install doxygen
sudo apt-get install cmake
sudo wget https://nchc.dl.sourceforge.net/project/glew/glew/2.1.0/glew-2.1.0.tgz --no-check-certificate
sudo tar -xzvf glew-2.1.0.tgz
cd glew-2.1.0/
sudo make
sudo make install
sudo ldconfig -v
Some may not be installed. I will ignore them and continue with the following steps.
3. Download eigen3.3.7
, and extract it to the home directory
download address: eigen3.3.7
4. Installing eigen3.3.7
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig -v
5. Map the path of eigen3 to the /usr/include path.
sudo cp -r /usr/local/include/eigen3 /usr/include/eigen3
sudo ln -s /usr/include/eigen3/Eigen /usr/include/Eigen
6. Re-enter dyn_small_obs_avoidance
workspace catkin_make
, compiled successfully.
[ 79%] Building CXX object dyn_small_obs_avoidance/path_planning/CMakeFiles/goal_transform.dir/src/goalpoint_transformer.cpp.o
[ 81%] Building CXX object dyn_small_obs_avoidance/path_planning/CMakeFiles/path_planning_node.dir/src/path_planning.cpp.o
[ 93%] Built target livox_ros_driver_node
[ 95%] Linking CXX executable /home/xcs/catkin_ws_dyn/devel/lib/path_planning/goal_transform
[ 95%] Built target goal_transform
[ 97%] Linking CXX executable /home/xcs/catkin_ws_dyn/devel/lib/path_planning/path_planning_node
[ 97%] Built target path_planning_node
[100%] Linking CXX executable /home/xcs/catkin_ws_dyn/devel/lib/fast_lio/loam_laserMapping
Read More:
- [Solved] kalibr Compile Error: error: ‘Eigen::MatrixBase<Derived>::~Matrix
- How to Solve gtid master-slave replication connecting Issue
- How to Solve A-LOAM Ceres Version Error
- How to Solve Ubuntu20.04 Compile Error:error while loading shared libraries: libncurses.so.5
- linux(aarch64): How to Fix kettle Startup Error Issue
- [Realtek sdk-4.4.1] RTL8198D How to Fix pptp/l2tp HW checksum error issue
- How to Solve labelme Install Error in Ubuntu
- How to Solve “Error: source file could not be loaded“ [Ubuntu Use LibreOffice]
- [Solved] Linux error E: dpkg is broken, you must manually run ‘sudo dpkg –configure -a’ to resolve this issue
- How to Solve NPM Error: listen EADDRINUSE 127.0.0.1:8080
- Linux: How to Solve vim ~/.bashrc Execute Error
- How to Solve Roscore Run error [Install ROS]
- How to Solve Ubuntu “Failed to fetch” Error
- [Solved] rk3588_buildroot Compile Error: ERROR: Running build_kernel failed!
- How to Solve NPM Error 426 Upgrade Required
- mysqlclient in Ubuntu: How to Solve mysqlclient Install Error
- Linux: How to Solve sudo operate Error
- How to Solve Xmind Install Error in Ubuntu System
- Linux: How to Solve pyperclip Module Error
- How to Solve C++ Error: “no matching function for call to ‘atoi/atof’”