Skip to content

LiaoSteve/Drone-GCS-and-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 
  • You should download trained_weights_final_009.h5 below, and add to model_data folder
https://drive.google.com/open?id=1QVF2AbILUvDLGh02Uwbuzf-lKC-3xqI2
  • connect your webcam, and run copter/yolo.py

Airsim

  • Created by Tzung-Hsien Huang, and adapted by LisoSteve
  • In AirSim simulator, use the fuzzy rules to control the drone.
  • Use depth to sense the objects.

Citation

T. H. Huang, "Path Planning and Visual Obstacle Avoidance Based on Fuzzy Theory for UAV Apllication," Master Thesis, Department of
Communications, Navigation and Control Engineering, NTOU, ROC, 2020 
  • Test A

image

  • Test B

image

  • Test F

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

  1. Open mission planner and connect your pixhawk via serial port.
  2. Choose Config/Tune panel>> Extended Tuning >> Alttitude Hold >> RC7 opt >> Auto tune, and RC10 opt >> Motor Interlock, and save the changes.
  3. Config/Tune >> Full Parameter >> set AUTOTUNE_AGGR : 0.05 (default 0.1), AUTOTUNE_AXES: 0 (I suggest tuning roll, pitch, yaw separately)
  4. 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 :

  • WPNAV_SPEED : if set RTL_speed to zero, RTL horizontal velosity will use this speed .
  • WPNAV_RADIUS : in AUTO mode, if this parameter set 100, that is, once your UAV enter waypoint radius 100 cm, pixhawk will stop and go to the next waypoint.
  • WPNAV_SPEED_UP : Defines the speed in cm/s which the aircraft will attempt to maintain while climbing during a WP mission.
  • WPNAV_SPEED_DN : Defines the speed in cm/s which the aircraft will attempt to maintain while descending during a WP mission.

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

  • LAND_SPEED : The descent speed for the final stage of landing in cm/s.
  • LAND_SPEED_HIGH : The descent speed for the first stage of landing in cm/s. If this is zero then WPNAV_SPEED_DN is used.
  • RTL_SPEED : Defines the speed in cm/s which the aircraft will attempt to maintain horizontally while flying home. If this is set to zero, WPNAV_SPEED will be used instead.
  • LOIT_SPEED : Defines the maximum speed in cm/s which the aircraft will travel horizontally while in loiter mode.
  • PILOT_SPEED_DN : The maximum vertical descending velocity the pilot may request in cm/s.
  • PILOT_SPEED_UP : The maximum vertical ascending velocity the pilot may request in cm/s.

3. Other parameters :

  • RTL_ALT : The minimum alt above home the vehicle will climb to before returning. If the vehicle is flying higher than this value it will return at its current altitude.
  • WP_YAW_BEHAVIOR : Determines how the autopilot controls the yaw during missions and RTL
  • MOT_SPIN_MIN : Point at which the thrust starts expressed as a number from 0 to 1 in the entire output range. Should be higher than MOT_SPIN_ARM.

Some Issue :

How to be a drone maker :

Drone with RTK :

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

  • Notice that our License is reserved

Refference

  1. YOLOv3
@article{yolov3,
  title={YOLOv3: An Incremental Improvement},
  author={Redmon, Joseph and Farhadi, Ali},
  journal = {arXiv},
  year={2018}
}
  1. 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}
}

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published