Deploying T265 in Ubuntu20.04 (PX4_VIO)

2023-05-16

Release
转载请注明出处https://blog.csdn.net/qq_46037020/article/details/123203784

该文章的中文为个人经验总结与提示,英文部分为资料原文摘抄引用,便于在 Reference Links 中定位并阅读

SLAM: Simultaneous Localization and Mapping
VIO: Visual Inertial Odometry


QGC Paramete Setting

CBRK_IO_SAFETY22027
MAV_1_CONFIGTELEM 2
MAV_1_MODEOnboard
SER_TEL2_BAUD921600 8N1
EKF2_AID_MASK24
EKF2_HGT_MODEVision
MAV_ODOM_LP1
MPC_XY_VEL_MAX2.24mph
MPC_Z_VEL_MAX_DN2.24mph
MPC_Z_VEL_MAX_UP2.24mph

如果一开始找不到MAV_1_MODE和SER_TEL2_BAUD,就先设置MAV_1_CONFIG再reboot飞控(请熟悉并掌握QGC地面站的使用)

波特率设置会受到usb转ttl芯片的性能和接线长度影响,导致mavros与飞控传输失败,这个时候可以把921600调低,再验证配置是否正确

PID Setting:

  • in Paramete Setting :
    Multicopter Attitude Control
    Multicopter Position Control
    Multicopter Rate Control

OR you can use

PID Tuning


PX4 Firmware

在飞控的sd卡的根目录下创建/etc/extras.txt,写入

mavlink stream -d /dev/ttyUSB3 -s ATTITUDE_QUATERNION -r 200
mavlink stream -d /dev/ttyUSB3 -s HIGHRES_IMU -r 200

之后记得映射为物理地址


机载电脑Ubuntu20.04的安装

镜像站地址:http://mirrors.aliyun.com/ubuntu-releases/20.04/ 下载 ubuntu-20.04.4-desktop-amd64.iso
烧录软件UltraISO官网:https://cn.ultraiso.net/
分区设置:
    EFI系统分区(主分区)512M
    交换空间(逻辑分区)8192M(根据实际内存大小的两倍即可)
    挂载点/(主分区)剩余所有容量

机载电脑安装 Ros Noetic

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

Librealsense

Realsense SDK2.0 Linux Distribution

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE

sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u

sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils
sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg

//sudo apt-get install librealsense2-dkms && sudo apt-get install librealsense2-utils && sudo apt-get install librealsense2-dev && sudo apt-get install librealsense2-dbg

//test
realsense-viewer	//using USB 3.0

Realsense-Ros

ROS Wrapper for Intel® RealSense™ Devices
These are packages for using Intel RealSense cameras (D400 series SR300 camera and T265 Tracking Module) with ROS.

2 sources to install realsense2_camera

If you have installed Realsense SDK, Method 1 is OK.

Method 1: The ROS distribution:

realsense2_camera is available as a debian package of ROS distribution. It can be installed by typing:

sudo apt-get install ros-noetic-realsense2-camera

This will install both realsense2_camera and its dependents, including librealsense2 library and matching udev-rules.

Notice:

  • The version of librealsense2 is almost always behind the one availeable in RealSense™ official repository.
  • librealsense2 is not built to use native v4l2 driver but the less stable RS-USB protocol. That is because the last is more general and operational on a larger variety of platforms.
  • realsense2_description is available as a separate debian package of ROS distribution. It includes the 3D-models of the devices and is necessary for running launch files that include these models (i.e. rs_d435_camera_with_model.launch). It can be installed by typing:
    • sudo apt-get install ros-$ROS_DISTRO-realsense2-description
      

Method 2: The RealSense™ distribution:

This option is demonstrated in the .travis.yml file. It basically summerize the elaborate instructions in the following 2 steps:

Step 1: Install the latest Intel® RealSense™ SDK 2.0

Install librealsense2 debian package:

  • Jetson users - use the Jetson Installation Guide

  • Otherwise, install from Linux Debian Installation Guide

    • In that case treat yourself as a developer. Make sure you follow the instructions to also install librealsense2-dev and librealsense2-dkms packages.

OR
Build Intel® RealSense™ SDK 2.0 from sources

Step 2. Install Intel® RealSense™ ROS from Source

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src/

Clone the latest Intel® RealSense™ ROS from here into ‘catkin_ws/src/’

git clone https://github.com/IntelRealSense/realsense-ros.git
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^2.\d+\.\d+" | tail -1`
cd ..
  • Make sure all dependent packages are installed. You can check .travis.yml file for reference.
  • Specifically, make sure that the ros package ddynamic_reconfigure is installed. If ddynamic_reconfigure cannot be installed using APT or if you are using Windows you may clone it into your workspace ‘catkin_ws/src/’ from here
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

