A cool project from Kaz Kojima uses an OpenMV cam to track a drone, like a poor man's Vicon system:

openMV+ESP32

Screen shot of opemMV IDE

led tracker

I've tried to make a simple and budget local positioning system with openMV cam for the indoor flight of tiny copter. Looks not so good precision but not so bad as a Poor Man's system. A LOITER and LAND flight test with my hachidori copter is here:

A test flight

where only throttle work is done.

System is simple

figure

OpenMV cam with fish-eye lens has been set at the ceiling and it tracks LED markers mounted on the copter. The tracking data is sent to the host PC via ESP32 connected to openMV cam as a SPI slave device. The host PC also connects to the telemetry port of ArduCopter and is getting ATTITUDE packets and estimates the position and heading with the visual markers and ATTITUDE information.

The result of estimations are sent back to the telemetry port with VISION_POSITION_DELTA packets.

Currently, openMV data rate is 40-50fps, ATTITUDE rate 20Hz and VISION_POSITION_DELTA rate is same with cam.

The coordinate of marker on image sensor is converted to the 3D direction from cam and the height is estimated with the distance of markers and the attitude. I'm using geometric algebra in very primitive way to compute them. Kalman filter is applied for smoothing. Here is a test result of 3D positions got when moving the copter by hand.

3D spur

visual yaw estimation

Unfortunately yaw angles based on the compass of the copter are too unreliable in my case. The copter uses coreless motors which can easily break compass measuring and there are many other problematic magnetic sources in my room. The visual yaw estimation is used instead.

When the pitch angle isn't zero, the direction seen from cam and the real horizontal direction differs. The figure below represents this situation:

headings

where w is the real heading vector and v is the vector can be seen as the horizontal direction from cam. w = (v' rotated with pitch angle) and H is a plane including v, w and cam. A simple geometric algebra computation helps again.

headings

This figure shows that computation in geometric algebra. Essentially, vector w can be obtained as the one of the point pair which is the "meet" of the yellow circle K and the green plane H. The corresponding program is fairly straightforward. See host program for details. Of course, rotation matrices or spherical angles can be used for that computation.

All programs for openMV, ESP32 and the host PC are in my github, though they are experimental.

Happy Hacking,

Views: 1177

Comment by FMS RC airplane on March 5, 2018 at 8:49pm

Very good, i like

Comment by Tiziano Fiorenzani on March 7, 2018 at 8:08am

This is really cool!

Comment by Rana on March 10, 2018 at 6:47am

That's really nice!

Comment by Jack Crossfire on March 15, 2018 at 11:34am

Sort of funny to see an ESP8266 module with a bag of cables connected to it, just to say the autopilot is on the copter.  

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2018   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service