Page 1 of 1

Measure distance between Pi's

Posted: Thu May 22, 2014 8:24 pm
by Palkab
Hello,

I am a researcher based in the Netherlands working in the field of traffic safety. We are currently planning a research project into the effects of fatigue, stress and a couple of other factors on group dynamics within a group of racing cyclists.

In order to gather the data we need, we have to find a way to map the location of all members in a group of cyclists in real-time. Is there a way to measure the distance between two (or rather; multiple) raspberry pi's (not ultrasonically)? That way we could equip every cyclist with a RPi-powered measuring device, determine the distance between every few seconds, and create a time-based data map of the internal dynamics within the group. The measurements need to be rather accurate (error margin of a few cm at most), so GPS would not work adequately.

I'm afraid we are not very familiar with the Raspberry Pi (just some hobbyists), so any help would be appreciated.

Kind regards
Paul

Re: Measure distance between Pi's

Posted: Thu May 22, 2014 11:02 pm
by elatllat
You are pretty much limited to EM or sonics.
Ultra or sub sonic can give high accuracy due to it's relatively slow propagation speed.
EM ( or RF like GPS) is lower accuracy unless you have a really fast chip.
so on to other less direct options, distance by smell is underdeveloped and not good for moving objects,
but because you are moving you could count the rotations of your wheels and use that as a measure of distance.
that would not be perfect if people do not follow exactly the same path but you could have low power RF waypoints that would resynchronize every ones calculated position/clock.
or if your in a group that is close enough together you could task a drone to follow you and video the groups progress from above. RF direction is less hard than RF distance making it easy for a drone to track a signal, you could also keep tabs on who is in front of you or behind you with the direction thing but I'm guessing that's less useful than knowing distance.
or you could just have 2 drivers video the front and back of the line with a few video recording waypoints(guy with smartphone).
you could also get distance from angle via triangulation/biangulation if you put a device on the end of an ~3m antenna on each bike.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 12:34 am
by FLYFISH TECHNOLOGIES
Hi Paul,
Palkab wrote:Is there a way to measure the distance between two (or rather; multiple) raspberry pi's (not ultrasonically)?
I'd start brainstorming about details using the following bullets:
- optical recognition with camera (NoIR camera might be preferred over normal visible one),
- each cyclist would have a pair of (IR) LEDs (alias beacon) mounted at the back side (like rear light, but LEDs are fixed on a precise distance apart)
- camera on each bicycle scans front area and extracts (IR) LED dots from pictures
- distance between these two dots on the picture is related to distance between the camera and LEDs
- each cyclist (= pair of LEDs) has its exclusive short timeslot when the LEDs are switched on (to get the information which cyclist's LEDs dot are present on the picture at a particular moment)
- you need to provide time synchronization of all nodes (wireless heartbeat information sent by one device to all others is mandatory)
* optionally, you can increase data quality by duplicating this complete system (LEDs and camera) to both front and back side.

This principle covers well cases when cyclists are driving one behind another. When somebody takes solo path, you could detect it either by few cyclists from the back (LEDs pair would be within scanning angle on far left/right area), from few cyclists in front (when you have duplicate scanning to both sides), or optionally from the accompanying car(s).

When one camera detects a pair of active LEDs at one moment, you get relative information of two cyclists, LEDs holder and camera holder. By combining received data you can get the data about positions and distances.

Yes, I know I've wrote just few basic ideas without implementation details, but this might be a good starting point for you anyway... If you need some additional details, feel free to ask.


Best wishes, Ivan Zilic.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 2:29 am
by elatllat
The advantage to IR/visible is that cameras are common but using the IR part of EM might not be the best choice as it's easy to obstruct and vibration / fast motion might blur camera sensors... might work but I would opt for a less obstructable range of EM.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 2:42 am
by FLYFISH TECHNOLOGIES
Hi,
elatllat wrote: but using the IR part of EM...
What "EM" stands for ?
Electro-mechanical, electro-magnetic, electrical measurement ... ?


Best wishes, Ivan Zilic.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 6:21 am
by Palkab
Thank you so much for taking the time to respond to my question. You have given some very useful ideas. I'm going to build a few different set-ups and try them for accuracy. Will let you know how it goes in a few weeks!

Kind regards,
Paul

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 10:36 am
by BMS Doug
FLYFISH TECHNOLOGIES wrote:Hi,
elatllat wrote: but using the IR part of EM...
What "EM" stands for ?
Electro-mechanical, electro-magnetic, electrical measurement ... ?


Best wishes, Ivan Zilic.
Electro-Magnetic.
Visible light falls into a very narrow band of the Electro-magnetic spectrum, Infra red takes a broader segment.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 10:42 am
by FLYFISH TECHNOLOGIES
Hi,
BMS Doug wrote:Visible light falls into a very narrow band of the Electro-magnetic spectrum, Infra red takes a broader segment.
... which is narrowed down by the camera sensitivity characteristics, I'd suppose/expect.


Best wishes, Ivan Zilic.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 12:04 pm
by BMS Doug
FLYFISH TECHNOLOGIES wrote:Hi,

... which is narrowed down by the camera sensitivity characteristics, I'd suppose/expect.


Best wishes, Ivan Zilic.
Absolutely, the individual camera specifications would define the range, but cameras tend to have a broader range than the human eye (which determines the definition of the visible spectrum). for example you can check to see if an Infra red LED operates using a normal digital camera.

Re: Measure distance between Pi's

Posted: Fri May 23, 2014 9:36 pm
by mikerr
You could try a few of these IR rangefinders
https://www.sparkfun.com/products/8958
(max range 1.5m )

or use laser rangefinders for longer distance:
http://www.amazon.co.uk/Bosch-DLE40-40m ... B002LJF7YM
https://sites.google.com/site/todddanko ... ser_ranger