---
# System prepended metadata

title: CUAV V5

---

# CUAV V5
![](https://i.imgur.com/I7uALcs.png)

# install ubuntu 20.04 on r-pi
- use raspberry-pi imager 
    - https://www.raspberrypi.com/software/

## Network setting
https://dev.to/joeneville_/configure-ubuntu-wifi-with-netplan-4je0

## install ROS

* Step 2: Installing ROS Noetic
https://x-tech.online/2022/01/installing-ros-noetic-on-a-headless-raspberry-pi-4-with-ubuntu-20-04/

```
source /opt/ros/noetic/setup.bash
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
rosversion -d
```

## install OSQP-eigen
- install OSQP
https://osqp.org/docs/get_started/sources.html
https://blog.csdn.net/qq_35632833/article/details/116229362#t8
- install OSQP-eigen


sudo apt install build-essential
# install mavros on rpi
## install GeographicLib
```
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
sudo bash ./install_geographiclib_datasets.sh   
```

* another way:
change kinetic to noetic
https://docs.px4.io/main/en/ros/mavros_installation.html

## vrpn-client-ros
under workspace
```
git clone https://github.com/ros-drivers/vrpn_client_ros.git
sudo apt-get install ros-noetic-vrpn-client-ros
sudo apt-get install ros-noetic-roslint
vim vrpn_client_ros/launch/sample.launch
```
change server IP

![](https://i.imgur.com/GBSiKSS.png)


## pixhawk setting

SER_TEL1_BAUD: 460800

EKF2_AID_MASK: 24
vision position fusion
vision yaw fusion

EKF2_HGT_MODE
vision

MAV_X_MODE:onboard
MAV_0_RATE 23040 B/s(baud/20)
CBRK_IO_SAFETY:22027 //don't need safety switch

## pixhawk 

## run process
https://github.com/EasonHuang-tw/ncrl_formation?fbclid=IwAR2rKLleJuRxHJuIpspKMZ2UAapBGhIyXdclDhaCI7K5c2_sKDmrIHmwi9I

process:
```
roslaunch mavros px4.launch
roslaunch vrpn_client_ros sample.launch
rosrun flight_control topic_tool
rosrun flight_control motive 
```
set timesync_rate:0.0 in px4_config.yaml 

# Note
* topic tool.cpp
    subscriber(/vrpn.../MAV*/pose)
* optitrack initialize 
    heading to x direction (east)


# modify UAV_ID files
![](https://i.imgur.com/2PyNTJu.png)
1. 程式架構改善（少委）
2. 多機間的CBF（濬智）(多人)
4. 飛場邊界CBF（伯會）
5. 調gain（與微）（至少2人）（優先度最低）
6. 移動障礙物（小車？）（優先度最高）（多人）
7. 控yaw(src/motive.cpp  line 86)

## Mermaid
Ganttalf: 禹維 
```mermaid
gantt
    title Our Gantt Diagram

    section Mechanism
    移動障礙物           :a1, 2022-10-20, 30d
    程式架構改善     : a2, 2022-10-20  , 7d
    多機間CBF      :a3, after a1, 30d
    邊界CBF     :a4, after a1  , 14d
    section Electron
    調gain      :a5, after a4, 14d
    
```