鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    ROS1 移植到ROS2:如何用ros2 中colcon build 编译 ros中 catkin的功能包

    已定时 已固定 已锁定 已移动
    ROS 2相关问题
    ros2-humble catkinmake colcon build
    2
    3
    932
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • A
      曼森的林佳树甜甜甜
      最后由 编辑

      虚拟机:Ubuntu20.04
      ROS2: humble

      在移植livox_ros_driver(ROS1)功能包到ros2环境时,出现编译错误如下:
      [项目连接]( https://github.com/Livox-SDK/livox_ros_driver.git ws_livox/src)

      andrew@ros2:~/ws_livox$ colcon build
      Starting >>> livox_ros_driver
      --- stderr: livox_ros_driver
      CMake Error at CMakeLists.txt:25 (find_package):
        By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
        asked CMake to find a package configuration file provided by "catkin", but
        CMake did not find one.
      
        Could not find a package configuration file provided by "catkin" with any
        of the following names:
      
          catkinConfig.cmake
          catkin-config.cmake
      
        Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
        "catkin_DIR" to a directory containing one of the above files.  If "catkin"
        provides a separate development package or SDK, be sure it has been
        installed.
      
      
      ---
      Failed   <<< livox_ros_driver [0.09s, exited with code 1]
      
      Summary: 0 packages finished [0.29s]
        1 package failed: livox_ros_driver
        1 package had stderr output: livox_ros_driver
      

      查看功能包编译信息

      andrew@ros2:~$ colcon info
      path: ws_livox/src/livox_ros_driver
        type: ros.catkin
        name: livox_ros_driver
        dependencies:
          build: apr catkin git message_generation pcl_ros rosbag roscpp rospy sensor_msgs std_msgs
          run: apr git message_runtime pcl_ros rosbag roscpp rospy sensor_msgs std_msgs
        metadata:
          maintainers: ['Livox Dev Team <dev@livoxtech.com>']
          version: 2.0.0
      

      电脑中colcon工具版本信息:

      andrew@ros2:~$ colcon version-check
      /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
        warnings.warn(
      /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
        warnings.warn(
      colcon-argcomplete 0.3.3: up-to-date
      colcon-bash 0.4.2: up-to-date
      colcon-cd 0.1.1: up-to-date
      colcon-cmake 0.2.27: up-to-date
      colcon-core 0.12.0: newer version available (0.12.1)
      colcon-defaults 0.2.8: up-to-date
      colcon-devtools 0.2.3: up-to-date
      colcon-installed-package-information 0.1.0: up-to-date
      colcon-library-path 0.2.1: up-to-date
      colcon-metadata 0.2.5: up-to-date
      colcon-notification 0.2.15: up-to-date
      colcon-output 0.2.12: up-to-date
      colcon-override-check 0.0.1: up-to-date
      colcon-package-information 0.3.3: up-to-date
      colcon-package-selection 0.2.10: up-to-date
      colcon-parallel-executor 0.2.4: up-to-date
      colcon-pkg-config 0.1.0: up-to-date
      colcon-powershell 0.3.7: up-to-date
      colcon-python-setup-py 0.2.8: up-to-date
      colcon-recursive-crawl 0.2.1: up-to-date
      colcon-ros 0.3.23: up-to-date
      colcon-test-result 0.3.8: up-to-date
      colcon-zsh 0.4.0: up-to-date
      

      相关文章:
      Build catkin packages with colcon
      ROS2编译器colcon是个啥,比catkin好用吗?
      ROS 1 的迁移到ROS 2指南

      小鱼小 1 条回复 最后回复 回复 引用 0
      • 小鱼小
        小鱼 技术大佬 @andrew_liumuran
        最后由 编辑

        @andrew_liumuran 需要修改源码和cmakelists把catkin相关的更换成ament,,最好找厂家给个ros2的驱动

        新书配套视频:https://www.bilibili.com/video/BV1GW42197Ck/

        A 1 条回复 最后回复 回复 引用 0
        • A
          曼森的林佳树甜甜甜 @小鱼
          最后由 编辑

          @小鱼
          哈哈哈哈还是找ros2版本的驱动吧,太难修改啦!

          1 条回复 最后回复 回复 引用 0
          • 第一个帖子
            最后一个帖子
          皖ICP备16016415号-7
          Powered by NodeBB | 鱼香ROS