Gps heading replacing with compass?
Mano from Netherlands  [27 posts]
13 year
I have a usb navilock gps receiver connected to roborealm. As far as i know the gps reader is fully equiped to make my bot drive from one point to another.

Now i want to attach a compass sensor to my microcontroller, and send the heading over serial to the computer. How can i replace the gps heading with the compass heading?
Anonymous 13 year
You can't just replace them as the GPS module is written specifically for GPS data. Have a look at the response in your previous post:


Mano from Netherlands  [27 posts] 13 year
Ok i understand. Is there maybe a way to give a custom value to the variable gps-heading. Or maybe with vb script, link the compass heading and the gps heading together? How do other people use a compass on there robot? Do you know any usable code for RR that does do this.

I'm flying blind.....

Anonymous 13 year

Using the compass data outside of the GPS module may make better sense. If you know which direction you need to head (i.e. north) then you can read the compass setting and change direction (i.e. power left motor more than right) in order to align up with north correctly. This is basically what the GPS module provides ... but with a compass you already have this heading direction.

What you'd need to know is where the waypoints are in relation to your robot or in relation to each other.

Keep in mind that compass readings are also a bit noisy and can easily lead you off a specific path. They are great for general heading but as you approach your target you'll want to use something more absolute/precise in order to get you there.

Mano from Netherlands  [27 posts] 13 year
Indeed! But there is a formula for that. So it knows where the robot is in according to the destination.
For example:

If the robot location is 0,0 (x,y). And the destination would be 7,-6. Would the robot have to go north or south, east or west, to get to it's destination?

Now the robot has to drive before the heading is known, then after at least 10ft the robot knows a heading and then reacts to it. With this formula ( send by email) the robot knows where to go before it starts to drive.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index