
After few hours of LabView coding, I finally made an NXT code (see larger image here) that can parse NMEA (GPS) $GPGGA message (i.e. GPS fix data). I thank Dick Swan for his RobotC code which inspired the algorithm. Timing tests show that the NXT using firmware 1.05 runs this code in around 92 milisecond. This would be good enough for update rates of few Hz.
Next I plan to design the NXT-G block for BT GPS. I was thinking of a block with two ‘action’ options - ‘update’ and ‘read’. The former delays the program till it reads a BT buffer (or a timeout occurs), and tries to parse the new NMEA message. It returns a Yes/No output which say if it was successful (so one can make a ‘Wait for’ block until a successful GPS data is read). Once a good data is read it is stored in a ‘global’ data holder. The later option ‘read’ returns the last stored value of lat. and long. position (maybe only seconds part?), #satellites and altitude. In this mode you can define a waypoint (as GPS coordinates) and a distance cutoff (in meters) and the block returns a Yes/No value if it is closer then cutoff. It will also return the heading and distance to waypoint (so with a compass sensor you can steer your NXT to the waypoint). The basic use principle would be having one ‘update’ GPS Block in a loop on one sequence wire, and your running program with ‘read’ GPS Blocks on a second sequence wire.
Comments/suggestion? Please use this forums topic.