Ahhh... Winter in Canada ...
While the kids play hockey outside with sticks and a puck , I play inside with sticks and a POC !!
A few month ago I started experimenting with the Avoidance Library:
http://ardupilot.org/dev/docs/code-overview-object-avoidance.html
And I designed The POC : Proximity Obstacle Collision avoidance system based on an Arduino Pro Mini and VL50LX0 TOF rangefinders. This unit works pretty well, the only drawback is that it is shortsighted. This inexpensive Laser device is limited to a range of 1,7 Meter and it makes it hard to implement a fully functional Avoidance System.
Then came the Benewake TFMINI RangeFinder, that offers indoor range up to 12 Meter (6M Outdoor) for a price that makes the POC concept a reality. Some of you might have seen a previous Blog explaining how to make this RangeFinder talk I2C with the use of an Arduino:
https://discuss.ardupilot.org/t/how-to-make-the-tfmini-rangefinder-talk-i2c/24403
Configuration of the TFMINI-POC:
The actual prototype is using 4 TFMINI
One looking UP
3 Looking @ -45 Forward + 45
TFMINI are Serial devices and its quite difficult to multiplex serial without buffering.
I did some test with a Teensy 3.5 that offers 6 serial ports, but without handshake (hardware or software) its is quite difficult to have a stable unit, that can work in a variety of configuration and speeds (baudrate).
This is why I opted to ''transform'' the TFMINI into a I2C device. With the Use of Attiny85 we can read the serial flow @ 115200 and do all sorts of signal manipulation and store results in registers, ready to be consumed by the I2C bus. The controler is an Arduino Pro Mini that sequentially read the I2C devices and transmits over serial on a MavLink DISTANCE SENSOR message http://mavlink.org/messages/common#DISTANCE_SENSOR
ARDUINO CODE
You can download the code here:
https://github.com/patrickpoirier51/TFMINI-POC
To make a system set the I2C address for each ATtiny and you assign the corresponding vector to the I2C Address:
https://github.com/patrickpoirier51/TFMINI-POC/blob/master/TFMINI_I2C_MAVLINK/TFMINI_I2C_MAVLINK.ino#L147
SETTINGS
On Mission Planner you set Proximity and Avoidance (as per Avoidnce wiki above) and you can set the avoidance enabling using a transmitter switch, I used ch7 = 40 for Object Avoidance.
And this is how it goes in Alt-Hold Mode:
I use the transmitter to ''push'' the quad against the garage door and the avoidance system makes it ''bounce'' back. The harder we push , the harder it bounce back... just like a hockey puck....
I would like to thanks the development team and more specifically Randy Mackay for this excellent library that makes me play like a kid in these cold winter days ;-)
Comments
Yes I setted the distance to 1 Meter so I can ''pratcice'' in my garage.
The Tower is a great product and the integration as a PROXIMITY driver within ArduPilot makes it even more performant.
The idea behind the POC is to offer an easy to develop and integrate option to experimenters so they can test different type of sensors using the MavLink DISTANCE SENSOR.
Using a message based interface allow a diversity of configurations and signal processing ranging from the Attiny to a NUC I7
Best Regards
Impressive! Looks like you had some very close calls, probably due to sensor range. At Terabee we were doing lots of indoor flight experiments with TeraRanger Tower. We will try to share same results in the following days, maybe we can exchange notes :).
Excellent Patrick! Very good work.
Thanks Chris , for publishing my stuff :-)