当前位置:网站首页>ROS2 Foxy depthai_ros教程
ROS2 Foxy depthai_ros教程
2022-07-01 12:27:00 【OAK中国_官方】
编辑:OAK中国
首发:oakchina.cn
喜欢的话,请多多️
▌前言
Hello,大家好,这里是OAK中国,我是助手君。
我发现将OAK用在ROS上的朋友越来越多了,上周有个用户在我们群里提了在ROS2上使用的问题,现在我们depthai-ros的教程已经将ros1和ros2的使用更新了。
之前我们有出过ROS1上的教程(ROS上使用预编译的depthai C++ 库),本期内容就来说说在ROS2上如何编译depthai。
OAK相机在ROS2 Foxy编译depthai环境教程
本教程视频链接:B站-OAK中国
PS:内容全部来自OAK中国官网的使用教程,可能会不定期更新,最新内容请查看官网。
▌1.相关信息
平台:Ubuntu20.04(PC)
depthai版本:2.16.0
ROS版本:ROS2 Foxy
▌2.安装ROS2
设置语言环境
确保您有一个支持UTF-8,如果您处于最小环境中(例如 docker 容器),则语言环境可能是最小的,例如POSIX。我们使用以下设置进行测试。但是,如果您使用不同的 UTF-8 支持的语言环境,应该没问题。
locale # check for UTF-8
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF--ro8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settings
设置下载源
您需要将 ROS 2 apt 存储库添加到您的系统。首先,通过检查此命令的输出确保启用了Ubuntu Universe 存储库。
apt-cache policy | grep universe
这应该输出如下一行:
500 http://us.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
release v=20.04,o=Ubuntu,a=focal,n=focal,l=Ubuntu,c=universe,b=amd64
如果您没有看到像上面那样的输出行,请使用这些说明启用 Universe 存储库。
sudo apt install software-properties-common
sudo add-apt-repository universe
现在将 ROS 2 apt 存储库添加到您的系统。
sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
然后将存储库添加到您的源列表。
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http:/
设置存储库后更新您的 apt 存储库缓存。
sudo apt update
ROS 2 软件包建立在经常更新的 Ubuntu 系统上。始终建议您在安装新软件包之前确保您的系统是最新的。
sudo apt upgrade
安装ROS2 foxy
桌面安装(推荐):ROS、RViz、演示、教程。
sudo apt install ros-foxy-desktop
如果您没有安装 rosdep 且未初始化,请执行以下步骤:
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
▌3.设置depthai_ros
安装依赖
以下脚本将安装 depthai-core 并更新 USB 规则并安装 depthai
sudo wget -qO- https://raw.githubusercontent.com/luxonis/depthai-docs-website/master/source/_static/install_dependencies.sh | bash
sudo apt install ./depthai_2.16.0_amd64.deb
安装 vcstool
sudo apt install python3-vcstool
安装 opencv
sudo apt install libopencv-dev
安装 colcon
sudo apt install python3-colcon-common-extensions
设置程序
以下设置过程假设您的 cmake 版本 ≥3.10.2 和 OpenCV 版本 ≥ 4.0.0。我们选择 dai_ws 作为新文件夹的名称,因为它将是我们的 depthai ros 工作区。
mkdir -p dai_ws/src
cd dai_ws
wget https://raw.githubusercontent.com/luxonis/depthai-ros/main/underlay.repos
vcs import src < underlay.repos
source /opt/ros/foxy/setup.bash
rosdep install --from-paths src --ignore-src -r -y
colcon build
source install/setup.bash
执行示例
cd dai_ws
source install/setup.bash
ros2 launch depthai_examples stereo_inertial_node.launch.py
▌参考资料
https://docs.oakchina.cn/en/latest/
https://www.oakchina.cn/selection-guide/
OAK中国
| OpenCV AI Kit在中国区的官方代理商和技术服务商
| 追踪AI技术和产品新动态
戳「+关注」获取最新资讯
边栏推荐
- Use of easyexcel
- [datawhale202206] pytorch recommendation system: recall model DSSM & youtubednn
- Onenet Internet of things platform - create mqtts products and devices
- Onenet Internet of things platform - the console sends commands to mqtt product devices
- Typora adds watermarks to automatically uploaded pictures
- JPA and criteria API - select only specific columns - JPA & criteria API - select only specific columns
- What are the PHP FPM configuration parameters
- Onenet Internet of things platform - mqtts product equipment connected to the platform
- Share several tools for designing exquisite circuit diagrams
- 【20220605】文献翻译——虚拟现实中的可视化:一个系统的回顾
猜你喜欢
【语音信号处理】3语音信号可视化——prosody
手机便签应用
[20220605] Literature Translation -- visualization in virtual reality: a systematic review
BIM and safety in road maintenance-buildSmart Spain
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 5
队列的链式存储
顺序表有关操作
Machine learning - Data Science Library - day two
VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
被锡膏坑了一把
随机推荐
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
【MAUI】为 Label、Image 等控件添加点击事件
LeetCode力扣(剑指offer 31-35)31. 栈的压入弹出序列32I.II.III.从上到下打印二叉树33. 二叉搜索树的后序遍历序列34. 二叉树中和为某一值的路径35. 复杂链表的复制
Wechat applet reports an error: [rendering layer network layer error] pages/main/main Local resource pictures in wxss cannot be obtained through wxss. You can use network pictures, Base64, or < image/
Application of stack -- bracket matching problem
JPA and criteria API - select only specific columns - JPA & criteria API - select only specific columns
kubernetes之ingress探索实践
迅为i.MX8Mmini开发板离线构建Yocto系统
腾讯安全联合毕马威发布监管科技白皮书,解析“3+3”热点应用场景
Onenet Internet of things platform - mqtt product devices send messages to message queues MQ
Queue operation---
使用BurpSuite对app抓包教程
[20220605] Literature Translation -- visualization in virtual reality: a systematic review
Digital signal processing -- Design of linear phase (Ⅱ, Ⅳ) FIR filter (2)
[Yunju entrepreneurial foundation notes] Chapter 7 Entrepreneurial Resource test 4
Stack-------
腾讯安全发布《BOT管理白皮书》|解读BOT攻击,探索防护之道
[20211129] jupyter notebook remote server configuration
[datawhale202206] pytorch recommendation system: multi task learning esmm & MMOE
被锡膏坑了一把