Thursday 21 May 2015

Raspberry Pi 2 camera with AV/Composite out

So I've been thinking about adding a camera to my raspberry pi 2 board, ad using it to stream video to my android tablet recently. However, one can't just connect directly their fpv camera to this board.

Everyone knows that the Rpi2 uses a unique 15-pin ribbon cable for its camera-in port.

This means at the moment if you want to connect a camera quickly, and with no work, you have to buy the pi camera that is ready built with this 15-pin connector in mind.



But what if we could find a way to connect an existing composite/av camera to this port using a simple adapter board module?



Just how hard can this be? Just how hard can this be? Just how hard can this be? Just how hard can this be? Just how hard can this be? Just how hard can this be? Just how hard can this be? Just how hard can this be?

It would allow us then to use out trusty Sony CCD camera with the super-low latency that the Pi2 hardware-GPU camera processing, and allow us to also have CCD camera quality.

Here is the data schematic for the 15-pin CSI connector used on the pi camera:

Here is more information about the 15-pin connector on the CSI cable.
Here is how to stream pi camera to a smartphone:

Wednesday 20 May 2015

Ardupilot gamepad

So, in my pursuit to make my android GCS work with a gamepad, I have experienced some interesting introductory hurdles, but hurdles which all gamepads are experiencing.




My first and most ideal quest is to use a wikipad controller with my regular android tablet that I have. It was in a junk sale for $5, so I thought it might be a good thing to cut up and experiment with. I feel that it is an ideal shape and form for flying a drone with. It feels immediately comfortable in my adult-size hands.

I am hoping to enable QTgstreamerhud.apk with video via 4G:


What I have found with the wikipad (on a non-wikipad tablet) is that I can't get it to interface. It doesn't work with a usb-otg adapter, it doesn't work if I plug it directly, it doesn't work if I modify it with an HC-06 or HC-05 bluetooth adapter and connect through this. Why this is, I am unsure.

My initial plan was to plug it into the tablet, and use a controller mapper app such as tincore, to map the controls to those on the flight app such as VR pad/Andropilot/Droidplanner v1. But as such the wikipad is not functioning.

One google search on android tablets shows up that there is an issue with the bluetooth stack on android version 4.2. I am using this version of android on my tablet, so this might affect my ability to use bluetooth as a connection for a gamepad. To test this problem I also have a Nintendo Wiimote in my drawer that I tried to connect to my tablet. And, of course it will not connect. It connects to my windows laptop just fine.

To help me find some hope in this slowly descending project, I also have a Sony Playstation 2 controller with usb adapter that I use for PC laptop gaming sometimes. I know this controller works as I use it regularly. And sure enough, if I just plug it into my tablet using my USB-otg adapter it immediately works and I can control screen menu items. My optical mouse connects just fine in this way too. Hope..

So I can rule out bluetooth. It was probably going to increase control latency anyway.

But, I still like the wikipad form factor. It just feels like my perfect idea of a flight controller.

My next step, is to try to determine what is the difference between my working Playstation controller and the wikipad. Perhaps the wikipad controller has no HID interface chip on board? Perhaps they put the usb-host chip is inside the wikipad tablet and not the controller? Hmmm.

What can I do?

Well, I have an Arduino Pro Micro in a box somewhere... Perhaps I can use the ATmega32U4 chip it has to allow me to use it to connect directly over USB.

I guess it will be a full on gamepad DIY project. I will have to cut all gamepad switches and joystick wires, connect them the Arduino Pro Micro, map them as Digital-in or Analogue-in connections, and hope that this then works. there is no reason why it should not. I will then have a fully open usb controller.



Or, I could just use my Playstation 2 controller...But it has so much wire hanging off and no tablet mount. It just doesn't feel as good as a package.

I guess I could try to buy a wikipad tablet? But I don't want to spend $80+ for an experiment.

Wikipad options:
1) work on the USB interface
2) throw it in the trash, lose $5
3) try the bluetooth mod with a different tablet

Let's see.


Saturday 2 May 2015

Closer to this

So the projects that are cropping up in 2015 appear to be heading in this direction. We see the recent 3DR Solo & Phantom 3 release they look like:


But what is even more interesting in project development is more simple:





Why not use a SIM network?
Here we see the cheap 'wikipad' tablet and controller. Perfect for our needs:



Slot in the tablet, and connect to 3DR Services (we will create a joystick control addon app just like in Mission Planner). We will connect using Phone network + UDP. The communication with the drone happens over UDP, which is short for User Datagram Protocol. AT commands are text strings sent to the drone to control its actions through UDP. Just look to the AR Drone for an example.

We will setup the raspberrypi to work with 3G dongle. And also configure NAVIO+ board (or possibly the pixhawk 2 once released).

Now, you can fly as far as the battery will travel. Now you can receive video + telemetry data + send control commands from your new cheap controller.

2 developments need to happen:
1) The 3DR Services app to control flight with the wikipad.
2) The 3DR Solo app must be released or Droidplanner will include gstreamer for video.

So, it is all down to the 3DR community to deliver software? I think that the Raspberrypi + Navio is already developed.

How does this compare to today's drone prices? How will DIY drone builders adjust their setup?

I already have: 
LTE tablet
Wikipad
LTE Dongle

Required:
Raspberrypi (£25)
Navio+ board or Pixhawk (??? or $150??)

Bundle all together into f330 package:




I think not a crazy expensive idea.

Why?

Because I think the direction of this will lead to the elimination of the need for camera gimbals to make steady video. I think it will be done in software just like the AR Drone. Also, 5.8ghz gear will not be required - video monitors, transmitters, receivers, also telemetry modules will be redundant.

This will also make drones lighter and smaller, and able to fly a little bit longer (unless the power consumption of the navio & Rpi affect this).

Not time to yet to sell your Turnigy 9x, FPV equipment, and gimbals. But It is something to think about in a year or two; if you are not a hobbyist, just a consumer level drone flier.