A discussion page to allow me to add my experiences using a Raspberry Pi 2/3/Zero V1.2/1.3 as a companion computer for Ardupilot/APM/Pixhawk flight boards. I will update my experiences as I learn, feel free to comment and offer tips, it's all free here.

I'm building a github for my experiments: https://github.com/benb0jangles/Companion-Pi

Drone Unit: Raspberry Pi Zero V1.3 + Pi Camera Module
img file: https://drive.google.com/open?id=0B1cVb3uX0f0dQTZzSmVISFdYd3M

Ground Unit: Raspberry Pi 2

img file: <to be added>

Goggles Unit: Raspberry Pi Zero V1.3

img file: https://drive.google.com/open?id=0B1cVb3uX0f0dakFpaTAyVF9HV2s

Ardupilot Technical Questions:

Also, if you have any technical code/hardware questions which you feel may take ongoing contributions and help over an extended timeframe, feel free to ask over on Ardupilot.org technical discussion page herehttp://discuss.ardupilot.org/t/companion-pi-2-3-zero/9460

I will update as I get by, please contribute by offering your 'plug & play' wifi adapters using Raspbian Jessie. Also, if you happen to pick up this project, and are working faster than me, then please send us your own .img file experiments. Thanks.

Views: 16168

Replies to This Discussion

@benbojangles - "Open-source Digital video is almost done and will allow people to experiment more easily with captured video like all the usual robotics stuff - Opencv, Caffe, etc on a receiving laptop."

Unfortunately not - really good open digital fpv/video from a drone is a fair way off.  You can get reasonable video over standard wifi but it's not very reliable and so far has quite high latency.  It's possible to improve results with a careful recipe like Patrick Duffy's, but that relies on proprietary hardware and protocols that aren't terribly suitable for drones and still has limitations.  Wifibroadcast has great potential and significant benefits over standard wifi, but has it's own limitations and isn't yet in a commercial state, and befinitiv seems to have stopped developing it.  Low-latency, reliable, easy to use, open digital fpv/video useable on smallish drones is still a way away.  The hardware itself (or lack thereof) is a significant problem.  Fortunately things are improving all the time with new commodity components and cameras coming onto the market, and good people like those in this discussion are ever adding to and improving the open offerings.

@Fnoop,  Just a note, I don't use proprietary hardware, but I do use high-power adapters, and a high-gain setup on the ground with a tracker. I use Ubiquity hardware (Nanobeam 5Ghz), and ordinary wifi adapters (Amped Wireless ACA1, and Netis Wf2561).  All FCC-legal stuff. The latency is around 110 to 120ms, using the standard Pi camera, I wouldn't call that 'quite high'.  It's reasonable for recreational copter flying, not for racing, but for flying around the neighbor hood, it's quite good, even flying a copter at 30mph, it's pretty reasonable.

Not sure why you would say it's not suitable for drones, I have it working on 5 different drone platforms, 3 copter frames and two fixed wing airplanes. On the airplanes, I added a 2watt (33dbm) amplifier and have achieved 16km range without any dropouts over a 40 minute flight. It's not perfect, but it's pretty reliable. 

 

@Patrick Duffy, I was referring to your blog post using ubiquiti hardware.  It's all fairly large PoE stuff that is clunky to use on a drone, particularly a small drone.  I know because after reading your blog I went and bought a bunch of ubiquiti hardware and used it quite a bit :)  It's powerful and reasonably easy to setup and using airmax is pretty good at keeping connection, but it still drops and the results aren't pretty when it does - that's a major benefit of wifibroadcast.  And because it's somewhat of a black box (that's what I meant by proprietary, even if it does run a hacked version of linux that doesn't adhere to GPL) you have no programmatic control over the connection from the companion computer.  If you've moved to ordinary wifi dongles like I have then it's easier but you lose the airmax benefits.

I have raspberry 2/3/zero with various wifi dongles and it's a fun diy solution but it's not ideal.  I still haven't found a good cable or case for the camera that is flexible, safe and tidy for mounting on a drone.  The latency and range is fine if you're flying in clear air at altitude doing say slow AP work, if you're having fun in a park/forest/field/anywhere with stuff to crash into, the latency is too high.  Forget it for racing.  But I've used it for aerial downward-looking research and it's been great.

It would be fantastic if some small company came up with a 'open fpv pack' that people could just buy and use for an open fpv/video solution.  A small, neat casing for say a raspberry zero, tilting camera and wifi dongle with external antenna support and an sd card ready to go, sort of like what Craft and Theory have done for the frsky telemetry.

I'm also trying different hardware to see if incremental improvements can be made.  The odroid xu4 with the ocam supports DMA uncompressed video @ 120fps so should support a much lower latency, hardware mfc encoding is just coming alive, and it has more horsepower for doing opencv.  I've also got a snickerdoodle on order, this is an exciting long term possibility  as it's a small form factor with onboard mimo wifi and interesting possibilities with hdmi in or using the fgpa for custom video processing/transfer.