Using T265

Start the camera node

To start the camera node in ROS:

roslaunch realsense2_camera rs_t265.launch

This will stream all camera sensors and publish on the appropriate ROS topics.

The T265 sets its usb unique ID during initialization and without this parameter it wont be found. Once running it will publish, among others, the following topics:

/camera/odom/sample
/camera/accel/sample
/camera/gyro/sample
/camera/fisheye1/image_raw
/camera/fisheye2/image_raw

To visualize the pose output and frames in RViz, start:

roslaunch realsense2_camera demo_t265.launch

About Frame ID

The wrapper publishes static transformations(TFs). The Frame Ids are divided into 3 groups:

  • ROS convention frames: follow the format of <tf_prefix>_<_stream>“_frame” for example: camera_depth_frame, camera_infra1_frame, etc.
  • Original frame coordinate system: with the suffix of <_optical_frame>. For example: camera_infra1_optical_frame. Check the device documentation for specific coordinate system for each stream.
  • base_link: For example: camera_link. A reference frame for the device. In D400 series and SR300 it is the depth frame. In T265, the pose frame.

realsense2_description package:

For viewing included models, a separate package is included. For example:

roslaunch realsense2_description view_d415_model.launch

Unit tests:

Unit-tests are based on bag files saved on S3 server. These can be downloaded using the following commands:

cd catkin_ws
wget "https://librealsense.intel.com/rs-tests/TestData/outdoors.bag" -P "records/"
wget "https://librealsense.intel.com/rs-tests/D435i_Depth_and_IMU_Stands_still.bag" -P "records/"

Then, unit-tests can be run using the following command (use either python or python3):

python src/realsense/realsense2_camera/scripts/rs2_test.py --all

MAVROS

mavros is a ROS (1) package that enables MAVLink extendable communication between computers running ROS (1) for any MAVLink enabled autopilot, ground station, or peripheral. MAVROS is the “official” supported bridge between ROS (1) and the MAVLink protocol.

mavros (noetic) - 1.13.0-1

official installation guide

sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
cd /opt/ros/noetic/lib/mavros
sudo ./install_geographiclib_datasets.sh

.....
ROS 2

sudo chmod 777 /dev/ttyUSB3
sudo nano /opt/ros/noetic/share/mavros/launch/px4.launch

//*****************
/CHANGE/

<arg name="fcu_url" default="/dev/ttyACM0:57600" />

/TO/

<arg name="fcu_url" default="/dev/ttyUSB3:921600" />
*****************//

VIOVision_to_mavros

用于坐标转换发送节点信息,分别是 PX4官方 / APM官方,任选

VIO

catkin_tools first

sudo apt install python3-catkin-tools

/***OR build from source***/
git clone https://github.com/catkin/catkin_tools.git
cd catkin_tools
sudo apt install python3-pip
pip3 install -r requirements.txt --upgrade
python3 setup.py install --record install_manifest.txt

remember use rm_ws

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/Auterion/VIO.git
cd ~/catkin_ws
catkin build px4_realsense_bridge
source ~/catkin_ws/devel/setup.bash
roslaunch px4_realsense_bridge bridge_mavros.launch
nano ~/catkin_ws/src/VIO/launch/bridge_mavros.launch

/*****************Change default
  <arg name="fcu_url" default="udp://:14540@localhost:14557"/>
******************/

/**To
/dev/ttyUSB3:921600
**/

Vision_to_mavros

cd ~/catkin_ws/src
git clone https://github.com/hoangthien94/vision_to_mavros.git
/*************local to server
scp -r ./vision_to_mavros/ dynamicx@10.42.0.151:~/catkin_ws/src/vision_to_mavros
*************/
cd ..
catkin build vision_to_mavros
source ~/.bashrc
nano ~/catkin_ws/src/vision_to_mavros/launch/t265_all_nodes.launch

/********change apm to px4
<include file="$(find mavros)/launch/px4.launch"/>
*********/


//cam_pose
nano ~/catkin_ws/src/vision_to_mavros/launch/t265_tf_to_mavros.launch

/************

************/

After all

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

Camera Pose

在这里插入图片描述Here’s for VIO.

Configure the camera orientation if needed:

The VIO bridge doesn’t require any configuration if the camera is mounted with the lenses facing down (the default).
For any other orientation modify bridge.launchin the section below:

<node pkg="tf" type="static_transform_publisher" name="tf_baseLink_cameraPose"
	args="0 0 0 0 1.5708 0 base_link camera_pose_frame 1000"/>

