Sunday, February 17, 2008

[oopic] Re: storing data to oopic

--- In oopic@yahoogroups.com, "rtstofer" <rstofer@...> wrote:
>
> --- In oopic@yahoogroups.com, alvin sy <alvinsy2000@> wrote:
> >
> > hi, i want to store the data(latitude and
> > longitude) coming from a gps to the OOpic so we can
> > compare it to the coordinates that we input while it
> > the mobot is moving but i think the oopic is too slow
> > even at baud rate 2400 can anyone give suggestions or
> > ideas what should we do? thanks
> >
> > OOpic S board, compiler V6, firmware B2.2+
> >
> >
> >
>
> Start by stripping the data: a minute of latitude is 1 nautical
mile
> (6076.1 feet). It is unlikely your 'bot will traverse a minute of
> lat or lon (unless you are VERY far away from the equator).
>
> Convert the fractional minute part of the lat/lon to an integer
> (word) and store the values as 2 oWords. Do the same with the
> incoming stream. Skip over everything until you get to the
> fractional minutes and just convert that for testing.
>
> Look at the $GPGLL sentence here:
> http://www.qsl.net/n2ixd/digitraker/visualgps.htm
>
> Your logic should watch the serial stream for $GPGLL, wait for the
> following decimal point, convert 4 digits, wait for the following
> decimal point, convert 4 digits and you're done. Start waiting for
> the next $GPLL, etc
>
> The way to do this is to have your 'bot code in a loop. As you run
> through the loop, have a state machine (case statement)
that 'knows'
> what it is looking for in the next character. The case
> statement 'looks' for $ and when it finds one it increments the
state
> number where is starts looking for G, increments the state and
looks
> for P and so on. At any point if the proper thing isn't found, it
> sets the state back to 1 and looks for another $. Obviously, the
> state that skips junk looking for the decimal point needs a way to
> stop looking. Maybe stop when you see a carriage return -
something
> to get out of a mangled message and back to state 1.
>
> You will need to deal with 'roll-over' if you start at say .9999
and
> travel to .0003 because you only converted the fraction. I haven't
> worked out the details but perhaps oInteger would be better than
> oWord.
>
> I wouldn't do it this way! The OOPic is a poor choice for serial
IO
> and the GPS is 'chatty'. It's talking all the time and just won't
> shut up! I might take a separate uC that had 2 serial ports and
use
> one to grab the GPS stream and the other to output the binary
> fractions to the OOPic. In fact, it might be better to not tell
the
> OOPic WHERE the 'bot is located but to just tell it how FAR it has
> moved from the start. If you were interested, the co-processor
could
> also determine distance in some arbitrary reference and just
present
> deltaX and deltaY in units of your choice.
>
> Then, I would get rid of the 2d serial port that talks to the OOPic
> and use SPI. That way the OOPic could just clock the most current
> data whenever it wanted. Almost any uC will have an SPI gadget and
a
> UART.
>
> Regardless of the baud rate, you really don't want to use the OOPic
> for serial IO. It can be made to work well if the sender will
handle
> flow control but the GPS probably won't. In any event, make sure
you
> are using oSerialPort (the hardware UART) because it has a 4 byte
> buffer.
>
> Given the 1-5 meter positioning accuracy of differentially
corrected
> GPS, I have never been convinced that GPS odometry is practical.
> Maybe one day I'll give it a try...
>
> Richard
>

Or, if you don't want a lot of complexity in the co-processor, just
have it pass from the input to output ONLY the sentence you want
($GPGLL ?) and drop all the others. That will take a tremendous load
off the OOPic.

Personally, I would put ALL the complexity in the co-processor to
make the OOPic interface as simple as possible. And it doesn't get
much simpler than SPI. It is really an advantage to have a protocol
where the OOPic is the master.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments:

Post a Comment