See what's new at Remyx.ai
We had a Pi Zero configured with tensorflow to run YOLO object recognition from a previous project. The Parrot AR Drone 2.0 is known for being cheap and hackable. We trade biometric sensors for navigation data to shift the information gathering platform from dog to drone.
Aiming for an autonomous drone, we begin investigating serial communication, you can see more on that here.
The AR Drone runs a wireless access point and binaries expect to communicate with 192.168.1.2 over TCP ports 5554, 5555, 5556. We adapt this repo, featuring modules for high-level flight control which issue AT commands using the python sockets library.
Connecting the raspberry pi to the drone's wireless access point puts the Pi Zero in the driver's seat. We configure the pi's wpa_supplicant conf file to join the network 'ardrone2_144031' (SSID varies). This renders the Pi Zero capable of smart controlled flight using programs, rich telemetry data and object recognition.
The Pi is powered by tapping into the USB to TTL converter we used in probing the serial ports. Plugging the USB into the drone's data storage USB port, we regulate power to pins 2 & 6 on the GPIO headerless Pi zero squeezed between the drone's hardware and the plastic panel.
You can run the ribbon cable of a pi cam under the panel and fix the picam to the back for another vantage with lower latency.
Turning over full control is hazardous, you'll want a kill switch.
However, connecting another device via wifi would require reconfiguring the drone's network settings. This would not be effective if the drone moved out of wifi range.
But we have a USB cellular modem in the Hologram Nova. The Hologram Data Router and CLI can handle messages for remote control. A USB and HDMI adapters help to configure the Pi for flight after doing everything that might require internet access. The USB port doubles to connect the NOVA.
Borrowing from examples in the Hologram Python SDK, we poll for messages sent from the Hologram Dashboard. Here we can send a message like 'land' and this will be relayed to the pi zero where we immediately land the drone.
As long as this message is not sent to the cellular modem, the drone will continue to take commands from the pi zero. For demonstration, we hover but feel free to design more complex flight patterns and use caution!
InstallCompatibility between project dependencies requires python3.4 as default python3. You should burn this specific image for your raspberry pi zero. After making this image and wiring the pi, boot up and go through the first-time boot configuration. You should make sure to:
- Under Advanced Options, Expand filesystem
- Under Localization Options change timezone
- Change User password
After a reboot, git clone this repo
cd ~/
git clone https://github.com/smellslikeml/cell_pwn_drone.git
cd cell_pwn_drone
And run the install script
./install.sh
./ardrone_setup.py
Configuration- Position drone upside down to access pi and disable flight mode
- Set DEVICEKEY in config.py
DEVICEKEY='YOUR-DEVICE-KEY-HERE'
- Set /etc/wpa_supplicant/wpa_supplicant.conf to the drone's SSID
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="ardrone2_#####"
}
- Reboot, connect peripherals, note the time (Pi off wifi on drone network)
- As root (sudo su), set crontab for the time based on start time
$ sudo su
$ crontab -e
#In your crontab,
<minute> <hour> * * * /home/pi/cell_pwn_drone/main.py >> flight.log 2>&1
- Unplug keyboard, plug in Hologram Nova
- From Hologram Dashboard, navigate to Devices, click on your device, and in the Send a Message section, in the via Cloud Data tab, prepare for 'land' command to break flight as in the picture above
- Unplug HDMI after reboot and position drone
- Wait for your drone to fly and hit the Send data message button to land!
For more advanced functionality, you can also go to our other project to install the YOLO code to have the drone send you an SMS message to your phone whenever it detects a person during flight and send GPS data.
Comments