Ardupilot与T265配置
Posted hellocxz
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ardupilot与T265配置相关的知识,希望对你有一定的参考价值。
1. Ardupilot与T265配置
1.1. 介绍
在英特尔RealSense追踪相机T265是一种智能相机,它使用专用的V-SLAM 22 (视觉惯性同步定位与地图)技术,将数据从相机和惯性测量单元(IMU)相结合,跟踪摄像头的周围未知的空间位置GPS可能不可用的地方。该软件使用所有这些数据来构建并不断更新环境和设备位置的地图,并保持较高的准确性
1.2. 系统要求
在Windows和Linux上,通过librealsense支持T265。根据您对T265的需求,配套计算机应具有USB2或USB3:
- 对于姿势(xyz位置和方向)数据:任何带有USB2的板就足够了。
- 对于鱼眼图像流:需要USB3。
对于定位和导航用例,我们需要捕获姿态数据并将其发送到飞行控制器进行定位。一个系统包括:
- 树莓派3B型与16GB微型SD卡
- 运行Ubuntu MATE 16.04 LTS 36
硬件要求
- 树莓派3B+
- 16G高速存储卡
- 英特尔追踪相机T265
- 能稳定悬停的无人机
- Pixhawk硬件
软件要求
树莓派:
- ubuntu16.04meta
- ROS
- librealsense(T265驱动)
- realsense-ros (与ROS协同的T265驱动)
1.3. 系统总体框架
## 1.4. 环境配置
1.4.1. 安装ROS
设置安装源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
设置密匙
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
更新软件包
sudo apt update
安装ros-kinetic
sudo apt-get install ros-kinetic-desktop-full
sudo apt-get install ros-kinetic-desktop
sudo apt-get install ros-kinetic-ros-base
初始化环境
sudo rosdep init
rosdep update
更新bash
echo "source /opt/ros/kinetic/setup.zsh" >> ~/.zshrc
source ~/.zshrc
安装开发依赖包
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
1.4.2. 安装MAVROS
Instructions for installing MAVROS can be found here but in short involve running the following command
sudo apt-get install ros-kinetic-mavros ros-kinetic-mavros-extras
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
chmod a+x install_geographiclib_datasets.sh
./install_geographiclib_datasets.sh
For ease of use on a desktop computer, please also install RQT
sudo apt-get install ros-kinetic-rqt ros-kinetic-rqt-common-plugins ros-kinetic-rqt-robot-plugins
We recommend using caktin_tools instead of the default catkin_make as it is more powerful
sudo apt-get install python-catkin-tools
1.4.3. 安装librealsense
1.4.4. 安装realsense-ros
1.4.5. T256连接树莓派
roslaunch mavros apm.launch fcu_url:=/dev/ttyACM0:57600
1.4.6. 启动摄像头
There are 3 nodes running in this setup. Launch in 3 separated terminals on RPi:
T265 node:
roslaunch realsense2_camera rs_t265.launch
The topic /camera/odom/sample/ and /tf should be published at 200Hz.
MAVROS node: (with fcu_url and other parameters in apm.launch modified accordingly).
roslaunch mavros apm.launch fcu_url:=/dev/ttyAMA0:921600
rostopic echo /mavros/state should show that FCU is connected.
rostopic echo /mavros/vision_pose/pose is not published
vision_to_mavros node:
roslaunch vision_to_mavros t265_tf_to_mavros.launch
rostopic echo /mavros/vision_pose/pose should now show pose data from the T265.
rostopic hz /mavros/vision_pose/pose should show that the topic is being published at 30Hz
以上是关于Ardupilot与T265配置的主要内容,如果未能解决你的问题,请参考以下文章
基于ArduPilot的旋翼式无人机飞行器开发系列(五,ArduPilot开源代码下载,编译,调试及烧录)
ArduPilot飞控AOCODARC-H7DUAL固件编译