3. 跳转至

3. 开发环境配置#

旧版本用户须知

如果您目前是 V5.x.x 以下驱动版本的使用用户,请先联系技术支持团队获取升级方式。

新产品用户可以直接执行本文档教程操作。

上位机配置要求

  • 操作系统:Ubuntu 20.04 或更高版本
  • Python版本:Python 3.8 或更高版本(如果使用SDK则必需)
  • CPU: ≥ 4 核(推荐用于实时控制和仿真)
  • 显存:≥ 8 GB(推荐 ≥ 10 GB 以运行 pi0 算法推理,≥ 16 GB 以运行 DISCOVERSE 仿真器)
  • 存储空间:≥5GB可用磁盘空间用于操作系统、软件和数据
  • USB端口:确保有足够的USB端口以连接任何外部设备或外围设备(推荐大于 3 个USB端口以运行 ALOHA / Mobile ALOHA 算法)

3.1 软件安装与使用#

软件包请进入联络技术支持团队获取。解压后,您将看到以下软件包:

  • AIRBOT Play low level SDK airbot-hardware (.deb或.whl)

建议使用conda环境,若使用conda: - 创建conda环境:

conda create -n airbot python=3.12
- 且要保证pip路径正确:
which pip
输出如下路径:
/home/hunter/miniconda3/envs/airbot/bin/pip

初次安装须知

如果您初次使用hardware,需要按照以下指令安装can-utils。

    sudo apt update
    sudo apt install can-utils

3.1.1 C++#

3.1.1.1 系统环境#

编译器要求 : GCC版本需要高于9.4.0

系统依赖

sudo apt-get install libcap-dev

3.1.1.2 SDK安装与使用#

  1. 安装SDK包

    # 安装airbot_hardware开发包 请根据上位机内核版本、系统版本选择对应的whl包。
    sudo dpkg -i airbot_hardware_*.deb
    

  2. 配置开发环境

    # 在CMakeLists.txt中添加
    find_package(airbot_hardware REQUIRED)
    target_link_libraries(your_target airbot_hardware)
    

  3. 包含头文件

    #include "airbot_hardware/executors/executor.hpp"
    #include "airbot_hardware/handlers/arm.hpp"
    #include "airbot_hardware/handlers/motor.hpp"
    #include "airbot_hardware/handlers/eef.hpp"
    

3.1.2 Python#

Python版本要求:Python 3.8+

3.1.2.1 SDK安装与使用#

  1. 安装Python wheel包

    # 安装airbot_hardware开发包 请根据上位机内核版本、系统版本选择对应的whl包。
    pip install airbot_hardware_py-*.whl
    

  2. 导入模块

    import airbot_hardware_py as ah
    

3.1.3 ROS2#

该模块为 example/cpp 的 ROS2 接口实现,通过 ROS2 的话题(Topic)发布/订阅机制,可便捷控制 AirbotPlay 机械臂及其相关组件(E2、G2)。

3.1.3.1 依赖环境#

  • ROS2 Jazzy
  • airbot_hardware(硬件驱动)
  • boost 库

3.1.3.2 快速部署#

编译例程如下

cd example/ros2
colcon build --packages-select airbot_hardware_ros2

运行例程如下

# 加载环境变量
source install/setup.bash

# 运行指定例程(以 can0 为例)
ros2 run airbot_hardware_ros2 <例程名> --ros-args -p i:=can0

示例:运行位置速度控制例程

ros2 run airbot_hardware_ros2 airbot_play_pos_ctrl --ros-args -p i:=can0