当前位置:网站首页>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
边栏推荐
- Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable
- I spent tens of thousands of dollars to learn and bring goods: I earned 3 yuan in three days, and the transaction depends on the bill
- leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]
- logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
- 网络socket的状态要怎么统计?
- AI matting tool
- Ansible的playbook
- [today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
- Compile and debug net6 source code
- Application of stack -- bracket matching problem
猜你喜欢

基于开源流批一体数据同步引擎 ChunJun 数据还原 —DDL 解析模块的实战分享

Chapter 14 signals (IV) - examples of multi process tasks
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series

codeforces -- 4B. Before an Exam

VM虚拟机配置动态ip和静态ip访问

第十四章 信号(四)- 多进程任务示例
![leetcode:241. Design priority for operation expression [DFS + Eval]](/img/d0/8dedeba7ecedccd25e0e3e96ff3362.png)
leetcode:241. Design priority for operation expression [DFS + Eval]

How can genetic testing help patients fight disease?

BIM and safety in road maintenance-buildSmart Spain

be based on. NETCORE development blog project starblog - (13) add friendship link function
随机推荐
codeforces -- 4B. Before an Exam
数据库之MHA高可用集群部署及故障切换
oracle cdc 数据传输时,clob类型字段,在update时值会丢失,update前有值,但
79. Word search [DFS + backtracking visit + traversal starting point]
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)
Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
Fundamentals of number theory and its code implementation
How to play with the reading and writing operations of blocking sockets?
木架的场景功能
Exploration and practice of inress in kubernetes
类的初始化与实例化
【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
Three stages of aho
redis探索之缓存击穿、缓存雪崩、缓存穿透
Topic 1004: the story of cows (recursion)
First intention is the most important
Stack-------
R language builds a binary classification model based on H2O package: using H2O GBM build gradient hoist model GBM, use H2O AUC value of AUC calculation model
GID: open vision proposes a comprehensive detection model knowledge distillation | CVPR 2021