Unitree ROS2 在 Ubuntu 20.04 下的安装与编译

准备工作

安装 Ubuntu20.04

apt 换源

ROS2 安装

  • 鱼香 ROS 一键安装

    1
    wget http://fishros.com/install -O fishros && . fishros
  • 除了换源其他的默认推荐选项

下载、编译unitree_ros2

  • 拉取源代码

    1
    git clone https://github.com/unitreerobotics/unitree_ros2

  • 下载cyclonedds依赖

    1
    2
    sudo apt install ros-foxy-rmw-cyclonedds-cpp
    sudo apt install ros-foxy-rosidl-generator-dds-idl

  • 用编译cyclonedds需要先摆脱ros自带的dds干扰

    1
    2
    sudo apt install gedit
    sudo gedit ~/.bashrc

    • 注释掉ros

      1
      # source /opt/ros/foxy/setup.bash 

  • 下载编译dds,colcon需要管理员权限

    1
    2
    3
    4
    5
    6
    cd ~/unitree_ros2/cyclonedds_ws/src
    git clone https://github.com/ros2/rmw_cyclonedds -b foxy
    git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
    cd ..
    su #进入管理员账号
    sudo colcon build --packages-select cyclonedds #Compile cyclone-dds package

  • 编译unitree源代码

    1
    2
    source /opt/ros/foxy/setup.bash # source ROS2 environment
    colcon build # Compile all packages in the workspace


Unitree ROS2 在 Ubuntu 20.04 下的安装与编译
https://www.yanjz.top/blog/unitree_ros2-installation-on-Ubuntu20.04/
作者
严嘉哲
发布于
2025年7月20日
许可协议