XuMePa
Posts: 3
Joined: Thu Mar 15, 2018 8:38 am

Position Triangulation

Sun Jul 01, 2018 12:24 pm

Hello everyone, i have unsuccessfully searched quite a lot for something i could use for my project, but all i have found is just too expensive for me - pozyx or estimote

Basically i am equipping two RC Cars with raspberry 3 each and i want to find a way to correctly determine their position as they constantly move indoors.
I am uncertain as to what i could use to do that.
I have been considering putting beacons in the form of either rasperry or some arduino with uwb modules (as this actually turns out to be cheaper than the two options i had) and use them to trilaterate the RC's positions.

I have been thinking to use the in-built bluetooth of the pi 3 but so far but i have not managed to get the bluez working on either my laptop or the pi. As for the wifi - the update on the distance between the pi and router (otherwise i can just put 3-4 routers around and triangulate that way) is so slow i have time to make and drink my coffee before it updates the rssi.

It is of course very possible that im doing everything wrong and thats why i cant get any proper reading out of anything.

Since i still am uncertain as to what path to take i decided to write here and maybe someone more knowledgeable could shred some light.

Thank you

User avatar
Ronaldlees
Posts: 294
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: Position Triangulation

Sun Jul 01, 2018 3:11 pm

You could do as the department stores do when they zero in on a customer. Use OpenCV, and paint each car a different bright color (the department stores use facial recognition, but that's not needed here). Then program your OpenCV to recognize the bright color and register a position. You might be able to have medium accuracy, depending on the setup, angles, lighting, etc.

I think RSSI is going to be much too coarse, personally.
I am the Umbrella man

User avatar
Ronaldlees
Posts: 294
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: Position Triangulation

Sun Jul 01, 2018 3:16 pm

BTW: Welcome to the forum!
I am the Umbrella man

XuMePa
Posts: 3
Joined: Thu Mar 15, 2018 8:38 am

Re: Position Triangulation

Sun Jul 01, 2018 3:27 pm

Thank you for the welcome :)

i did consider using something like this and perhaps this may actually become my last resort.
The reason why i avoided it was that i want to create an environment similar to real world cars where they are using GPS
with the idea to see if i can mimic this environment in a smaller scale, and if possible try to test it with two vehicles and better connectivity between them than wifi.

I should have mentioned this earlier but i forgot :/

User avatar
Ronaldlees
Posts: 294
Joined: Sat Apr 16, 2016 4:28 pm
Location: North Carolina, US
Contact: Website

Re: Position Triangulation

Sun Jul 01, 2018 3:41 pm

Well, GPS itself is pretty inaccurate at this level. When dealing with ranges of a few feet, it's gonna be unpredictable. That's probably why the stores rely on OpenCV style facial recognition, IR photon emitters, and such, rather than something like GPS, which most folks would have in their cell phones.

RSSI is fairly inaccurate as well. Can be enhanced with triangulation, but as you said it would not be speedy. RSSI by itself would be very ballparkish IMO.
I am the Umbrella man

User avatar
The Traveler
Posts: 360
Joined: Sat Oct 21, 2017 3:48 pm

Re: Position Triangulation

Sun Jul 01, 2018 3:48 pm

i want to find a way to correctly determine their position as they constantly move indoors.
Inertial navigation. You have to track time, speed and direction of the vehicle(s) then triangulate position against known fixed reference points. So you start with data logging both vehicles. Then you calculate each position using mostly trigonometry functions from that data and make comparisons against each vehicle and a reference point. It's not trivial to do.

If you want to pursue it, I'd suggest working out a software simulation first. You can use a library like pygame to create a 2d environment and then simulate the movement of your vehicles in it. Work out the trig functions (any good book on navigation will have the formulas) and then translate your work to your real world problem.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

XuMePa
Posts: 3
Joined: Thu Mar 15, 2018 8:38 am

Re: Position Triangulation

Sun Jul 01, 2018 4:23 pm

Hello,

The thing is that i already have the RC done, and the triangulation is a fairly easy job, basic maths the way i see it.

The only problem that im having is what to use as beacons to get a distance between two raspberries (or a raspberry and anything actually).
The requirements of these 'beacons' are to be able to relatively accurate measure distance, and to be able to do this at least once a second.

As for the inertial navigation, i must say i didnt think of that, but seems a bit of an overkill, although not impossible for sure, another thing to consider, thank you :)

User avatar
The Traveler
Posts: 360
Joined: Sat Oct 21, 2017 3:48 pm

Re: Position Triangulation

Sun Jul 01, 2018 5:00 pm

The requirements of these 'beacons' are to be able to relatively accurate measure distance, and to be able to do this at least once a second.
A transponder in the vehicle can help with distance but doesn't do anything for direction. Basically you need an antenna that sweeps an area and can provide the angular data to the target along with the return time data from the transponder.

