Close

Commute Guardian Firmware/Software Prototype Working!

A project log for Luxonis DepthAI

Spatial AI Meets Embedded Systems

brandonBrandon 02/08/2019 at 18:127 Comments

Hey guys and gals!

So the 'why' of the AiPi (that satisfyingly rhymes) is we're actually shooting for a final product which we hope will save bicyclists lives, and help to make bike commuting possible again for many.

Doing all the computer vision, machine learning, etc. work I've done over the past year, it struck me (no pun intended) that there had to be a way to leverage technology to help solve one of the nastiest technology problems of our generation:

A small accident as a result of texting while driving, a 'fender bender', often ends up killing or severely injuring/degrading the quality of life of a bicyclist on the other end.

This happened to too many of my friends and colleagues last year.  And even my business partner on this has been hit once, and his girlfriend twice.

These 'minor' accidents (were they to be between two cars) resulted in shattered hips, broken femurs, shattered disks - and then protracted legal battles with the insurance companies to pay for any medical bills.

So how do we do something about it?

Leverage computer vision + machine learning to be able to automatically detect when a driver is on a collision course with you - and stuff that functionality into a rear-facing bike light.  So the final product is a dual-camera, rear-facing bike-light, which uses object detection and depth mapping to track the cars behind you - and know their x, y, and z position relative to you (and the x, y, and z of their edges, which is important).

What does it do with this information?  

It's normally blinking/patterning like a normal bike light, and if it detects danger, it does one of two actions, and sometimes both:

1.  Starts flashing an ultra-bright strobe.

2.  Honks a car horn.

So case '1' occurs when a car is on your trajectory, but has plenty of time/distance to respond.  And example is rounding a corner, where their arc intersects with you, but their still at distance.  The system will start flashing, to make sure that they are aware of you.

And if the ultra-bright strobes don't work, then the system will sound the car horn with enough time/distance left (based on relative speed) for the driver to respond.  The car horn is key here, as it's one of not-that-many 'highly sensory compatible inputs' for a driving situation.  What does that mean?  It nets the fastest possible average response/reaction time.  

So with all the background out, we're happy to say that last weekend, we actually proved out that this is possible, using slow/inefficient hardware (with a poor data path):

What does this show?

1.  You can differentiate between a near-miss and a glancing impact.

2.  The direct impact fired a little late, mainly just as a result of the 3FPS that this prototype is running at (as a result of a poor data path).

What does it not show?

1.  Me getting run over... heh.  That's why we ran at the car instead of the car running at us.  And believe it or not, this is harder to track.  So it was great it worked well.

And the following shows what the system sees.  

Keep in mind that using the Myriad X hardware more completely (only the neural engine, which is 1 TOPS, is being used, the other 3 TOPS are unused in the NCS form-factor), the frame rate bumps to ~30FPS.  The Raspberry Pi is having to do video processing/resizing/etc. here and  - all of which that the Myriad X has dedicated hardware for, but can't be leveraged in the NCS formfactor.

So the AiPi data path (cameras directly to the Myriad X) allows all this hardware to be used, while completely removing the burden of the Pi having to massage/pass-around/etc. video feeds.  So it's a huge benefit in terms of speed.

Here's me initially testing it, figuring out what thresholds should be, etc.  

I wanted to do it on a super-strange vehicle, to prove how robust at the computer vision is at detecting objects.  So this is the 'strange' vehicle I used, and it worked great!

To learn more about CommuteGuardian, feel free to check out commuteguardian.com, and also be a first-poster on the forum if you have ideas/questions.  And bear with us, it's just going up now.

Best,

Brandon

Discussions

Capt. Flatus O'Flaherty ☠ wrote 02/09/2019 at 11:08 point

Good idea. As someone else who has been knocked off bike by car, I'd like to suggest that your horn / back light system will not work. Instead, go one step further and create a vest or jacket with addressable LEDs sewn in on the back and message the driver 'BACK OFF' or 'YOU ARE ON CAMERA' or both in sequence. 

After my incident, I scrambled for a pencil and tried to write down number plate of car then phoned the cops. I was a bit flustered so got it wrong, so you also need number plate recognition, which is already in the NCSappzoo, so add: 'YOUR PLATE: XXXXXXXX' to the LED message above.

  Are you sure? yes | no

Brandon wrote 02/09/2019 at 18:15 point

Thanks!  Yes, it can definitely do license plate recognition and automatic saving/notation when you’re hit or even at elevated risk. 

  Are you sure? yes | no

Brandon wrote 02/09/2019 at 18:21 point

Also watch the LOUD Bicycle video on the Kickstarter here:

https://www.kickstarter.com/projects/lansey/loud-bicycle-car-horns-for-cyclists

This is manually triggered but the point is look at how quickly people respond to a car horn.  It’s called a ‘highly sensory compatible input’ for the condition of people driving.

  Are you sure? yes | no

Capt. Flatus O'Flaherty ☠ wrote 02/09/2019 at 19:57 point

I watched the link with the LOUD bicycle horn and it does seem very effective. The video show how well drivers react when approached head on by the cyclist. Horns are not normally associated with rear facing warnings, which is where your idea comes in, and drivers might be a bit confused, unless the cyclist were to simultaneously turn around and gesticulate appropriately.

After my own 'incident' I tried using an air horn, which was incredibly loud, but I stopped using it as it made me feel like a bit of an ass (even more than normal). I'll have to ask some of my cyclist friends why they dont use loud horns. I've never heard one in use, but then again I'm always very respectful of cyclist on the road.

Just for now, I'd say horns for the front and an LED sign for the back, but, again, I'll ask some other cyclists :)

  Are you sure? yes | no

Brian wrote 02/08/2019 at 21:15 point

Woo hoo! Great work, Brandon! I'll hopefully be able to get a lot of the schematic for the AiPi done this weekend, and we can start talking form factors (beyond CM3 compatibility), connector styles, and peripherals. If anyone else has input on what they'd like to see, feel free to comment!

  Are you sure? yes | no

Capt. Flatus O'Flaherty ☠ wrote 02/09/2019 at 10:56 point

Probably a stupid question, but can you implement USB 3?

  Are you sure? yes | no

Brian wrote 02/09/2019 at 15:14 point

We're planning on USB3 compatibility, yes. Mainly to support using the board as a USB device, and to allow communication with the device through that avenue. The Movidius sticks are all USB-based right now, so going through the USB interface into a PC should be relatively simple to set up with the SDK (and on our board). If you're going to use the RPi as a host, you'll be limited to USB2, of course, but as I'm sure you know, it would be backward compatible. 

Thanks for the questions, though! We're building and learning as we're going, so the more eyeballs on this, the better! 

  Are you sure? yes | no