GPS navigated RC car makes smooth turns at 28mph
GreenLight
Posts: 8
I put a Garmin GPS and accellerometer to my bs2p on my rc car.· I controll the speed with the radio but the stamp does all the steering.· It can drive very well as it guesses the degrees it has·turned using the accellerometer between the updates of the GPS for its direction.· After flipping it a couple times from turning to fast to sharp i was able to change some constants so that it wont pull enough G's to flip at max speed.
Dont slam me on the messy code· because I had to come up with some tricky math to calculate·so that its not limited by the distance between coordinates as long as they are in the same hemisphere.
All those fix* routines compare the most sig digits and truncate the gps coord so I can get an accurrate set of coord in a word var without loosing accurracy for my bearing calc.
It doesnt weave, it makes smooth turns and heads right to the next waypoint.· This example only has 4 waypoints because i was just running laps in the parking lot.· My rc car can do the laps at 28mph thats the max speed of the car. The car is an acurra i bought from radioshack for $30.·
Dont slam me on the messy code· because I had to come up with some tricky math to calculate·so that its not limited by the distance between coordinates as long as they are in the same hemisphere.
All those fix* routines compare the most sig digits and truncate the gps coord so I can get an accurrate set of coord in a word var without loosing accurracy for my bearing calc.
It doesnt weave, it makes smooth turns and heads right to the next waypoint.· This example only has 4 waypoints because i was just running laps in the parking lot.· My rc car can do the laps at 28mph thats the max speed of the car. The car is an acurra i bought from radioshack for $30.·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering
my code only has 4 waypoints but you can easily add many more by adding additional case statments and changing the value in the if statement to the number of waypoints minus 1
the value in the then part of the if can be set to the last waypoint if you want the car to stop at the last waypoint.
You should be able to put this on any rc car that uses a standard servo for the steering control.
I used a Garmin GPS L18· but you should be able to use any gps that give nmea GPRMC sentances.
If you have any other questions let me know