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模块设计之二十一: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模块设计之二十四:内部ADC模块

    PX4模块设计之二十四 xff1a 内部ADC模块 1 内部ADC模块简介2 模块入口函数2 1 主入口board adc main2 2 自定义子命令custom command 3 内部ADC模块重要函数3 1 task spawn3
  • PX4模块设计之三十四:ControlAllocator模块

    PX4模块设计之三十四 xff1a ControlAllocator模块 1 ControlAllocator模块简介2 模块入口函数2 1 主入口control allocator main2 2 自定义子命令custom command
  • 【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
  • px4无人机常识介绍(固件,px4等)

    专业名词解释 aircraft 任何可以飞或者可以携带物品还是搭载旅客的飞行器统称为飞机 航空器 uav 无人驾驶飞机 vehicle 飞行器 airplane plane aero plane 有机翼和一个或多个引擎的飞行器统称为飞机 D
  • VIO与全局快门及轮速计的一些应用小技巧

    封面就用一个可爱的小车车 之前各种针对VIO xff0c VSLAM和VINS的工程注意事项都讲过了 今天的内容主要是针对VSLAM xff0c VIO的实用性 比如Td xff0c 同步对时 xff0c 内参 xff0c 外参这一串 最近
  • ubuntu20.04 下使用cgroup 限制内存

    本实践的主要操作请参照 参考链接 进行 由于在实践中主要想完成的目标是限制服务器中用户 用户组的内存使用 xff0c 防止某个用户占用过多的cpu 内存导致其他用户无法正常使用甚至服务器宕机 xff0c 因此需要手动加cgexec指令的实验
  • 在ubuntu20.04上配置VINS_Fusion(亲测有效,一应俱全)

    最近在做科研训练的时候配置了HKUST Aerial Robotics实验室的VINS Fusion代码项目 xff0c 经历了一些编译报错的问题 xff0c 在网上查找的时候博客内容良莠不齐 xff0c 且实质针对性意见不多 xff0c
  • PX4软件在环仿真注意点

    注 xff1a 最新内容参考PX4 user guide 点击此处 PX4下载指定版本代码和刷固件的三种方式 点击此处 PX4sitl固件编译方法 点击此处 PX4开发指南 点击此处 PX4无人机仿真 Gazebo 点击此处 px4仿真 知
  • Ubuntu20.04更换国内镜像源(阿里、网易163、清华、中科大)

    2022年12月11日更新 今天刚安装了 Ubuntu22 04 xff0c 安装时选好地区 xff0c 开机默认就是中国内地的镜像源服务器 xff0c 速度很快 xff0c 体验极佳 xff0c 已经基本告别更换镜像源的烦恼了 给官方点赞
  • 【Ubuntu20.04安装 ROS2-galactic】

    Ubuntu20 04 安装 ROS2 galactic 按照官网流Ubuntu20 04 安装 ROS2 galactic程在终端依次执行命令就行 xff1a 安装流程链接 install ros 2 package 执行到最后一步 xf
  • PX4通过参数脚本给飞控导入参数

    PX4通过参数脚本给飞控导入参数 先找一架正常能飞的无人机连接地面站 在参数页面右上角点击工具 gt 保存到文件 保存的时候文件名注明参数的相关信息 然后将需要加载参数的无人机连接至地面站 xff0c 注意需要加载参数的无人机必须和保存的参
  • Ubuntu20.04下 C/C++ TCP Socket传输文件或图片实例

    server span class token macro property span class token directive hash span span class token directive keyword include s
  • Docker使用系列——Docker安装(Ubuntu20.04)

    Docker使用系列 Docker安装 xff08 Ubuntu20 04 xff09 卸载安装测试问题 直接按官方安装教程即可 xff1a Install Docker Engine on Ubuntu 卸载 安装过老版本的Docker则
  • ORB_SLAM2配置——基于Ubuntu20.04+ROS+gazebo仿真

    一 引言 ORB SLAM2 xff0c 它是基于单目 双目或RGB D相机的一个完整的SLAM系统 xff0c 其中包括地图重用 回环检测和重定位功能 这个系统可以适用于多种环境 xff0c 无论是室内小型手持设备 xff0c 还是工厂环
  • 大神浅谈无人机飞控软件设计 系统性总结

    写在前面 深感自己对飞控软件 算法的知识点过于杂乱 很久没有进行系统的总结了 因此决定写几篇文章记录一些飞控开发过程的知识点 主要是针对一些软件 算法部分进行讨论 如内容有错误 欢迎指出 1 飞控软件的基本模块 无人机能够飞行主要是依靠传感
  • 如何在 C++ 和 QML 应用程序中使用 qrc?

    我在 Windows7 上用 c qnd Qt Creator QML 编写了 Qt Quick Desktop 应用程序 现在 我必须部署它 并且我需要隐藏 qml 文件和图像 意味着 将它们放入资源等中 我读到有一个很好的方法可以使用

随机推荐

  • 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 便于在