Tuesday, October 25, 2011

GPS Buggy

A couple of weeks ago I tried building a small vehicle that would drive to a given location. I wanted to use LVLM but there was a problem with the blocks need to support the dGPS sensor, so I switched to NXT-G instead. Since then, John from Dexter Industries has kindly sent me a fixed version of the blocks, so I'll get back to LVLM. Before this, however, I wanted to document what I did with NXT-G.

I started with a modified version of HiTechnic's IR RC Kart that I happened to have lying around, added the dGPS and a magnetic compass sensor, and ended up with this...


Here's the NXT-G program for my GPS Buggy (GPS Buggy v4.rbtx, 649kb).

The program is in "pack and go" form and includes a myblock that I use for displaying variables.

The following notes are in the program, but I'll include them here for completeness...
  • Set the target lat/long using decimal degrees:
    • ddmmmmmm (lat - 8 digits)
    • dddmmmmmm (long - 9 digits)
  • Positive for North, East
  • Negative for South, West
  • For example:
    • S42 47.778 E147 15.096
    • => -42.7963 ,  147.2516
    • => -42796300, 147251600
I found that that when entering coordinates into the program that NXT-G converted them into scientific notation and didn't display all the digits. I was a bit worried about this at first, but tested it out and was pleased to discover that the entered digits were indeed stored correctly. They're just rounded off in the configuration panel.

Testing out this robot in my driveway, I was a bit disappointed about the consistency of the target coordinates. Although the robot will steer towards a target quite nicely, there seems to be quite a bit of drift in the current coordinates, even if the robot's motors are disabled. I'm not sure why this would be happening, but it seems like it's more of a problem than I'm used to when establishing waypoint coordinates using a standard GPSr.... maybe.

The next thing I want to do is recreate this program in LVLM and then have two robots working together. One robot moves around randomly and sends its location to the the second robot that then steers towards the first robot. I'm am hoping that any drift will affect both robots in the same way, and will result in more consistent behaviour....

No comments:

Post a Comment