Picmicro project

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.

--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott
Loading thread data ...

  • 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?
--
Tim Wescott
Wescott Design Services
 Click to see the full signature
Reply to
Tim Wescott

not

not at

Anyone

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

Reply to
Roger Hamlett

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

--
Mark Whyte

primtech@netdial.co.za
Reply to
MarkW

In article , Tim Wescott wrote: [....]

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.

--
--
kensmith@rahul.net   forging knowledge
Reply to
Ken Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.