当前位置:网站首页>ROS2 Foxy depthai_ ROS tutorial
ROS2 Foxy depthai_ ROS tutorial
2022-07-01 12:46:00 【Oak China_ official】
edit :OAK China
First episode :oakchina.cn
Like it , Please do more ️
▌ Preface
Hello, Hello everyone , Here is OAK China , I'm your assistant .
I found out that will OAK Use in ROS There are more and more friends on , Last week, a user mentioned in our group ROS2 Problems in the use of , Now we depthai-ros The tutorial for has ros1 and ros2 The use of has been updated .

We have been out before ROS1 The tutorial on (ROS Use precompiled on depthai C++ library ), In this issue, let's talk about ROS2 How to compile on depthai.
OAK The camera in ROS2 Foxy compile depthai Environmental tutorials
Link to this tutorial video :B standing -OAK China
PS: It's all from OAK China official website Use the tutorial , May be updated from time to time , Please check the official website for the latest content .
▌1. Related information
platform :Ubuntu20.04(PC)
depthai edition :2.16.0
ROS edition :ROS2 Foxy
▌2. install ROS2
Set up the language environment
Make sure you have a support UTF-8, If you are in the smallest environment ( for example docker Containers ), Then the language environment may be the smallest , for example POSIX. We use the following settings to test . however , If you use different UTF-8 Supported language environment , There should be no problem. .
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
Set download source
You need to ROS 2 apt Add a repository to your system . First , Check the output of this command to ensure that Ubuntu Universe The repository .
apt-cache policy | grep universe
This should output the following line :
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
If you don't see an output line like the one above , Please use these instructions to enable Universe The repository .
sudo apt install software-properties-common
sudo add-apt-repository universe
You will now ROS 2 apt Add a repository to your system .
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
Then add the repository to your source list .
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http:/
Update your... After setting up the repository apt Repository cache .
sudo apt update
ROS 2 Software packages are built on frequently updated Ubuntu On the system . It is always recommended that you make sure your system is up to date before installing new packages .
sudo apt upgrade
install ROS2 foxy
Desktop installation ( recommend ):ROS、RViz、 demonstration 、 course .
sudo apt install ros-foxy-desktop
If you have not installed rosdep And not initialized , Please perform the following steps :
sudo apt install python3-rosdep
sudo rosdep init
rosdep update
▌3. Set up depthai_ros
Installation dependency
The following script will install depthai-core And update the USB Rule and install 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
install vcstool
sudo apt install python3-vcstool
install opencv
sudo apt install libopencv-dev
install colcon
sudo apt install python3-colcon-common-extensions
Set up the program
The following setup procedure assumes that your cmake edition ≥3.10.2 and OpenCV edition ≥ 4.0.0. We choose dai_ws As the name of the new folder , Because it will be ours depthai ros work area .
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
Execute the sample
cd dai_ws
source install/setup.bash
ros2 launch depthai_examples stereo_inertial_node.launch.py
▌ Reference material
https://docs.oakchina.cn/en/latest/
https://www.oakchina.cn/selection-guide/
OAK China
| OpenCV AI Kit Official agents and technical service providers in China
| track AI New developments in technology and products
stamp 「+ Focus on 」 Get the latest information
边栏推荐
- leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]
- Zero copy technology of MySQL
- CPI教程-异步接口创建及使用
- VM虚拟机配置动态ip和静态ip访问
- 系统测试UI测试总结与问题(面试)
- Digital signal processing -- Design of linear phase (Ⅱ, Ⅳ) FIR filter (2)
- R语言基于h2o包构建二分类模型:使用h2o.gbm构建梯度提升机模型GBM、使用h2o.auc计算模型的AUC值
- kubernetes之ingress探索实践
- VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
- Ansible相关内容梳理
猜你喜欢

Ikvm of toolbox Net project new progress

Chapter 14 signals (IV) - examples of multi process tasks

VS Code 设置代码自动保存

79. 单词搜索【dfs + 回溯visit + 遍历起点】

Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable

logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable

王兴的无限游戏迎来“终极”一战

手机便签应用

How can genetic testing help patients fight disease?

VM虚拟机配置动态ip和静态ip访问
随机推荐
Topic 2612: the real topic of the 12th provincial competition of the Blue Bridge Cup in 2021 - the least weight (enumerating and finding rules + recursion)
Exploration and practice of inress in kubernetes
MHA high availability cluster deployment and failover of database
腾讯安全发布《BOT管理白皮书》|解读BOT攻击,探索防护之道
Run PowerShell script prompt "because running script is prohibited on this system" solution
be based on. NETCORE development blog project starblog - (13) add friendship link function
[brain opening] west tide and going to the world series
First intention is the most important
R language uses conf of yardstick package_ The mat function calculates the confusion matrix of the multiclass model on each fold of each cross validation (or resampling), and uses the summary to outpu
基因检测,如何帮助患者对抗疾病?
Teach you to complete the actual battle of image classification hand in hand -- Image Recognition Based on convolutional neural network
Wechat simulated geographical location_ Camouflage wechat location
Wang Xing's infinite game ushers in the "ultimate" battle
localtime居然不可重入,踩坑了
MySQL的零拷贝技术
类的初始化与实例化
用.Net Core接入微信公众号开发
Tencent Li Wei: deeply cultivate "regulatory technology" to escort the steady and long-term development of the digital economy
[20220605] Literature Translation -- visualization in virtual reality: a systematic review
[Maui] add click events for label, image and other controls