开发者

How do i navigate an RC car with a gps module on it based on user defined coordinates?

开发者 https://www.devze.com 2023-02-12 04:01 出处:网络
I want to navigate the RC car from point A to point B. The gps module is used to find the current location coordinates 开发者_C百科i.e point A. The user enters the point B coordinates based on point A

I want to navigate the RC car from point A to point B. The gps module is used to find the current location coordinates 开发者_C百科i.e point A. The user enters the point B coordinates based on point A. I am wondering what algorithm i should use to move the rc car i.e this algorithm should tell the robot to move forward or turn right until it reaches point B.

I've been looking at kalman filtering algorithm. Is there a another algorithm out there which i can use.

Environment: The robot should navigate indoors. I have to use the GPS because it is a requirement. The GPS is the only navigation sensor present on the robot.

Thanks, Praveen


Remember that GPS accuracy is to within 2-3 metres, which I guess will be a real problem for an RC car for which this level of innacuracy would be significant.


GPS on a cheap receiver is anywhere from within 2 meters to 10 meters. Indoors is going to be worse than that due to the restricted satellite visibility.

Generally speaking, the more money you spend on the receiver, the better the accuracy will be. You can get to sub-inch accuracy with RTK, but that is in the range of $10K.

To drive to a way-point you need to know where you are currently to determine the heading from you to the way-point. Then you need to know the heading of your vehicle, which you can get somewhat close based on the path of where you have been. You then need to be able to steer the vehicle so that it is pointed at the way-point. In order to get your vehicle heading right, you may need to monitor what the steering angle is.

I have done this with farm equipment. A high accuracy GPS receiver provides location and speed. It's path provides vehicle heading information, and then a wheel angle sensor gives feedback on the steering control loop.


Your GPS receiver should output NMEA, which contains an NMEA sentence called RMC. Field 5 of this sentence is the ground speed in knots, and field 6 is the heading in degrees. Fields 1 and 2 give you your current position coordinates A=(lat1, lon1), and you've keyed in the destination as B=(lat2, lon2)

Now the heading you want to be at is calculated using atan2, as follows:

heading = atan2( sin(lon2-lon1)*cos(lat2), cos(lat1)*sin(lat2) - sin(lat1)*cos(lat2)*cos(lon2-lon1))

And then convert this from radians to degrees, but you also need to add 180 degrees to any negative answer (as the result of heading is between -180 and 180).

So now you have your actual heading hA, and the heading you should be at hB. Subtract one from the other (hA - hB), and if your answer is positive start turning right, and if your answer is negative start turning left.

0

精彩评论

暂无评论...
验证码 换一张
取 消