Gps alarm
I have a custom boe-bot running a propeller + gps and would like to set a proximity alarm function. This would be essentially a radius the robot would monitor. Imagine the robot sitting in a parking lot. it Takes a GPS reading and calculates if it's inside the radius of a circle. If someone moves the robot day 100 feet it sounds an alarm.
My problem is the geometry and lack of knowledge to even Google for help.
As I understand it latitude and longitude are units of minutes and seconds. I also understand earth is not a sphere so I can't simply use the Pythagorean theorem. I can't figure out how many seconds make a foot as an example.
Please point me in the right direction as I'd like to make this function as accurate as possible.
My problem is the geometry and lack of knowledge to even Google for help.
As I understand it latitude and longitude are units of minutes and seconds. I also understand earth is not a sphere so I can't simply use the Pythagorean theorem. I can't figure out how many seconds make a foot as an example.
Please point me in the right direction as I'd like to make this function as accurate as possible.
Comments
good luck with your project.
-Phil
From there it's relatively simple: The circumference of a circle is 2*PI * Radius, where 2*PI is a full circle. You want to know the arc length of a portion of that circle. For one arc-second it'd be 2*PI*Radius / (360 * 60 * 60).
Expanded out: 2 * PI * 6,371,000 / (360 * 3600) = ~30.89m per arc-second.
That'd mean 1/10th of an arc-second is about 3m, and 1/100th is pretty close to a foot.
It's also worth mentioning that latitude changes always mean the same thing, but further away from the equator, a change in longitude is a smaller distance than it is at the equator. (if you're 1m away from the north pole, a 180 degree longitude change moves you exactly 2 meters).
The math to figure out the arc-length between two points on a sphere is a little more challenging, and if you start worrying about the fact that it's not a perfect sphere, things get ugly. You could also get *really* picky and factor in altitude - The radius value is only precise at sea level - at higher altitude a change in angle moves you farther.
Jason
-Phil
Phil how short would sorry be? I'm thinking that the radius could be 1/2 mile at some point but currently it's going to be less than 300'.
The robot is a prototype built on the boe-bot to go to my local grocery store and pick up packages be delivered back home.
The GPS with lidar and the others sensors is making this possible. Obviously boe bot chassis is to small so I'm looking into battery powered wheelchairs for a future chassis.
It speaks, predicts weather, almost balances on two wheels, and makes a great security guard thus far.
-Phil
They work fine in cars because cars are usually on a street and the software of the GPS unit will correct the raw position data to match the real position.
But just with raw data and without street maps the precision is simple not there to navigate. Even standing still the raw GPS data tends to move around quite a lot. So +-15 feet is the best you can get.
I even tried with 2 GPS units, one mobile the other stationary to use the difference between both units. Sadly without a usable result.
Mike
Here is a post from PhiPi on the subject:
http://forums.parallax.com/discussion/157351/question-about-pmb-648-gps
If you need relative coordinates, you can go back to Google Earth and poke around to find the distance that you want, and then look at the differences between the gps locations and use those differences for your relative terms.
The unit I am using is a combo gsm/gps Sim808. How much confidence you can have in readings from this unit is indicated in by dilution of precision statistics, where the lower the number... the more accurate the reading. Among a series of readings from a static location, the ones with the lowest DOP numbers are the best.... When I use the DOP's and filter through a series of readings from a static location, with DOP's in the range of .9->1.2, I see generally less than a few meters error even though my GPS is sitting back from a window and the number of satellites in view is generally less than 10.
Im going to use the advice given here as best I understand it as follows.
The calculation equation is :
(a-x)^2 + (b-y) ^2 = c^2
Im going to use Phils advice (he must be one of these - "The earth is flat guys." :P) and simply treat the earth as flat.
With any luck Ill get this alarm function to work.
I second Mike's comment. My Google Earth logger, even when not moving, will log points that vary by 10-20 feet. Another issue is that it appears (but I haven't verified) is that the GPS seems to take into account the current velocity and direction. This causes the logged coordinates to be off by as much as 100 feet when I turn. Of course, I doubt your robot will be travelling at 60 mph
Walter
Also I cant believe some are suggesting that I am wasting my time? Or warning me about GPS -
My goal is as follows and I believe all robots need a purpose.
Lidar is used in conjunction with sonar, IR and other proximity sensors to navigate its way to the local store to pick up food.
I have a small boe-bot that is trying to get to the store but its little wheels and chassis only allow it to get out the front door down the sidewalk until it gets stuck on a crack in the pavement. I still need a more robust chassis to get this project moving.