@Fnoop,  Yes, the ubiquity hardware on the drone is not ideal and I switched to standard wifi a while ago. The Netis 2561 dual-band wifi dongel is now my preferred adapter.  Here's the link on Amazon.  

Here's a picture on how I mount the Pi camera on a quad with a gimbal:

I use an extended cable for the camera which you can buy online., and I 3-d printed the mounting brackets and fake go-pro mounting block.  In fact the entire quad is 3-d printed. (3-d printer files here) I posted some videos from this quad on YouTube showing a flight that went 4 miles from home. 

Here's a pic on how I mounted the Netis WiFi adapter on another quad:

And another type of mount not using a gimbal, but with a servo for tilting/stabilizing.  This setup is also 3-d printed.

This setup uses the "A" model of the Raspberry PI, as it's a bit smaller.

So far, I haven't had any issues with these extended cables. The downside is that it's not all in a small package that most folks want. You have to separate the camera from the PI, or if you don't you probably can't mount it on a gimbal.  I think Benbojangles has a more compact setup, but without the gimbals. 

Air Unit: Raspberry Pi Zero V1.3 + Pi Camera Module
img file: https://drive.google.com/open?id=0B1cVb3uX0f0dQTZzSmVISFdYd3M


@PatrickDuffy,

I see you installed clover leaf antennas on the Netis2561, what type of antenna do you have on the ground station ?

Having 2 ports  allows transmission on 2 planes  Vertical-Horizontal (actually with a cloverleaf it would be like 2  spirals )  did you had a chance to experiment with this ?

Regards


Patrick Duffy said:

@Fnoop,  Yes, the ubiquity hardware on the drone is not ideal and I switched to standard wifi a while ago. The Netis 2561 dual-band wifi dongel is now my preferred adapter.  Here's the link on Amazon.  

Here's a picture on how I mount the Pi camera on a quad with a gimbal:

I use an extended cable for the camera which you can buy online., and I 3-d printed the mounting brackets and fake go-pro mounting block.  In fact the entire quad is 3-d printed. (3-d printer files here) I posted some videos from this quad on YouTube showing a flight that went 4 miles from home. 

Here's a pic on how I mounted the Netis WiFi adapter on another quad:

And another type of mount not using a gimbal, but with a servo for tilting/stabilizing.  This setup is also 3-d printed.

This setup uses the "A" model of the Raspberry PI, as it's a bit smaller.

So far, I haven't had any issues with these extended cables. The downside is that it's not all in a small package that most folks want. You have to separate the camera from the PI, or if you don't you probably can't mount it on a gimbal.  I think Benbojangles has a more compact setup, but without the gimbals. 

I'm running into a bit of an issue with my serial connection. It seems like my pi is able to open a one-way communication path to the pi. When i run mavproxy.py, i get a return that the UAS is in stabilize mode, and "fence breach" and "online 1", but it doesn't do much else, or respond to commands. Any help? running a PI 3 and 2(tested both) with direct connection to the telemetry port on an APM 2.6 via GPIO on the PI.

tech questions go here:http://discuss.ardupilot.org/t/companion-pi-2-3-zero/9460

Brad Goodall said:

I'm running into a bit of an issue with my serial connection. It seems like my pi is able to open a one-way communication path to the pi. When i run mavproxy.py, i get a return that the UAS is in stabilize mode, and "fence breach" and "online 1", but it doesn't do much else, or respond to commands. Any help? running a PI 3 and 2(tested both) with direct connection to the telemetry port on an APM 2.6 via GPIO on the PI.

Posted a reply on there.

benbojangles said:

tech questions go here:http://discuss.ardupilot.org/t/companion-pi-2-3-zero/9460

Brad Goodall said:

I'm running into a bit of an issue with my serial connection. It seems like my pi is able to open a one-way communication path to the pi. When i run mavproxy.py, i get a return that the UAS is in stabilize mode, and "fence breach" and "online 1", but it doesn't do much else, or respond to commands. Any help? running a PI 3 and 2(tested both) with direct connection to the telemetry port on an APM 2.6 via GPIO on the PI.

Seems over at ardupilot.org they've started to pick up on UDP data & video systems using companion boards too. Wonder if http://enroute1.com/ found any of this information here useful for their identical project.


http://discuss.ardupilot.org/t/introducing-apsync/14302

http://ardupilot.org/dev/docs/apsync-intro.html

I'm currently running a Pixhawk with a PDB+Power module combo unit (specifically: http://www.ebay.com/itm/262694415709) and I want to add a RPi Zero W + Pi camera module for OpenCV.

Anyone here have any experience powering a RPi from a PDB?

The 5V output on the PDB is regulated but I just want a heads up on any potential issues I might run into.

I'm leaning towards sacrificing a spare microUSB cable; less chances of frying something.

Straightforward or add a fuse somewhere?

@xemone that's a really neat PDB.  You should have no problem going from regulated 5v output straight to the IO gnd/vin pins.  If you want to be paranoid you can go in through the usb as it provides extra protection and polyfuse, but really no need from the PDB BEC.

BTW, don't expect too much performance from pi zero + opencv!!!

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service