A research diary of a drone system that monitors the coastal pollution
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
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
- 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.
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
- Test B
- Test F
- Test G (See demo video):
- Upload firmware : use mission planner upload firmware, and upload chibiOS, i use hexacopter version 3.6.11.
- Connect your pixhawk with mission planner, and open Intial setup then choose your UAV frame.
- Accelerometer Calibration.
- Radio Control Calibration.
- Compass Calibration : if you use GPS module, you only need to use compass 1 (external compass). After calibration, reboot your pixhawk.
- 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.
- Holybro PM02 battery Monitor setup: optional Hardware -> Batter Monitor. (1) Make
monito
intoVoltage and Currnet
. (2) MakeSensor
intoOther
. (3) MakeAPM Ver
intoThe Cube or Pixhawk
. (4) Input18.1
into Voltage divider(Calced). (5) Input36
intoAmperes per volt
. (6) Disconnect and recoonnect the Pixhawk to finish the setting up.
- Tuning : https://ardupilot.org/copter/docs/tuning.html
- Autotune : https://ardupilot.org/copter/docs/autotune.html
- Open mission planner and connect your pixhawk via serial port.
- Choose Config/Tune panel>> Extended Tuning >> Alttitude Hold >>
RC7 opt
>>Auto tune
, andRC10 opt
>>Motor Interlock
, and save the changes. - Config/Tune >> Full Parameter >> set
AUTOTUNE_AGGR
: 0.05 (default 0.1),AUTOTUNE_AXES
: 0 (I suggest tuning roll, pitch, yaw separately) - fly in reality: take off in
ALT-HOLD
orLOITER
( 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.
1. Open mission planner and connect to your pixhawk, then choose Config/Tune panel>> Full parameter list >> search WPN :
WPNAV_SPEED
: if setRTL_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.
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 RTLMOT_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.
- Configuring a Telemetry Radio using Mission Planner
- Telemetry Radio
- Setting Hover Throttle
- Non-GPS Navigation
-
Pixhawk4-Pinouts: http://www.holybro.com/manual/Pixhawk4-Pinouts.pdf
-
pixhawk 2.4.8 : https://ardupilot.org/copter/docs/common-pixhawk-overview.html
-
pixhawk mini : http://www.holybro.com/manual/Pixhawk4Mini_Pinouts.pdf
-
CUAV RTK : http://doc.cuav.net/gps/c-rtk/en/c-rtk-9p/hardware-connection.html
-
GPS Blending (aka Dual GPS) : https://ardupilot.org/copter/docs/common-gps-blending.html
- pixhawk4 UART (serial port 4)
-
Telemetry / Serial Port Setup : https://ardupilot.org/copter/docs/common-telemetry-port-setup.html
- https://ardupilot.org/copter/docs/common-here-plus-gps.html
- Open Mission planner Initial Setup >> Optional Hardware >> RTK GPS Inject screen
- Connect your F9P to computer via COM port and baud rate is 115200
- Check the autoconfig, then set the surveyin accuracy in meter and time in second (you can use default setting: 2(m) and 60(s))
- 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.
- Notice that your ardupilot firmware version should higher than 3.6.9, i use 3.6.11 hexacopter.
- Use I2C provide power (that is, plug the GPS module's GPS pin +5V and GND and insert to I2C).
- Use your F9P pins insert to your pixhawk GPS pins.
- Use mission planner connect to drone's via radio telemery.
- Wait for rtk fixed.
- (option) paramter list setting:
EK2_ALT_SOURCE:2
,EK2_POSNE_M_NSE : 0.1[meter] or 0.01[meter] (0.01 should use carefully)
- Use Windows 10 as server, and you need a Static IP.
git clone https://github.com/tomojitakasu/RTKLIB_bin/tree/rtklib_2.4.3/bin
- Click
strsvr.exe
,Input Type
chooseSerial
,opt
choose COM port where F9P is connecting and baud rate is 115200,output Type
chooseTCP server
and give it a port, and clickstart
bottom. - Open Mission planner Initial Setup >> Optional Hardware >> RTK GPS Inject screen.
- Connect your F9P to computer via tcp ip and Baud rate is 115200.
- Set surveyin accuracy in meter and time in second (you can use default setting: 2(m) and 60(s))
- Press connect bottom and wait for BASE is ready.
- Notice that your ardupilot firmware version should higher than 3.6.9, i use 3.6.11 hexacopter.
- Use I2C provide power (that is, plug the GPS module's GPS pin +5V and GND and insert to I2C).
- Use your F9P pins insert to your pixhawk GPS pins.
- Use mission planner connect to drone's via radio telemery.
- wait for rtk fixed.
- (option) paramter list setting:
EK2_ALT_SOURCE:2
,EK2_POSNE_M_NSE : 0.1[meter] or 0.01[meter] (0.01 should use carefully)
- Notice that our License is reserved
- YOLOv3
@article{yolov3,
title={YOLOv3: An Incremental Improvement},
author={Redmon, Joseph and Farhadi, Ali},
journal = {arXiv},
year={2018}
}
- 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}
}