How learning without GFW
Reference Links
Open links below in sequence.
(Things you need to learn, or following Overall Steps below but get nothing )
Some are combined by same web page.
ROS Tutorials
PX4 User Guide
PX4 Development Guide
Initial Setup
Ubuntu Development Environment
PX4 Buliding(Alternative)
Companion Computer
MAVLink
MAVROS Installation
MAVLink Router(Alternative)
VIO Introduction
MAVLink Interface
T265
VIO Git
VIO Dependence
Realsense-ros
Vision_to_Mavros
MAVLink Inspector
Flight Analysis which is really important.
(Matlab is available of course)
cnROS_T
cnPX4_UG
cnPX4_DG
PX4 User/Development Guide & ROS Tutorials in Chinese.
(Recommend BUT Reference)
QGC User Guide
Flight Modes
Flight Modes Setup
Vehicle Status Notifications !!! MUST Remember and Check before each Flying Mission !!!
Notes
- How to install Java & Ant correctly.(if using Flightplot)
- connection between PX4 & Up Board
Overall Steps Beta
Capable in 20.04 tutorial has released. Please check at the end of the article.
Already have drones and a PC installed QGC?
Disarm your propellers First !
ESC Calibration
After ESC Calibration, press SWITCH button
Step 1. Choose Companion Computer
Intel NUC or Up Board (both used in my development) or others, with Ubuntu18.04 Mate or 16.04 (18.04 is officially recommend).
Step 2. PX4 Tool Chain
Set on the computer that using QGC for PX4 firmware upgrade.
CC is recommend.
Here’s reference with his notes
git clone https://github.com/PX4/Firmware.git --recursive
bash ./Firmware/Tools/setup/ubuntu.sh
reboot
sudo apt upgrade libignition-math2 //In case of (gazebo: symbol lookup error: xxx_xxx...)
//*************************
//QGC Linux Installtion
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
sudo apt install libqt5gui5 -y
/**Download QGC from Link above**/
chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage
//**************************
//Test if Tool Chain successfully configured
//Run QGC first
cd Firmware/
make px4_sitl_default jmavsim /*(or gazebo)*/ //Run Simulation
commander takeoff
commander land
Step 3. Basic Environment Setting: Ros Melodic installed. (or 16.04 & kinetic)
Before Ros installed (python2.7 for 18.04)
sudo apt install python2.7
sudo ln -s /usr/bin/python2.7 /usr/bin/python
Step 4. Install Mavros
MAVROS Installation
mavros is a ROS (1) package that enables MAVLink extendable communication between computers running ROS1 for any MAVLink enabled autopilot, ground station, or peripheral. MAVROS is the “official” supported bridge between ROS1 and the MAVLink protocol.
The easiest way to setup PX4 simulation with ROS on Ubuntu Linux is to use the standard installation script that can be found at Development Environment on Linux > Gazebo with ROS.
wget https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_ros_melodic.sh
bash ubuntu_sim_ros_melodic.sh
or
sudo apt-get install ros-melodic-mavros ros-melodic-mavros-extras
//For 'wget' below
sudo apt-get install openssl
sudo apt-get install libssl-dev
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash ./install_geographiclib_datasets.sh
Step 5. VIO Dependencies
- ROS in step1.
- Librealsense
build it from source or following below bash code
export http_proxy="http://<proxy>:<port>" //In case the public key cannot be retrieved
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
/*Reconnect the Intel RealSense depth camera and run:
realsense-viewer
to verify the installation.*/
//sudo apt install python-catkin-tools
Step 6. T265 Dependencies
// realsense2_camera
sudo apt-get install ros-melodic-realsense2-camera
sudo apt install ros-melodic-cv-bridge ros-melodic-image-transport ros-melodic-tf ros-melodic-diagnostic-updater ros-melodic-ddynamic-reconfigure
//**************************
//Realsense SDK
git clone https://github.com/IntelRealSense/librealsense.git
cd librealsense
mkdir build
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=true \
-DFORCE_RSUSB_BACKEND=ON -DBUILD_WITH_TM2=false -DIMPORT_DEPTH_CAM_FW=false
sudo make uninstall && make clean && make && sudo make install
//**************************
//realsense-ros
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone -b 2.2.7 https://github.com/IntelRealSense/realsense-ros.git
sudo apt-get install ros-melodic-ddynamic-reconfigure
catkin_init_workspace
cd ..
catkin_make clean
/****
There might be a "...find_if... ...suggested alternative: In file included from...from..." error while below catkin_make
vim /home/xxl/catkin_ws/src/realsense-ros/realsense2_camera/src/base_realsense_node.cpp +1854
//Then add 'std::' before 'find_if'
***/
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
gedit ~/.bashrc
source ~/catkin_ws/devel/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/catkin_ws/
Step 7. Vision_to_Mavros
This is vision_to_mavros project original, you may get something useful.
T265 POSE
mkdir -p ~/vision_ws/src
cd ~/vision_ws/src
git clone https://github.com/thien94/vision_to_mavros.git
catkin_init_workspace
cd ..
catkin_make
gedit ~/.bashrc
source ~/vision_ws/devel/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/vision_ws/
cd vision_ws/src/vision_to_mavros/launch
vim t265_all_nodes.launch
//TURN <include file="$(find mavros)/launch/apm.launch"/> TO <include file="$(find mavros)/launch/px4.launch"/>
//***
If there is timesync warning during below step, you can
sudo vim /opt/ros/melodic/share/mavros/launch/px4_config.yaml
CHANGE line 12
/
timesync_rate: 0.0
/
/***
Step 8. VIO Installation
cd ~/catkin_ws/src
git clone https://github.com/Auterion/VIO.git
sudo apt install ros-melodic-mavros ros-melodic-mavros-extras //melodic
cd ~/catkin_ws
catkin build px4_realsense_bridge
source ~/catkin_ws/devel/setup.bash
roslaunch px4_realsense_bridge bridge_mavros.launch //This launch file starts the mavros node as well.
Step 8. QGC Parameter Setup
Set up Step2. computer’s QGC
Official
here’s my addition
参数名称 | 设置值 |
---|
MPC_XY_VEL_MAX (X/Y方向最大速度限制) | 0.50m/s(1.12mph) |
MPC_Z_VEL_MAX_DN (Z轴下降速度限制) | 0.500m/s(1.12mph) |
MPC_Z_VEL_MAX_UP (Z轴上升速度限制) | 0.500m/s(1.12mph) |
PWM_MAX 通道频率上限 | 2000us |
PWM_MIN 通道频率下限 | 1000us |
CBRK_USB_CHK | 197848 (禁用USB检查) |
EKF2_AID_MASK () | 24 (视觉外设编号) |
EKF2_HGT_MODE (高度源) | Vision |
SENS_TEL2_BAUD (TELEM2波特率设置) | 921600 8N1 |
Step 9. Connection CC with PX4
Official
。。。
。。。
。。。
Flight_Modes
USE FTDI FT232
sudo chmod 777 /dev/ttyUSB0
sudo vim /opt/ros/melodic/share/mavros/launch/px4.launch
//*****************
/CHANGE/
<arg name="fcu_url" default="/dev/ttyACM0:57600" />
/TO/
<arg name="fcu_url" default="/dev/ttyUSB0:460800" />
*****************//
UDEV<--------MUST DO IT
Step 10. Check Everything
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key
/**********************************************/
roslaunch realsense2_camera demo_t265.launch
/***********************************************/
roslaunch mavros px4.launch
/***********************************************/
roslaunch realsense2_camera rs_t265.launch
roslaunch mavros px4.launch
roslaunch vision_to_mavros t265_tf_to_mavros.launch
/************************************************/
roslaunch vision_to_mavros t265_all_nodes.launch
rostopic echo mavros/vision_pose/pose
Step 11. Others
Ros launch automatically. (rm_bringup is recommend)
Easy way.
System Setting -----> login window ----> automatic login
vim start.sh
"
#! /bin/bash
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
source ~/vision_ws/devel/setup.bash
roslaunch vision_to_mavros t265_all_nodes.launch
"
sudo chmod 777 start.sh
Add start.sh to System Startup Application
Now Enjoy
Arm your paddle
RC----POSITION MODE
roslaunch vision_to_mavros t265_all_nodes.launch
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)