通过源码构建

Authors

HarryWen, Zhr

Contact

858601365@qq.com

Date

2022/09/1

Copyright

This document has been placed in the public domain.

概述

该文档阐述Bubble在Ubuntu20.04操作系统下的环境配置。环境配置包括:

  • ROS Galactic环境

  • hikrobot和Daheng工业相机驱动

  • Bubble运行时所需要的环境依赖

环境配置

git安装与ssh配置

Bubble的不同模块在不同的代码仓库中维护,我们使用vcs工具进行管理,在使用前请先进行必要的ssh配置。

git配置请参考参考gitlab官网中的 Installing Git

ssh配置请参考参考gitlab官网中的 Use SSH keys to communicate with GitLab

第三方库依赖与配置

Note

在Jetson平台上使用NumPy1.19以上版本实际测试会出现异常,请在opencv-python及scipy安装完成后手动对NumPy降级

sudo apt update
sudo apt install python3-pip
pip3 install pyserial=3.5
pip3 install opencv_python==4.5.1.48
pip3 install numpy==1.18.5
sudo apt-get install python3-scipy

ROS2安装与配置

ROS环境的配置请参阅 安装ROS2 。 当前版本的Bubble使用了Galactic版本的ROS环境。

如果不希望每次打开新 shell 时都进行source环境变量的操作,在终端中输入指令:

echo "source /opt/ros/galactic/setup.bash" >> ~/.bashrc

工业相机SDK配置

bubble_camera 模块中我们维护了海康工业相机和大恒工业相机的SDK,在使用Bubble前,请确认相关驱动被正确安装。

# 海康工业相机配置,相关sdk下载请参见https://www.hikrobotics.com/cn2/source/support/software/MVS_STD_GML_V2.1.2_220929.zip
sudo dpkg -i MVS-2.1.1_x86_64_20211224.deb

# 大恒工业相机配置,相关sdk下载请参见https://gb.daheng-imaging.com/CN/Software/Cameras/Linux/Galaxy_Linux-armhf_Gige-U3_32bits-64bits_1.4.2206.9161.tar.gz
sudo tar -xzvf  Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.2112.9071.tar.gz
cd Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.2112.9071/
./Galaxy_camera.run

VScode安装与使用

Note

若在Jetson平台上使用 JetPack SDK 5.0.x 版本作为开发环境,实际测试若不使用指定版本会出现异常,请下载和安装 1.65.2版本。

vscode安装

请根据架构选择对应的安装包

wget https://update.code.visualstudio.com/1.65.2/linux-deb-arm64/stable -O code_1.65.2_arm64.deb
sudo dpkg -i code_1.65.2_arm64.deb

检查Vscode版本

code --verbose

推荐拓展

为了方便Bubble项目的调试,我们推荐一下VsCode拓展:

  • IntelliCode

  • python

  • C/C++

  • C/C++ Extension Pack

  • CMake

  • CMake Language Support

  • CMake Tools

  • ROS

构建Bubble源码

git clone git@github.com:Birdiebot/bubble.git

# Install vcs tools
sudo apt-get install python3-vcstool
mkdir src

# Load source code
vcs import src < bubble.repos

# Build source code
colcon build --symlink-install