安装使用ROS2中一些警告、报错与解决方法参考

  1. Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/ros2-latest.list:1 and /etc/apt/sources.list.d/ros2.list:1
    源重复,删掉其中一个即可

  2. cmake 报错:Cannot specify link libraries for target " XXX XXX " which is not built by this project.
    add_executable写在target_link_libraries的前面

  3. This warning is for project developers. Use -Wno-dev to suppress it.
    查阅官方文档:https://colcon.readthedocs.io/en/released/reference/verb/build.html?highlight=cmake#cmake-specific-arguments

colcon build --packages-select darknet_ros_msgs --cmake-args "-Wno-edv"
  1. Cannot generate a safe runtime search path for target
    darknet_ros_msgs__rosidl_typesupport_fastrtps_c__pyext because files in
    some directories may conflict with libraries in implicit directories:runtime library [libssl.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
    /home/kiki/anaconda3/lib
    runtime library [libcrypto.so.1.1] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
    /home/kiki/anaconda3/lib
    库冲突,不知道怎么指定路径,只能删除了anaconda里面的lib

  2. fatal error: darknet_ros_msgs/BoundingBox.h: No such file or directory
    #include “darknet_ros_msgs/BoundingBox.h”
    fatal error: darknet_ros_msgs/msg/BoundingBox.h: No such file or directory
    #include “darknet_ros_msgs/msg/BoundingBox.h”
    fatal error: darknet_ros_msgs/msg/BoundingBox.hpp: No such file or directory
    #include “darknet_ros_msgs/msg/BoundingBox.hpp”
    fatal error: darknet_ros_msgs/msg/boundingbox.hpp: No such file or directory
    #include “darknet_ros_msgs/msg/boundingbox.hpp”
    正确写法:darknet_ros_msgs/msg/bounding_box.hpp
    ros2中消息的头文件路径中多了一个/msg,且头文件全部为小写,且中间的大写字母前面要加下划线,数字不影响,比如box3d还是box3d

  3. WARNING:colcon.colcon_ros.prefix_path.ament:The path ‘/home/kiki/KalmanFusion/ros_ws/install/tutorial_interfaces’ in the environment variable AMENT_PREFIX_PATH doesn’t exist
    在AMENT_PREFIX_PATH中删除该路径

  4. warning: ‘KittiPublisher::count_’ will be initialized after [-Wreorder]
    size_t count_;
    ^~~~~~
    warning: when initialized here [-Wreorder]
    KittiPublisher():Node(“kitti_node”), count_(0), frame(0) {
    ^~~~~~~~~~~~~~
    析构函数中,初始化成员变量的顺序要与类声明中的变量顺序相对应,若不对应,则出现如题错误。解决方法就是按照顺序进行初始化。

  5. error: unable to find numeric literal operator ‘operator""ms’
    500ms, std::bind(&KittiPublisher::timer_callback, this));
    ^~~~~
    添加:using namespace std::chrono_literals;

  6. warning: ‘Ptr’ is deprecated
    ros2中使用的是SharedPtr,例如sensor_msgs::msg::Image::SharedPtr
    ros2中image的操作示范: https://blog.csdn.net/weixin_41003113/article/details/115522546

  7. /usr/bin/ld: warning: libopencv_imgcodecs.so.3.2, needed by /opt/ros/dashing/lib/libcv_bridge.so, may conflict with libopencv_imgcodecs.so.3.4
    /usr/bin/ld: warning: libopencv_imgproc.so.3.2, needed by /opt/ros/dashing/lib/libcv_bridge.so, may conflict with libopencv_imgproc.so.3.4
    /usr/bin/ld: warning: libopencv_core.so.3.2, needed by /opt/ros/dashing/lib/libcv_bridge.so, may conflict with libopencv_core.so.3.4
    版本冲突,不影响后续使用,待解决中

  8. — stderr: sensor_fusion
    ** WARNING ** io features related to ensenso will be disabled
    ** WARNING ** io features related to davidSDK will be disabled
    ** WARNING ** io features related to dssdk will be disabled
    ** WARNING ** io features related to pcap will be disabled
    ** WARNING ** io features related to png will be disabled
    ** WARNING ** io features related to libusb-1.0 will be disabled
    ** WARNING ** visualization features related to ensenso will be disabled
    ** WARNING ** visualization features related to davidSDK will be disabled
    ** WARNING ** visualization features related to dssdk will be disabled
    ** WARNING ** visualization features related to rssdk will be disabled
    不影响后续使用,待解决中

  9. 编译失败且未出现任何错误警告提示,对于明显的错误也未进行任何提示
    文件中有中文符号。

  10. undefined reference to `rosidl_message_type_support_t const* rosidl_typesupport_cpp::get_message_type_support_handle<visualization_msgs::msg::Marker_<std::allocator > >()’
    未显示line,是link错误,而不是compile错误,应检查CMakeLists和package。CMakeLists中find_package漏掉了visualization_msgs

  • 9
    点赞
  • 25
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值