Another way is to try mounting an ultrasonic unit on a rotatable azimuth mount and try and range the vehicle that way. You could get distance by calculating pulse time and return and direction from an encoder on the azimuth mount. It's somewhat simpler but I don't know what the effective range of the ultrasonic unit is. https://www.modmypi.com/blog/hc-sr04-ul ... spberry-pi

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
The Traveler
Posts: 360
Joined: Sat Oct 21, 2017 3:48 pm

Re: Position Triangulation

Sun Jul 01, 2018 6:05 pm

Thinking about this more, frankly, the inertial navigation solution may be the least expensive and the most simple to implement.

Raspberry Pi 3 or better with a sensor hat board per vehicle
Local wifi network.
Laptop or desktop with a decent CPU.

1. Set up the RPi and PC/laptop on the same network.
2. Setup and calibrate the RPi sensor hat(s), (we're interested in using the accelerometer and gyroscope.)
3. Every second read the data from the accelerometer and gyro.
4. Transmit time, accel reading and gyroscope to your PC/laptop via wifi
5. Extract the timestamp, accel and gyro data and process it.

You can calculate and extrapolate the distance by using the acceleration and time data, the direction from the gyro as a compass. By comparing the immediate past data to the current data the position of the vehicle is known. This is simpler than trying to sync time signals with a beacon because all we need is the time stamp from the vehicle, the positional data relates to the vehicle time. It's a simple matter than to plot the position of either vehicle in 2D or calculate the relative positions of one to the other.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Sun Jul 01, 2018 6:34 pm

I second Ronaldlees suggestion of OpenCV and coloured blob tracking. It is mechanically simple, fast and accurate.

You could think of the overhead Pi & camera as a 'gps' system beaming position info down to Earth.

Rang finders using ultrasonics or LIDAR to make maps would work but is more expensive and more complex.

Dead reckoning works but errors accumulate so you really need to keep re-zeroing the postion to some known fixed points.

RSSI is likely to be very inaccurate.

Ultrasonic time of flight from fixed beacons is cheap but it could be complex to deal with multiple reflections and indirect paths that would give significant errors.

You could use IR beacons and a rotating directional opto sensor to get bearings to multiple beacons on line of sight, That also could be cheap, accurate and simple to process but it's mechanically and optically complex, slow and subject to lots of potential failures from extraneous lights or obstacles blocking beams.

User avatar
The Traveler
Posts: 360
Joined: Sat Oct 21, 2017 3:48 pm

Re: Position Triangulation

Sun Jul 01, 2018 8:07 pm

You could think of the overhead Pi & camera as a 'gps' system beaming position info down to Earth.
As the OP mentions this is indoors, he doesn't specify whether the vehicles are confined to a single room. Two other aspects would be how high does the camera need to be placed to observe the operating area and second, what is the field of view of the camera? I can see some merit in your suggestion, but a few details are still lacking.

Cheers.
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
OutoftheBOTS
Posts: 711
Joined: Tue Aug 01, 2017 10:06 am

Re: Position Triangulation

Sun Jul 01, 2018 9:55 pm

The reason why i avoided it was that i want to create an environment similar to real world cars where they are using GPS
GPS has accuracy of a few meters, your after accuracy of a few centimeters meaning you will need super accurate sensors. This is likely to reduce option and push up price.

The OpenCV is defiantly a easy feasible option. You could use colour blobs more usually robotics will use april tags (april tags r something like a QRcode but much more readable by computer vision on a moving robot at speed) see this pretty cool example of someone that uses ESP8266 controlled robots running micrpython and openCV running on a pc to send all the location of everything to the robots in real time https://www.youtube.com/watch?v=EDdLU_PYheY

With april tags because you print them out an exact size and square it maens the OpenCV detectors will know the distance they are away and the angle the are at in 3D see this demo https://www.youtube.com/watch?v=Y8WEGGbLWlA

User avatar
Gavinmc42
Posts: 3479
Joined: Wed Aug 28, 2013 3:31 am

Re: Position Triangulation

Mon Jul 02, 2018 1:38 am

I have been waiting for the long range version of the VL53L0X to come out.
https://www.adafruit.com/product/3317

The 4m range one is finally out
https://www.sparkfun.com/products/14722
It has a few extra features like 4x4 array.

The 1-2 meter one is good only for very small rooms but mostly drone hovering.
With a 4m range you can measure distance to walls in most home rooms.
With compass chip and some scanning you could triangulate a position.

Bigger rooms need better Lidars
https://www.sparkfun.com/products/14588
Scanning Lidars are a pain and expensive, due to the moving wiring unless a rotating mirror is used.
You could make a simple one by using 2-4 x VL53L1X and RC servo scan 180-90 degrees.

Retro reflective tape in fixed locations can be used with a simple scanning sensor.
Basically they act as passive beacons, active beacons perhaps with BLE are doable.
Use Microbits as beacons?

Wonder what sort of range a VL53L0X will get with retro reflective tape?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Mon Jul 02, 2018 8:05 am

Range finders are good for mapping clearance to nearby objects but they don't give you position directly. Does anyone have suggestions for easy wasy to get from, say, LIDAR readings to high res Lat, Long position in arbitrary environments?

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Mon Jul 02, 2018 8:15 am

The Traveler wrote:
Sun Jul 01, 2018 8:07 pm
You could think of the overhead Pi & camera as a 'gps' system beaming position info down to Earth.
As the OP mentions this is indoors, he doesn't specify whether the vehicles are confined to a single room. Two other aspects would be how high does the camera need to be placed to observe the operating area and second, what is the field of view of the camera? I can see some merit in your suggestion, but a few details are still lacking.

Cheers.
There are well known techniques for calibrating multiple cameras to give uniform grid position over arbitrarily large areas. Wide angle views can be corrected to flat planes. These are complications but not serious problems.

Automatic LIDAR mapping could be more flexible in unknown environments since it can operate from the vehicle itself. But there are quite a few details lacking there. Do you know an effective easy to use mapping and navigation system using LIDAR? How well does such a system maintain accuracy over longer routes?

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Mon Jul 02, 2018 10:08 am

PiGraham wrote:
Mon Jul 02, 2018 8:05 am
Range finders are good for mapping clearance to nearby objects but they don't give you position directly. Does anyone have suggestions for easy wasy to get from, say, LIDAR readings to high res Lat, Long position in arbitrary environments?
maybe this is useful:

https://www.roboticstomorrow.com/articl ... otics/7270

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Mon Jul 02, 2018 10:14 am

This paper covers using overhead cameras to track multiple units.
http://cgi.cse.unsw.edu.au/~robocup/201 ... ameras.pdf

User avatar
Gavinmc42
Posts: 3479
Joined: Wed Aug 28, 2013 3:31 am

Re: Position Triangulation

Mon Jul 02, 2018 12:55 pm

Indoor a lidar can be used to make a map of the room.
Machine learning to get a room map, wall/door verses furniture.
Smart Roomba.

Downwards pointing mouse sensor to act as odometer.

This sensor has always interested me.
https://ams.com/tmg4903
What is Mo-beam and can it be used as a beacon?

Printed 1D and 2D barcodes stuck around the room have been used before.

Upwards facing camera and roof projected light pattern - Northstar.
https://www.robotshop.com/media/files/P ... manual.pdf

Structured light projectors, like MS Kinect
https://ams.com/parsenn
https://ams.com/belice
Use the Pi NOIR camera with visible light block filter.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

PiGraham
Posts: 3568
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Position Triangulation

Mon Jul 02, 2018 1:02 pm

Gavinmc42 wrote:
Mon Jul 02, 2018 12:55 pm

Printed 1D and 2D barcodes stuck around the room have been used before.

Upwards facing camera and roof projected light pattern - Northstar.
https://www.robotshop.com/media/files/P ... manual.pdf
Now those two together could make a nice solution. Stick markers to the ceiling and track those from a camera on the vehicle. A bit like how the ancient mariners did it by looking at the stars, but without the complications of rotation of the Earth.

It reminds me of Shaper Origin that uses symbols on tape stuck to a plane surface to locate a cutter very accurately as the router is moved by hand.

User avatar
The Traveler
Posts: 360
Joined: Sat Oct 21, 2017 3:48 pm

Re: Position Triangulation

Mon Jul 02, 2018 1:06 pm

Discussing LIDAR, interesting article on HACKADAY from 1/16: https://hackaday.com/2016/01/22/how-to- ... pberry-pi/

Cheers
Retired IT professional, C programmer and "beardie weirdie".
RPi interests: Developing an Infinite Improbability Drive
“Thinking outside of the box allows you to get rewards outside of your reach.” Matshona Dhliwayo

User avatar
Gavinmc42
Posts: 3479
Joined: Wed Aug 28, 2013 3:31 am

Re: Position Triangulation

Mon Jul 02, 2018 1:23 pm

Thanks for refreshing my memory, that Hackaday lidar has my attention now.
Combine a VL53L1X with a rotating mirror.

NOIR Camera and VL53LX1 on brushless servo gimble.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
bensimmo
Posts: 4129
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Position Triangulation

Mon Jul 02, 2018 1:50 pm

What about setting up some LoRa style base stations at known fixed points.
Giving each station a time stamp and then using various methods to triangulate position.

This would also have the advantage in that you can move your finding out into the 'SmartCity' and use LoRa stations out in the wild..


Another possibility is mix in some Micro:bits, they have built in sensors, they also have Bluetooth. But that can be turned to a Radio transmitter/receiver so they can talk to each other.
You may be able to do something with that.

Some serious talk on LoRaWAN and triangulation
https://www.thethingsnetwork.org/forum/ ... lation/435


https://lancaster-university.github.io/ ... bit/radio/

Return to “Automation, sensing and robotics”