In case you're looking for an optical flow sensor, there is now one available in the DIYDrones store for a penny under $40.
This sensor is based on the ADNS3080 mouse sensor which is a good choice for optical flow because:
high resolution: 30 x 30 pixel frames meaning it can see features that lesser mice cannot
high speed: 2000 to 6400 frames per second update rate which contributes to better low light performance than other mouse sensors
SPI interface meaning it can be interfaced to many micro controllers and co-exist with other sensors
Other features:
- Intended to interface with a 5v microcontroller.
- 8mm lens with 11 deg FOV
- Standard M12x0.5 lens mount meaning you can replace the lense easily if required
Instructions for connecting the sensor to your APM/Oilpan are here.
Things to be careful of:
- Performs best outdoors in well lit environments
- Does not play well with Fluorescent lights (the blinking throws off the sensor)
- Needs a somewhat varied surface to see movement (plain carpets are not it's friend)
Uses including odometry and obstacle avoidance but I've used it mostly for horizontal position hold.
Note: integration with ACM and the existing GPS pos hold is a work-in-progress but should hopefully be completed in a few weeks. Here is a video of a slightly modified version of the ACM code using only optical flow (and sonar for altitude hold).
Inspiration and some technical help especially early on came from Marko Klein Berkenbusch and his blog on position hold with mouse sensor.
Hope you like it, all comments welcome!
Comments
Ps, Ammar - im out on the field tomorrow, I'll disable gps, set a few close together waypoints and see what happens with just the optflow enabled and report back, provided of course the quad does not suddenly take a trip to the stratosphere ;)
I realise this may not work at all and may require GPS active/blended in, but hey you never know my idiotic approach might produce some interesting results :)
Hi All,
I'm a complete noobie to all this but am learning fast thanks to everyone's efforts to date - I am very impressed with all this i gotta say :)
Anyway, I'd just like to let you know that I have gone from not even knowing what arduino was a month ago to successfully building and flying and fiddling with an arducopter v1.4 and, more relevant to this post, setting up and testing this optical flow sensor. So if you are in the same boat as me - i.e. just started out and have not a clue, then please feel free to ask me the 'stupid' questions. I will try to help wherever i can to free up the real experts to carry on the good work
Thanks again everyone, this is an excellent project :D
Thanks for the tip Randy. My surface quality values were really low initially. With good sunlight in the room I can see the values changing with movement.
So my ultimate goal is to use this sensor to get odometry values(translation) of the quadrotor so I can program it to fly short missions outdoors without necessarily using a GPS. Could I know what the accuracy of the translation (or odometry) values for this sensor are, say for an altitude of 1-1.5meters? In other words, can I program the quad to traverse 1m forward using the optical flow ?
Hi Ammar,
I'm still working on getting it integrated into the latest code and although it's taking longer than i predicted I'm making progress. I checked in a chunk of code over the weekend and hope to complete the rest of it this weekend (hopefully).
So the image is appearing correctly but the x,y values aren't changing? Note that after capturing an image, you need to reset the sensor (i.e. disconnect/reconnect power) to get it back into it's normal state where it returns movement.
Can i also ask what surface quality value you're seeing? it needs to be over 10 or 20 to see movement so maybe you're in too dark a room? Try pointing it at a computer screen perhaps.
Hi Randy, I wanted to inquire on the current status of the optical flow sensor integration with GPS waypoints?
Also while running the Opt Flow test script, what is the x,y translation range I would observe? As of now I do not see much translation being detected. However I plot the image the optical flow captures and it seems reasonable.
Now unfortunately the code is still a bit of a work in progress but it's getting close and hopefully I'll have a version you can play with in a week or so. Best to start with wiring it up according to the wiki.
If you know how to upload code using the arduino ide you can check the focus of your lense by uploading the example sketch (see testing the sensor on that same wiki page).
If you're loading the code through the arduino ide you can add this line to APM_Config.h and try regular LOITER:
#define OPTFLOW_ENABLED
If the code fits on the 1280 it should work. It didn't use to fit but let me check the size of trunk.
I got my sensor today! How can I test it out on my copters? I have the code loaded and enabled on my 1280 and 2560 apms. Is there any reason why it will not work on a 1280 if it fits? I have sonars on both as well. I have 2.0.54 loaded from the arducopter downloads.
Well, the indoor thing probably won't work unless someone can find a lens with a very low "fstop" value. The current one has an fstop value of between 1.8 and 2.0 apparently.
Hopefully we can eventually get it working well with the GPS. Perhaps using the GPS to get us within a meter or two of the target (the limit of the accuracy of the GPS) but then use the OFS to hold us still in one place.
That sounds exciting Randy! Thanks for creating this cool sensor. Just a quick point though. Will I (eventually) be able to use it with GPS for waypoint navigation? Or may be just use the OFS to go to waypoints(I mean indoors, like go 5m straight etc..)?
Ammar,
Thanks for your support.
You are in the first batch of people to get the sensor so you're quite close to the bleeding edge :-). I'm hopeful that once we get all the integration into the arducopter code complete (it's well under way, just needs a little more merging and testing) that you should be able to reproduce the performance in the videos. It should be far better than GPS at position hold at least at low altitudes. I'm also working on an "auto-trim" feature for stabilise mode that I hope will make the copter mostly stop in it's tracks when you let go of the sticks.
The weakness of the sensor is it's low light performance, flourescent lights and plain carpets so it won't be much good indoors.
There are other uses too though..I've seen examples of people using it on cars (and a skateboard!) for odometry so I imagine some people entering the sparkfun avc in april could use one (with a shorter-focus lens).