This is a static transform that links the camera ROS frame camera_pose_frame to the mavros drone frame base_link.

the first three args specify translation x,y,z in metres from the center of flight controller to camera. For example, if the camera is 10cm in front of the controller and 4cm up, the first three numbers would be : [0.1, 0, 0.04,…]
the next three args specify rotation in radians (yaw, pitch, roll). So [… 0, 1.5708, 0] means pitch down by 90deg (facing the ground). Facing straight forward would be [… 0 0 0].

yaw pitch roll

nano ~/catkin_ws/src/VIO/launch/bridge.launch

0 0 0 0 0 0			//Facing straight forward
0 0 0 0 0 3.1416	//
0.1 0 -0.12 0 0.7853981 0	//45 degree down

0.370 0 -0.030 0 0.7853981 0	//DX
rostopic echo /tf

/***********vision_to_mavros
rostopic echo /mavros/vison_pose/pose
***********/

check odometer pose
3D Rotation Converter


Permanent USB authority

whoami	//check username
sudo usermod -aG dialout <username>
//Logout and Login

Check Everything

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
/**********************************************/

roslaunch realsense2_camera demo_t265.launch
/***********************************************/

roslaunch mavros px4.launch
/***********************************************/

Now Enjoy

roslaunch px4_realsense_bridge bridge_mavros.launch

Reference Links

Pixhawk4+Up Board / NUC Implement VIO By Deploying T265

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Deploying T265 in Ubuntu20.04 (PX4_VIO) 的相关文章

  • PX4模块设计之十七:ModuleBase模块

    PX4模块设计之十七 xff1a ModuleBase模块 1 ModuleBase模块介绍2 ModuleBase类介绍3 ModuleBase类功能介绍3 1 模块入口3 2 模块启动3 3 模块停止3 4 状态查询3 5 任务回调3
  • PX4模块设计之二十一:uORB消息管理模块

    PX4模块设计之二十一 xff1a uORB消息管理模块 1 uORB模块构建模式2 uORB消息管理函数2 1 状态查询2 2 资源利用2 3 模块启动2 4 模块停止3 uORB消息接口3 1 消息主题注册3 2 消息主题去注册3 3
  • PX4模块设计之二十三:自定义FlightTask

    PX4模块设计之二十三 xff1a 自定义FlightTask Step1 创建飞行模式文件夹Step2 创建飞行模式源代码和CMakeLists txt文件Step3 更新CMakeLists txt文件Step4 更新FlightTas
  • PX4模块设计之三十一:ManualControl模块

    PX4模块设计之三十一 xff1a ManualControl模块 1 ManualControl模块简介2 模块入口函数2 1 主入口manual control main2 2 自定义子命令custom command 3 Manual
  • PX4模块设计之三十六:MulticopterPositionControl模块

    PX4模块设计之三十六 xff1a MulticopterPositionControl模块 1 MulticopterPositionControl模块简介2 模块入口函数2 1 主入口mc pos control main2 2 自定义
  • PX4模块设计之四十六:dataman模块

    PX4模块设计之四十六 xff1a dataman模块 1 dataman模块简介2 模块入口函数dataman main3 dataman模块重要函数3 1 start3 2 stop3 3 status3 4 task main 4 A
  • 【px4】运行mavsdk中的offboard example

    运行MAVSDK中的offboard例子时无人机不执行 想控制无人机前后左右移动 xff0c 在按照官方教程实现offboard 插件的时候 发现用action插件能正常起飞和降落 但是一旦执行到offboard的插件代码的时候就会自动降落
  • Ubuntu20.04跑VINS-fusion

    Ubuntu20 04跑VINS Fusion 使用docker 由于工程较大 xff0c 依赖较多 xff0c 环境配置十分繁琐 xff0c 故使用docker环境来运行VINS Fusion Docker 可以让开发者打包他们的应用以及
  • ubuntu20.04安装ROS【详细】

    Ubuntu20 04安装ROS与Ubuntu18 04大差不差 xff0c 安装过程基本没出现问题 按以下教程操作即可 一 更换源 xff1a 1 备份源文件 sudo cp etc apt sources list etc apt so
  • ubuntu20.04安装arduino IDE(亲测可用)

    步骤一 xff1a 在官网下载arduino安装包选择相应的版本 下载链接 步骤二 xff1a 解压下载的安装包在相应的目录下执行下面语句 tar xvf 安装包名 步骤三 xff1a 将解压后的安装包移动到 opt目录下 sudo mv
  • 解决ubuntu20.04虚拟机无法上网的问题

    64 linux虚拟机无法正常上网 前言 刚建立好的linux虚拟机使用NAT方式可以连接外网 xff0c 系统重启几次 xff0c 系统无法上网 xff0c 这是什么问题导致的呢 xff1f 提示 xff1a 以下是本篇文章正文内容 xf
  • PX4中自定义MAVLink消息(记录)

    简单记录一下这个过程 一 自定义uORB消息 这一步比较简单 xff0c 首先在msg 中新建ca trajectory msg文件 uint64 timestamp time since system start span class t
  • PX4飞控的PPM接收机

    xff08 一 xff09 原理图 xff1a PX4飞控的PPM输入捕获由协处理器完成 xff0c 接在A8引脚 xff0c 对应Timer1的通道1 xff08 二 xff09 PPM协议 xff1a PPM的每一帧数据间隔为20ms
  • 步骤三:PX4,Mavros的下载安装及代码测试

    1 安装Mavros sudo apt install ros melodic mavros ros melodic mavros extras 2 安装Mavros相关的 geographiclib dataset 此处已经加了ghpro
  • ros2话题的发布者和订阅者——ubuntu20.04+自定义话题接口类型

    文章目录 话题的发布者话题的订阅者自定义话题的接口类型将自定义的话题引入到程序中 话题的发布者 导入消息类型 xff0c ros自带的消息类型在std msgs msg 下面 xff0c 有string等类型定义一个类 xff0c 里面声明
  • PX4通过参数脚本给飞控导入参数

    PX4通过参数脚本给飞控导入参数 先找一架正常能飞的无人机连接地面站 在参数页面右上角点击工具 gt 保存到文件 保存的时候文件名注明参数的相关信息 然后将需要加载参数的无人机连接至地面站 xff0c 注意需要加载参数的无人机必须和保存的参
  • 树莓派4B ubuntu20.04 安装ROS noetic和opencv记录

    文章目录 准备换源安装ROS一些遇到的坑连接wifi添加秘钥时出错 E could not get lock var lib apt list catkin make时出现错误 Could not find the required com
  • ubuntu20.04 安装 WPS 2019

    ubuntu自带的文字处理软件对来自windows下office或在WPS创建的ppt有点不兼容 xff0c 看到WPS有linux版本的 xff0c 便果断安装试一试 一 卸载原生liboffice sudo apt get remove
  • Docker使用系列——Docker安装(Ubuntu20.04)

    Docker使用系列 Docker安装 xff08 Ubuntu20 04 xff09 卸载安装测试问题 直接按官方安装教程即可 xff1a Install Docker Engine on Ubuntu 卸载 安装过老版本的Docker则
  • 飞行姿态解算(三)

    继之前研究了一些飞行姿态理论方面的问题后 又找到了之前很流行的一段外国大神写的代码 来分析分析 第二篇文章的最后 讲到了文章中的算法在实际使用中有重大缺陷 大家都知道 分析算法理论的时候很多情况下我们没有考虑太多外界干扰的情况 原因是很多情

