Maker Pro
Maker Pro

Picmicro project

M

MarkW

Jan 1, 1970
0
Hiya

This is a question for all the code warriors out there doing stuff with
picmicros or whatever
else type micro...
I have a project to do "geofencing" using a gps. Basically the gps is not
any problem but when it comes to
defining a go-nogo area and be able to dtect if one is in the area or not at
any given time in realtime i am
a little lost in how to do this in a microcontroller based design. Anyone
have ideas about code to define and
area using gps co-ords and realtime detection?

Much appreciated
 
R

Roger Hamlett

Jan 1, 1970
0
MarkW said:
Hiya

This is a question for all the code warriors out there doing stuff with
picmicros or whatever
else type micro...
I have a project to do "geofencing" using a gps. Basically the gps is not
any problem but when it comes to
defining a go-nogo area and be able to dtect if one is in the area or not at
any given time in realtime i am
a little lost in how to do this in a microcontroller based design. Anyone
have ideas about code to define and
area using gps co-ords and realtime detection?

Much appreciated
So much is going to depend on the size/shape/number of areas involved. If
there are a lot of areas, and the shapes are complex, and have to be
accurately defined, consider a larger processor with more RAM. However if
the areas are reasonably small, consider the 'flat earth' solution. If you
assume the world is flat, you can calculate a distance from a 'point',
using simple pythagorean triangle solutions. Do this in integer
arithmetic, woking to perhaps 1m resolution. Then define each area, in
terms of a number of points, and radii round them. Overlap circles to
cover more complex shapes. The test for a few dozen circles could be done
in a few mSec, even on a PIC. Obviously if the circles are large, this
will start to become significantly in error, but for reasonable sized
circles, it will be pretty accurate.

Best Wishes
 
T

Tim Wescott

Jan 1, 1970
0
Roger said:
not at


So much is going to depend on the size/shape/number of areas involved. If
there are a lot of areas, and the shapes are complex, and have to be
accurately defined, consider a larger processor with more RAM. However if
the areas are reasonably small, consider the 'flat earth' solution. If you
assume the world is flat, you can calculate a distance from a 'point',
using simple pythagorean triangle solutions. Do this in integer
arithmetic, woking to perhaps 1m resolution. Then define each area, in
terms of a number of points, and radii round them. Overlap circles to
cover more complex shapes. The test for a few dozen circles could be done
in a few mSec, even on a PIC. Obviously if the circles are large, this
will start to become significantly in error, but for reasonable sized
circles, it will be pretty accurate.

Best Wishes
Good idea -- squares would be even faster.

I would consider whether I could define my areas in terms of
"rectangles" in lat-lon coordinates (never mind real-world distances) --
then all the computations become subtractions.
 
T

Tim Wescott

Jan 1, 1970
0
MarkW said:
Hiya

This is a question for all the code warriors out there doing stuff with
picmicros or whatever
else type micro...
I have a project to do "geofencing" using a gps. Basically the gps is not
any problem but when it comes to
defining a go-nogo area and be able to dtect if one is in the area or not at
any given time in realtime i am
a little lost in how to do this in a microcontroller based design. Anyone
have ideas about code to define and
area using gps co-ords and realtime detection?

Much appreciated
* How fast is "real time"?
* How complicated are your defined areas?
* Do you just need "go/no go", or do you need a direction to return?
* How fast is the processor you intend to use?
 
K

Ken Smith

Jan 1, 1970
0
Tim Wescott said:
Good idea -- squares would be even faster.

I would consider whether I could define my areas in terms of
"rectangles" in lat-lon coordinates (never mind real-world distances) --
then all the computations become subtractions.

Doing rotated squares generally requires multiplies but you can do one at
a 45 with just adds and subtracts if you are willing to prescale the
constants. Instead of tiling the shape in rectangles in the normal
rotation, you can mix in some at the 45 degree angle .This could define a
smoother shape with less squares.
 
Top