当前位置:网站首页>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
边栏推荐
- 题目 1004: 母牛的故事(递推)
- 79. Word search [DFS + backtracking visit + traversal starting point]
- 天青色等烟雨
- CS5268优势替代AG9321MCQ Typec多合一扩展坞方案
- There are still many things to be done in the second half of the year
- 下半年还有很多事要做
- When Sqlalchemy deletes records with foreign key constraints, the foreign key constraints do not work. What is the solution?
- Zero copy technology of MySQL
- Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable
- Localtime can't re-enter. It's a pit
猜你喜欢

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

Use Net core access wechat official account development

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

【邂逅Django】——(二)数据库配置

Sort out relevant contents of ansible

我选的热门专业,四年后成了“天坑”

logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
![[encounter Django] - (II) database configuration](/img/13/9512c1e03349092874055771c3433d.png)
[encounter Django] - (II) database configuration

Operator-1初识Operator
![[brain opening] west tide and going to the world series](/img/b2/444af296e170d19629800b3d4c50fa.jpg)
[brain opening] west tide and going to the world series
随机推荐
ROS2 Foxy depthai_ros教程
Blocking sockets的读写操作该怎么玩?
CPI tutorial - asynchronous interface creation and use
The popular major I chose became "Tiankeng" four years later
买卖其实也有风险
Ansi/ul 94 VTM vertical burning test for thin materials
数据库之MHA高可用集群部署及故障切换
Ansible相关内容梳理
ASTM D 3801 vertical burning test of solid plastics
Compile and debug net6 source code
数论基础及其代码实现
Efforts at the turn of the decade
腾讯总考epoll, 很烦
项目部署,一点也不难!
Eurake分区理解
Tencent security released the white paper on BOT Management | interpreting BOT attacks and exploring ways to protect
leetcode:329. 矩阵中的最长递增路径【dfs + cache + 无需回溯 + 优雅】
[today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
leetcode:226. 翻转二叉树【dfs翻转】
Quickly understand what the compressed list in redis is