ubuntu20.04 ad_with_lanelet2 编译问题解决

部署运行你感兴趣的模型镜像

参考链接

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>

您可能感兴趣的与本文相关的镜像

Python3.10

Python3.10

Conda
Python

Python 是一种高级、解释型、通用的编程语言,以其简洁易读的语法而闻名,适用于广泛的应用,包括Web开发、数据分析、人工智能和自动化脚本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值