Autonomous RC Car

Hi to everyone , I am new in arduino world. I want to make a project based on an arduino autonomous rc car . I have built the car and now I want to find if it is possible to do the following thing . I want to walk on a field while keeping a gps that will track my movement through the field , after tracking my movement the gps with send it to the arduino rc car and that will do the same movement through the field as i did . Does any one knows how can I do this ?

dnano001:
Hi to everyone , I am new in arduino world. I want to make a project based on an arduino autonomous rc car . I have built the car and now I want to find if it is possible to do the following thing . I want to walk on a field while keeping a gps that will track my movement through the field , after tracking my movement the gps with send it to the arduino rc car and that will do the same movement through the field as i did . Does any one knows how can I do this ?

Well - that depends on a number of things, but here is something to get you started:

  1. You'll need to add a GPS receiver (module or shield) to the Arduino on the car, obviously - so get that working first.

  2. Collect your data - collect it not as a continuous series of lan/lon points - but spaced apart (say every 25 - 100 feet) "waypoints". The car will then navigate from waypoint to waypoint.

  3. Store the data on an SD card, and hook that to the Arduino and read the data.

  4. Your car will also need some forward (and possibly rearward and side) facing sensors - ultrasonic, Sharp IR, and touch; you might be able to dispense with the last one - but you should have at least the other two (don't scrimp - you will want both). If it is in the budget - you might also experiment around with a LIDAR sensor. Note that you can mount the ultrasonic/IR/LIDAR sensor package on a servo - to have it pan to "look around" (if you need 3D point measurement, a pan/tilt unit can be used - but it will be much slower to gather the data).

  5. Once you have your data and such loaded on the Arduino, your algorithm will (roughly) be:

1.) Start (get current lat/lon from GPS module - needed for nav, iirc)
2.) Read the first GPS coordinate from the SD card
3.) Navigate toward that coordinate
4.) Go forward
5.) Along the way - poll your sensors (or use interrupts) - if anything gets in your way, go to step 10
6.) Have we reached the coordinate? If so, go to step 8
7.) Go back to step 3
8.) Read the next GPS coordinate from the SD card; if there isn't one, go to step 12
9.) Go back to step 3
10.) Stop, reverse by some amount, while turning in a random direction (turn in reverse)
11.) Go back to step 4
12.) Stop - you are at your destination - play a victory song

The above algorithm -should not- be followed step by step as I have laid it out; what you want is something more akin to a state machine, along with a non-blocking code design (see "blink without delay" and "doing many things at once" examples).

Navigating toward a GPS position from a known position is not very difficult; there are numerous examples on the internet for you to look up. Doing it while avoid obstacles (among many other "road hazards") is a very different undertaking. You'll want to take constant sensor readings, perhaps slowing down (or stopping) in ambiguous situations (to give more time to "decide" what to do). You may want to (instead of moving in reverse - or in addition to) have the car navigate toward the most open direction; have that behaviour be primary over "nav to GPS coordinates" - only switching when things have been clear for a long time, or periodically checking the heading (and if off by so many degrees) - a kind of "subsumption architecture" for the nav system.

Good luck. :slight_smile: