RPi.GPIO
Adafruit_PCA9685
flask
flask_socketio
json
Install Adafruit PCA9685 I2C device with raspberry pi via I2C Bus
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
# Test is connected device
sudo i2cdetect -y 0
# OR
sudo i2cdetect -y 1
sudo apt-get install git build-essential python-dev
cd ~ git clone https://github.com/adafruit/Adafruit_Python_PCA9685.git
cd Adafruit_Python_PCA9685
sudo python setup.py install
# if you have python3 installed:
sudo python3 setup.py install
Flask install
pip uninstall gevent
sudo pip install socketIO_client
pip install flask
pip install flask-socketio
sudo git clone https://code.leftofthedot.com/borhanreo/drone_control.git
cd drone_control
sudo python main.py
If you get any problem then need to uninstall gevent
pip2 freeze | grep socket
sudo pip2 uninstall gevent-socketio
sudo pip2 uninstall gevent-python
sudo pip2 install python-socketio
sudo pip2 install socketIO-client
sudo pip2 install websocket-client
sudo apt-get update
sudo apt-get install screen python-wxgtk2.8 python-matplotlib python-opencv python-pip python-numpy python-dev libxml2-dev libxslt-dev python-lxml
sudo pip install future
sudo pip install pymavlink
sudo pip install mavproxy
python -m serial.tools.list_ports
/dev/ttyAMA0
/dev/ttyUSB0
/dev/ttyUSB1
3 ports found
pip --version
bash run.sh
python mavlink_lib.py --master=/dev/ttyACM0 --baudrate 115200 --aircraft MyCopter
bash run.sh
mode
mode guided
arm throttle
takeoff 40
param load ..\Tools\autotest\default_params\copter.parm
mode circle
param set circle_radius 2000
Write guided then desire altitude guided ALTITUDE
guided 100
Write guided then desire LAT LNG ALT guided ALTITUDE
guided 22.376666 -121.54464 120
param save ./myparams.parm
http:https://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html https://ardupilot.github.io/MAVProxy/html/modules/cmdlong.html
master=mpstate.master()
lat = master.field('GLOBAL_POSITION_INT', 'lat', 0) * 1.0e-7
lng = master.field('GLOBAL_POSITION_INT', 'lon', 0) * 1.0e-7
To auto-start the terminal on boot, open this file with nano:
nano ~/.config/lxsession/LXDE-pi/autostart
Add this line to the end of the file:
@lxterminal
Close, save and reboot
sudo reboot
--https://youtu.be/Y8G3tua0ezI
Power on rpi and run.. Drone power will be off
All power shuld be off
cd /home/pi/development/drone_control
python python obsAI.py
RC 3 HIGH / THROTTLE 100% MAXIMUM**
POWER ON/ CONNECT BATTERY DRONE**
AFTER BEEF COMPLETED then again drone battery power OFF**
power on or Plug battery again
After beef completer then throttle going to minimum**
unplug again
####Reference
http:https://ardupilot.org/copter/docs/common-lightware-sf40c-objectavoidance.html
https://www.pyimagesearch.com/2018/06/18/face-recognition-with-opencv-python-and-deep-learning/