随机推荐

  • vins概述

    基本框架如上 xff0c VINS的功能模块可包括五个部分 xff1a 数据预处理 初始化 后端非线性优化 闭环检测及闭环优化 代码中主要开启了四个线程 xff0c 分别是 xff1a 前端图像跟踪 后端非线性优化 xff08 其中初始化和
  • 软件项目管理总结(全)

    软件项目管理知识综述 第一章知识总结 软件项目管理的作用和重要性 项目管理就是将知识 技能 工具与技术应用于项目活动 xff0c 以满足项目的要求 项目管理通过合理 运用与整合特定项目所需的项目管理过程得以实现 项目管理使组织能够有效且高效
  • FreeRTOS 的任务调度方式和具体任务是怎么切换的

    FreeRTOS操作系统主要是两种任务调度方式 xff1a 抢占式调度 每个任务都有不同的优先级 xff0c 任务会一直运行直到被高优先级任务抢占或者遇到阻塞式的 API 函数 xff0c 比如 vTaskDelay 时间片调度 每个任务都
  • linux/UNIX中如何使用fork函数调用exec函数族,实现子进程做特定操作

    前言 在 Unix Linux 操作系统中 xff0c 进程是一种非常重要的概念 进程是程序执行的实例 xff0c 操作系统会为每个进程分配资源 xff0c 进程之间相互独立 xff0c 可以进行通信 在 Unix Linux 中 xff0
  • Opencv学习----矩阵操作-基本操作

    5 1 基本操作 cv absdiff InputArray src1 InputArray src2 OutputArray dst 计算两个数组之间或数组与标量之间的每元素绝对差值 注意 当阵列具有深度CV 32S时 xff0c 不应用
  • 【Linux】实验报告2 Linux基础命令

    作者 xff5c Ricky 水果摊 时间 xff5c 2022年6月27日 文章目录 实验目的实验原理1 Linux文件系统2 Linux存储位置常用命令存放位置头文件存放位置 3 Linux常用命令路径目录文件 实验内容1 Linux常
  • 【Linux】实验报告3 vi、gcc 和 gdb 的使用

    实验三 编辑器 vi 编译器 gcc 和调试器 gdb 的使用 文章目录 实验三 编辑器 vi 编译器 gcc 和调试器 gdb 的使用实验目的实验原理1 vi和vim简介1 1 vi1 2 vim 2 vi的三种工作模式2 1 命令模式
  • 【Linux】实验报告8 Linux文件系统

    作者 xff5c Ricky的水果摊 时间 xff5c 2022年7月6日 文章目录 实验目的实验内容1 文件信息命令2 基本的命令行文件管理3 文件系统权限操作 实验目的 使用 控制字符 执行特殊功能 xff1b 使用 file 和 st
  • 【Java】学习日记 Day16

    作者 xff5c Ricky 水果摊 时间 xff5c 2022年7月21日 x1f308 今日知识点总结 方法重载 xff08 Overload xff09 1 方法重载的定义 方法重载 是指 Java 允许在同一个类中 xff0c 定义
  • 【信息奥赛题解】昆虫繁殖(详细分析题解 & C++ 代码)

    昆虫繁殖问题 x1f31f 题目名称 昆虫繁殖 题目描述 科学家在热带森林中发现了一种特殊的昆虫 xff0c 这种昆虫的繁殖能力很强 每对成虫过 X X X 个月后开始产卵 xff0c 每月产 Y Y
  • 【期末指北】嵌入式系统——选择题(feat. ChatGPT)

    作者 xff5c Ricky 水果摊 时间 xff5c 2023年2月20日 基本信息 本博客摘录了一些 嵌入式系统 的 常见选择题 xff0c 供有需求的同学们学习使用 部分答案解析由 ChatGPT 生成 xff0c 博主进行审核 使用
  • GPT-4 终问世!旧王已死,新王当立!面对AI,人类真的准备好了吗?

    GPT 4 终问世 xff01 旧王已死 xff0c 新王当立 xff01 面对AI xff0c 人类真的准备好了吗 xff1f 摊主一大早醒来 xff0c 就看见 GPT 4 发布的消息 xff0c 不得不感慨今年 AI 更新的速度真是太
  • 【Linux】如何在 Ubuntu 上安装 Clang 编译器

    Linux Ubuntu 上安装 Clang 编译器 摊主将在本文中介绍如何在 Ubuntu 上安装 Clang 编译器 摊主的个人技术博客 xff1a https rickyxcoder top x1f9d1 x1f3fb x1f4bb
  • 【信息奥赛题解】四平方和(详细分析题解 & C++ 代码)

    x1f4da 四平方和 摊主的个人技术博客 xff1a https rickyxcoder top x1f9d1 x1f3fb x1f4bb 备用站点 xff1a https rickyxcoder gitee io x1f680 题目浏览
  • Python VS C(上篇)

    Python VS C xff08 上篇 xff09 摊主的个人技术博客 xff1a https rickyxcoder top x1f9d1 x1f3fb x1f4bb 备用站点 xff1a https rickyxcoder gitee
  • Opencv学习----Opencv宏定义(CV_8U、CV_8S、CV_16U...)

    数据类型宏定义 xff1a define CV 8U 0 define CV 8S 1 define CV 16U 2 define CV 16S 3 define CV 32S 4 define CV 32F 5 define CV 64
  • 分区助手磁盘移动毁我双系统

    如果电脑装有双系统或者多系统的话 我的是win10 43 ubuntu18 04 xff0c 不要随意用分区助手更改系统盘的分区空间 xff01 xff01 情况是这样的 xff0c 我的win10系统中C盘有200GB 可用空间100GB
  • Python VS C(下篇)

    Python VS C xff08 下篇 xff09 摊主的个人技术博客 xff1a https rickyxcoder top x1f9d1 x1f3fb x1f4bb 备用站点 xff1a https rickyxcoder gitee
  • Pixhawk4+Up Board / NUC Implement VIO By Deploying T265

    How learning without GFW Reference Links Open links below in sequence Things you need to learn or following Overall Step
  • Deploying T265 in Ubuntu20.04 (PX4_VIO)

    Release 转载请注明出处https blog csdn net qq 46037020 article details 123203784 该文章的中文为个人经验总结与提示 xff0c 英文部分为资料原文摘抄引用 xff0c 便于在