Prerequisite (For all laptop && R-PI)
Install ubuntu 20.04
Network setting
Note: If you don't have Wi-Fi dongle, use wlan0 instead.
Install ROS noetic && make your ROS workspace
http://wiki.ros.org/noetic/Installation/Ubuntu
Note: In 1.4 Installation, choose ROS-Base(No GUI tools) version to install
Install OSQP & OSQP-Eigen
- Install osqp
- install eigen3
- install osqp-eigen
Install MAVROS
Install robot_upstart
Install Python3
Install pip
Install pymap3d
For optitrack
Install vrpn-client-ros (on laptop)
change server IP
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
"192.168.2.195" -> "192.168.4.182"
Pixhawk parameters setting
- SER_TEL1_BAUD: 230400
- MAV_0_RATE: 11520
- EKF2_AID_MASK: 24
- vision position fusion
- vision yaw fusion
- EKF2_HGT_MODE: vision
- COM_ARM_WO_GPS: Enabled
- MAV_X_MODE: onboard
- SYS_HAS_GPS: Disabled
- UAVCAN_SUB_GPS: Disabled
- CBRK_IO_SAFETY: 22027 //don’t need safety switch
- MAV_SYS_ID: X (define the number of the UAV)
For GPS
Pixhawk parameters setting
- SER_TEL1_BAUD: 230400
- MAV_0_RATE: 11520
- EKF2_AID_MASK: 1 (or 33)
- GPS
- (multi-rotor drag fusion)
- EKF2_HGT_MODE: Barometric pressure
- COM_ARM_WO_GPS: Enabled
- MAV_X_MODE: onboard
- SYS_HAS_GPS: Enabled
- UAVCAN_SUB_GPS: Enabled
- CBRK_IO_SAFETY: 22027 //don’t need safety switch
- MAV_SYS_ID: X (define the number of the UAV)
Robot_upstart settings
To add robot_upstart progress
To cancel robot_upstart progress
To shut down the launch file running in background
指令说明:
参数
–master:ROS_MASTER_URI
–setup:The ros environment u want to add, we choose setup.bash, to which flight_control package belongs
–logdir:Logs directory, it will spawn itself
flight_control/launch/formation_cbf.launch: The path to your launch file, it is nessessory that it should be started up with your package name
Network settings
Use ifconfig to check your ip4 address, then change your ROS_IP in ~/.bashrc

For Wi-Fi NCRL-TWdrone (GPS)
For Wi-Fi NCRL-GPS (Optitrack)
Modify px4.launch

- fcu_url: ttyXXX depends on the UART port you use, and 230400 is the baud rate which should match the parameter of pixhawk setting: SER_TEL1_BAUD
- gcs_url: The address is set to the laptop IP4 address where you run QGroundControl
- tgt_system: It should match the parameter of pixhawk setting: MAV_SYS_ID
Download code from github
Since this is a package, you should download it to /src under your workspace.
- Branch:
- master is for QAV250 with position feedback obtained from optitrack
- TWdrone is for H6F920 with position feedback obtained from optitrack
- TWdrone-GPS-leader is for leader with positon feedback obtained from GPS
- TWdrone-GPS-folloer is for follower with positon feedback obtained from GPS
Change the number of UAV_ID and number of MAV according to the MAV_SYS_ID in pixhawk setting
Run process
For each R-PI, run following command:
For ground station, run following command:
Important code
- ncrl_formation/src/gps_pub.cpp
- ncrl_formation/src/lla2enu.py
- ncrl_formation/node/formation_node.cpp
- ncrl_formation/node/velocity_cbf_generator_node.cpp