LiaoSteve / Drone-GCS-and-AI

A research diary of a drone system that monitors the coastal pollution.
31 stars 9 forks source link

Drone-GCS-and-AI

A research diary of a drone system that monitors the coastal pollution

-------------------- My Demo video ---------------

FINAL: UAV Trash monitoring system final demo

1. Use yolov3 to detect coast's debries : plastic bottles , plastic bags , caps etc

2. RTK

3. Obstacle avoidance

4. django GCS

5. See demo video 1

6. See demo video 2

7. PID parameter AutoTuning

YOLOv3

license DOI

Notice that in copter/model_data folder:

model_data/
            trained_weights_final_009.h5
            yolo_anchors_009.txt
            voc_classes.txt 

Airsim

image

image

image

image

Getting started with ardupilot and pixhawk :

First setup

  1. Upload firmware : use mission planner upload firmware, and upload chibiOS, i use hexacopter version 3.6.11.
  2. Connect your pixhawk with mission planner, and open Intial setup then choose your UAV frame.
  3. Accelerometer Calibration.
  4. Radio Control Calibration.
  5. Compass Calibration : if you use GPS module, you only need to use compass 1 (external compass). After calibration, reboot your pixhawk.
  6. ESC Calibration: Push throttle to highest position, power up pixhawk and wait for RGB LED. Reboot, disarm your hardware switch and wait for beep~ beep~ beep~. Push throttle to lowest position, and wait for beep~ beep~ beep~. Push throttle from lowest position to highest position, and push throttle to lowest position. Reboot your pixhawk.
  7. Holybro PM02 battery Monitor setup: optional Hardware -> Batter Monitor. (1) Make monito into Voltage and Currnet. (2) Make Sensor into Other. (3) Make APM Ver into The Cube or Pixhawk. (4) Input 18.1 into Voltage divider(Calced). (5) Input 36 into Amperes per volt. (6) Disconnect and recoonnect the Pixhawk to finish the setting up.

    PID auto tuning

  8. Open mission planner and connect your pixhawk via serial port.
  9. Choose Config/Tune panel>> Extended Tuning >> Alttitude Hold >> RC7 opt >> Auto tune, and RC10 opt >> Motor Interlock, and save the changes.
  10. Config/Tune >> Full Parameter >> set AUTOTUNE_AGGR : 0.05 (default 0.1), AUTOTUNE_AXES: 0 (I suggest tuning roll, pitch, yaw separately)
  11. fly in reality: take off in ALT-HOLD or LOITER( recommend) flight mode, and push throttle to 50% ~ 59%, and activate your Radio Controller CH7 to HIGH, then PID Auto tuning will work. Wait UAV beep~ indicate that auto tuning is done, and let your UAV land in Alt-Hold fight mode, land and disarm (the pid parameters is saved). Finally, disabled your CH7 to LOW.

UAV auto fight mode (RTL, LAND, LOITER, [AUTO](), GUIDED, ALT-HOLD, Brake)

1. Open mission planner and connect to your pixhawk, then choose Config/Tune panel>> Full parameter list >> search WPN :

Some Issue :

How to be a drone maker :

1. via radio telemery (serial port)

Base (GCS mission planner)

  1. https://ardupilot.org/copter/docs/common-here-plus-gps.html
  2. Open Mission planner Initial Setup >> Optional Hardware >> RTK GPS Inject screen
  3. Connect your F9P to computer via COM port and baud rate is 115200
  4. Check the autoconfig, then set the surveyin accuracy in meter and time in second (you can use default setting: 2(m) and 60(s))
  5. TIME Mode of base station requires: 5 GPS satellite signals +2 GLONASS satellite signals in the strength of 40 or more; or 5 GPS satellite signals +3 Beidou satellite signal in the strength of 40 or more.

Rover

  1. Notice that your ardupilot firmware version should higher than 3.6.9, i use 3.6.11 hexacopter.
  2. Use I2C provide power (that is, plug the GPS module's GPS pin +5V and GND and insert to I2C).
  3. Use your F9P pins insert to your pixhawk GPS pins.
  4. Use mission planner connect to drone's via radio telemery.
  5. Wait for rtk fixed.
  6. (option) paramter list setting: EK2_ALT_SOURCE:2, EK2_POSNE_M_NSE : 0.1[meter] or 0.01[meter] (0.01 should use carefully)

2. via wifi or 4G LTE

Base (tcp server)

  1. Use Windows 10 as server, and you need a Static IP.
  2. git clone https://github.com/tomojitakasu/RTKLIB_bin/tree/rtklib_2.4.3/bin
  3. Click strsvr.exe, Input Type choose Serial, opt choose COM port where F9P is connecting and baud rate is 115200, output Type choose TCP server and give it a port, and click start bottom.
  4. Open Mission planner Initial Setup >> Optional Hardware >> RTK GPS Inject screen.
  5. Connect your F9P to computer via tcp ip and Baud rate is 115200.
  6. Set surveyin accuracy in meter and time in second (you can use default setting: 2(m) and 60(s))
  7. Press connect bottom and wait for BASE is ready.

Rover

  1. Notice that your ardupilot firmware version should higher than 3.6.9, i use 3.6.11 hexacopter.
  2. Use I2C provide power (that is, plug the GPS module's GPS pin +5V and GND and insert to I2C).
  3. Use your F9P pins insert to your pixhawk GPS pins.
  4. Use mission planner connect to drone's via radio telemery.
  5. wait for rtk fixed.
  6. (option) paramter list setting: EK2_ALT_SOURCE:2, EK2_POSNE_M_NSE : 0.1[meter] or 0.01[meter] (0.01 should use carefully)

License

Refference

  1. YOLOv3
    @article{yolov3,
    title={YOLOv3: An Incremental Improvement},
    author={Redmon, Joseph and Farhadi, Ali},
    journal = {arXiv},
    year={2018}
    }
  2. YOLOv4
    @article{yolov4,
    title={YOLOv4: Optimal Speed and Accuracy of Object Detection},
    author={Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao},
    journal = {arXiv},
    year={2020}
    }