Palkab
Posts: 5
Joined: Thu May 22, 2014 7:54 pm

Measure distance between Pi's

Thu May 22, 2014 8:24 pm

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

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Measure distance between Pi's

Thu May 22, 2014 11:02 pm

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.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Measure distance between Pi's

Fri May 23, 2014 12:34 am

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.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Measure distance between Pi's

Fri May 23, 2014 2:29 am

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.
SBC with 32GB RAM: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Measure distance between Pi's

Fri May 23, 2014 2:42 am

Hi,
elatllat wrote: but using the IR part of EM...
What "EM" stands for ?
Electro-mechanical, electro-magnetic, electrical measurement ... ?


Best wishes, Ivan Zilic.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

Palkab
Posts: 5
Joined: Thu May 22, 2014 7:54 pm

Re: Measure distance between Pi's

Fri May 23, 2014 6:21 am

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

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Measure distance between Pi's

Fri May 23, 2014 10:36 am

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.
Doug.
Building Management Systems Engineer.

User avatar
FLYFISH TECHNOLOGIES
Posts: 1750
Joined: Thu Oct 03, 2013 7:48 am
Location: Ljubljana, Slovenia
Contact: Website

Re: Measure distance between Pi's

Fri May 23, 2014 10:42 am

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.
Running out of GPIO pins and/or need to read analog values?
Solution: http://www.flyfish-tech.com/FF32

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Measure distance between Pi's

Fri May 23, 2014 12:04 pm

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.
Doug.
Building Management Systems Engineer.

mikerr
Posts: 2825
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Measure distance between Pi's

Fri May 23, 2014 9:36 pm

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
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Return to “General discussion”