ubuntu18.04源码编译安装ros2

本教程为源码编译安装方式,发现了一个中文教程,结合实际改动优化一下
中文教程太香了,借鉴网站在此

1 下载源码过慢或失败

  • 说明:前面没啥问题,到创建工作空间并进行下载源码下图这两步,改一下
    在这里插入图片描述
  • 修改步骤
    1.先去官网ROS2界面,下载ros2.repos
    2.执行gedit ros2.repos,打开文件,把里面的https://github.com替换成https://github.com.cnpmjs.org
    3.执行vcs import src < ros2.repos
  • 成功的终端界面
    这个镜像下载挺快的,十分钟不到吧。
$ vcs import src < ros2.repos
........................................................................................
=== src/ament/ament_cmake (git) ===
Cloning into '.'...
=== src/ament/ament_index (git) ===
Cloning into '.'...
......
=== src/ros2/urdf (git) ===
Cloning into '.'...
=== src/ros2/urdfdom (git) ===
Cloning into '.'...
=== src/ros2/yaml_cpp_vendor (git) ===
Cloning into '.'...

2 rosdep安装依赖项

  • 说明:我在这一步没碰到什么问题,如果碰到了可以借鉴一下ubuntu18.04安装ros里第2节初始化rosdep
  • 成功
...
Preparing to unpack .../clang-tidy_1%3a6.0-41~exp5~ubuntu1_amd64.deb ...
Unpacking clang-tidy (1:6.0-41~exp5~ubuntu1) ...
Setting up clang-tidy-6.0 (1:6.0-1ubuntu2) ...
Setting up clang-tidy (1:6.0-41~exp5~ubuntu1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
#All required rosdeps installed successfully

3 colcon命令找不到

  • 安装一下
sudo apt install python3-colcon-common-extensions

编译挺慢的,要一个多小时。

...
Finished <<< rviz_default_plugins [28min 31s]
Starting >>> rviz2
Finished <<< rviz2 [24.6s]                                     
                                  
Summary: 270 packages finished [1h 39min 8s]
  70 packages had stderr output: ament_clang_format ament_clang_tidy ament_copyright ament_cppcheck ament_cpplint ament_flake8 ament_index_python ament_lint ament_lint_cmake ament_package ament_pclint ament_pep257 ament_pep8 ament_pyflakes ament_uncrustify ament_xmllint cyclonedds demo_nodes_py examples_rclpy_executors examples_rclpy_minimal_action_client examples_rclpy_minimal_action_server examples_rclpy_minimal_client examples_rclpy_minimal_publisher examples_rclpy_minimal_service examples_rclpy_minimal_subscriber launch launch_ros launch_testing launch_testing_ros osrf_pycommon quality_of_service_demo_py rmw_connext_cpp rmw_connext_shared_cpp rmw_opensplice_cpp ros1_bridge ros2action ros2bag ros2cli ros2component ros2launch ros2lifecycle ros2msg ros2multicast ros2node ros2param ros2pkg ros2run ros2service ros2srv ros2test ros2topic rosidl_runtime_py rosidl_typesupport_connext_c rosidl_typesupport_connext_cpp rosidl_typesupport_opensplice_c rosidl_typesupport_opensplice_cpp rqt rqt_action rqt_graph rqt_gui rqt_gui_py rqt_py_console rqt_service_caller rqt_shell rqt_srv rqt_top rqt_topic sros2 test_launch_ros topic_monitor
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值