Loginskip to content

Archive for September 18th, 2007

Parsing GPS NMEA message

Tuesday, September 18th, 2007


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.

An Updated Firmware

Tuesday, September 18th, 2007

Lego has released an updated firmware. Here is what the web site says:

“Updating to LEGO MINDSTORMS NXT Firmware V1.05 will improve the following:

- Multiple datafile control within user programs
- Communication with 3rd party external devices
- Bluetooth communication within user programs

NOTE: Only update your firmware if you have experienced issues related to the above”

Does anybody know more details about these improvements?

Via thenextstep.