GPS and steering
Does anyone have experience with driving a robot by a GPS and compass?
I have cobbled together a program that gets a heading from 2 GPS coordinates, compares it against the current compass heading and then steers the robot. Everything is working as I expected except the GPS takes longer than a second to refresh. This is a problem because by the time I get the new heading the robot has moved (for at least one second) to a new heading. This causes the robot to constantly correct (spinning in a circle, swinging left and right). Every once in awhile the compass and the GPS align at the right time and the robot moves forward.
I'm sure this question has been asked before but I searched the forum and found nothing.
Any help would be greatly appreciated.
I have cobbled together a program that gets a heading from 2 GPS coordinates, compares it against the current compass heading and then steers the robot. Everything is working as I expected except the GPS takes longer than a second to refresh. This is a problem because by the time I get the new heading the robot has moved (for at least one second) to a new heading. This causes the robot to constantly correct (spinning in a circle, swinging left and right). Every once in awhile the compass and the GPS align at the right time and the robot moves forward.
I'm sure this question has been asked before but I searched the forum and found nothing.
Any help would be greatly appreciated.
Comments
I have already gotten past the navigation part. What I need to know is how to steer the robot with the information.
Thanks,
Mike
I thought I'd not fill up Steve's thread with my reply so I'm posting in this thread.
From what I've read, the GPS heading feature doesn't work well at slow speeds and not at all while sitting still.
You need some way to determine heading without having to constantly rely on the GPS. I'm pretty sure the sandard way to solving this problem is to use encoders and to be able to determing how the robot's heading has changed by using the encoders.
I think you'd be well off to be able to have control of your robot's heading using encoders only and then add a compass and only use the GPS to detemine where you are.
If you haven't read Phil's encoder paper, you should.
A lot of us have used erco's figure 8 challenge as way of learning how to use encoders on our robots. It's be great to see an entry from you.
I'm not sure how your code is setup but it sounds as if you're basing your new heading on the GPS heading. In code I have been working on I get the current cordinates from the GPS every second and calculate the heading, but then that is always based on my current heading from the compass module, so if you know the heading you want and you compare it to the compass heading you shouldn't be over/under-correcting as much. I guess it also depends on how your robot steers as to how much of that you will see.
Don't forget the Ultrasonic orbit challenge. Knowing how to do that could be handy to navigate around an obstacle to get back on a compass heading. Here's the thread:
http://forums.parallax.com/showthread.php?144539-Erco-s-Ultrasonic-Orbit-Challenge
Speaking of the Ultrasonic orbit challenge. So far the BS2 contingent are the only sub-forum members to complete the challenge. The Propeller proponents have been notably absent.
I think Duane and Ttailspin are afraid. Really fearful.
My 6WD rover using ArduRover code on a APM1.4/Oilpan complete with LEA-6 GPS and a HMC5883L compass goes pretty straight from waypoint to waypoint without any wander. But then again, it is not a BS2 nor a Propeller. Just an Atmel 2560 processor. No wheel encoders involved.
Just a thought.
Regards,
TCIII
Tom, do you have this robot documented anywhere? I'd like to see it.
Do you use the compass for direction? Is the GPS heading feature useful or do you just rely on the compass.
If you tell your robot to drive straight, how straight does it go? I wonder if 6WD offers an advantage to driving straight without encoders.
Here you go:
Original JLN concept on DIY Drones: http://www.diydrones.com/profiles/blogs/apmrover-1280-a-fun-ugv-project-for-in-full-autonomous-reco
My build log on DIY Drones:http://www.diydrones.com/forum/topics/tciii-ardurover-traxxas-e-maxxs-build-log?groupUrl=ardurover-user-group&groupId=705844%3AGroup%3A903163&id=705844%3ATopic%3A981571&page=4#comments
The GPS is used to move from waypoint to waypoint and to detect when the rover has arrived at a given waypoint.
The compass is used to help keep the rover from drifting durning the movement from waypoint to waypoint.
We are using a GPS that has very good accuracy and repeatability. There is talk on the forum of being able to get the LEA-6 accuracy down to under a foot with just software.
Regards,
TCIII