AC.motion

August 21, 2006

Knowing where I am (GPS)

Currently I'm working on two aspects of the software: simulation (for tests and position estimation) and navigation. Today it was time to get some information from the GPS.

I'm using GPSLib4J which is a bit old and needs some tinkering. First off, I needed to modify the source to work with the Gnu version of the serial comm library (easy). Second, I needed to add a bunch of getters to the PVTDataPacket (or so) class to access information on estimated error, altitude, speed, and some more (easy, too).

To do:
  • build an adapter that listens to GPS update messages and send positional information to the bridge (the remote control)
  • implement the navigational system and listen to GPS and compass messages
  • implement the simulation system to estimate ship position and motion from sensor and actuator input
  • make the navigational system make use of information from the simulation system
Additionally, I was investigating Java threads. I noticed the GPS thread sometimes crashes on startup since the underlying library "feels unwell". So, how do I detect a thread crash? Basically I have two options. a) the thread restarts itself when it catches an Exception in its main loop. b) a watchdog thread periodically checks all running threads with isAlive(), and restarts a thread if necessary.

I think a) is the way to go for self-contained modules like the Basic Stamp or the GPS.

0 Comments:

Post a Comment

<< Home