参考链接
https://blog.youkuaiyun.com/qq_35632833/article/details/112923613
相关依赖
sudo apt-get install ros-noetic-uuid-msgs
sudo apt-get install ros-noetic-tf2-geometry-msgs
sudo apt-get install ros-noetic-unique-id
还会提示缺少 mrt_cmake_modules
,下载链接:mrt_cmake_modules
下载完后放到 common
中
编译问题
In file included from /usr/include/boost/config.hpp:61:0,
from /usr/include/boost/math/tools/config.hpp:13,
from /usr/include/boost/math/special_functions/round.hpp:13,
from /opt/ros/kinetic/include/ros/time.h:58,
from /opt/ros/kinetic/include/ros/ros.h:38,
from /home/seivl/hd_ws/src/ad_with_lanelet2/planning/mission_planning/mission_planner/include/mission_planner/lanelet2_impl/mission_planner_lanelet2.h:21,
from /home/seivl/hd_ws/src/ad_with_lanelet2/planning/mission_planning/mission_planner/src/mission_planner_lanelet2/mission_planner_lanelet2.cpp:17:
/usr/include/boost/math/constants/constants.hpp: In static member function ‘static constexpr T boost::math::constants::detail::constant_half<T>::get(const mpl_::int_<5>&)’:
/usr/include/boost/math/constants/constants.hpp:277:3: error: unable to find numeric literal operator ‘operator""Q’
BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000e-01, "5.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-01")
^
/usr/include/boost/math/constants/constants.hpp:277:3: note: use -std=gnu++11 or -fext-numeric-literals to enable more built-in suffixes
/usr/include/boost/math/constants/constants.hpp: In static member function ‘static constexpr T boost::math::constants::detail::constant_third<T>::get(const mpl_::int_<5>&)’:
/usr/include/boost/math/constants/constants.hpp:278:3: error: unable to find numeric literal operator ‘operator""Q’
BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333e-01, "3.33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333e-01")
^
解决方案:
修改这些路径下的CMakeLists.txt 文件:
ad_with_lanelet2/map/lanelet2_extension
ad_with_lanelet2/planning/mission_planning/mission_planner
ad_with_lanelet2/map/util/lanelet2_map_preprocessor
ad_with_lanelet2/map/map_tf_generator
加入:
add_compile_options(-std=c++14)
#add_compile_options(-std=c++11)
#add_compile_options(-std=gnu++11)
add_compile_options(-fext-numeric-literals)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::routing::RoutingGraph::adjacentRight(lanelet::ConstLanelet const&, unsigned short) const'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::geometry::closestSegment(lanelet::ConstLineString3d const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::routing::RoutingGraph::left(lanelet::ConstLanelet const&, unsigned short) const'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::geometry::project(std::pair<Eigen::Matrix<double, 2, 1, 2, 2, 1>, Eigen::Matrix<double, 2, 1, 2, 2, 1> > const&, Eigen::Matrix<double, 2, 1, 2, 2, 1> const&)'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::geometry::closestSegment(lanelet::ConstLineString2d const&, Eigen::Matrix<double, 2, 1, 2, 2, 1> const&)'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::routing::RoutingGraph::besides(lanelet::ConstLanelet const&, unsigned short) const'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::geometry::project(std::pair<Eigen::Matrix<double, 3, 1, 0, 3, 1>, Eigen::Matrix<double, 3, 1, 0, 3, 1> > const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::routing::RoutingGraph::right(lanelet::ConstLanelet const&, unsigned short) const'
/usr/bin/ld: /home/xxxxx/cleancar_ws/devel/lib/liblanelet2_extension_lib.so: undefined reference to `lanelet::routing::RoutingGraph::adjacentLeft(lanelet::ConstLanelet const&, unsigned short) const'
collect2: error: ld returned 1 exit status
make[2]: *** [ad_with_lanelet2/map/map_loader/CMakeFiles/lanelet2_map_visualization.dir/build.make:273: /home/xxxxx/cleancar_ws/devel/lib/map_loader/lanelet2_map_visualization] Error 1
make[1]: *** [CMakeFiles/Makefile2:13930: ad_with_lanelet2/map/map_loader/CMakeFiles/lanelet2_map_visualization.dir/all] Error 2
解决方案:
sudo apt remove ros-noetic-lanelet2*
/home/xxx/cleancar_ws/src/ad_with_lanelet2/lanelet2_python/python_api/matching.cpp:33:10: fatal error: lanelet2_matching/LaneletMatching.h: No such file or directory
33 | #include <lanelet2_matching/LaneletMatching.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [ad_with_lanelet2/lanelet2_python/CMakeFiles/lanelet2_python-lanelet2-matching-pyapi.dir/build.make:63: ad_with_lanelet2/lanelet2_python/CMakeFiles/lanelet2_python-lanelet2-matching-pyapi.dir/python_api/matching.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:4278: ad_with_lanelet2/lanelet2_python/CMakeFiles/lanelet2_python-lanelet2-matching-pyapi.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
解决方案:ad_with_lanelet2/lanelet2_python文件下的package.xml文件中添加下面一行
<depend>lanelet2_matching</depend>