Hello, I was wondering if GPS sensors, or any sensors, could track a path taken during the driver control period.
If you mean like, replay a path taken in driver control you can use non-feedback control (no sensors). In your
opcontrol loop (where you take driver inputs to control the robot), you could write every loop iteration of the driver’s inputs (while driving through the path) to a file on the SD card. When replaying, instead of reading from the joysticks, you could read from the file. If everything is perfectly consistent, then it should move through the same path. If there is any variability (hot motors, dusty ground, etc) it will deviate.
If you mean just record the path for later analysis, yes, just write the coordinates from the GPS sensor into a file on the sd card. If you format it correctly (maybe as a .csv) you could open it on your computer and graph the motion.
Some people have made replay systems that record how someone drives and replays it. Most of the time it does not work well.
Gps sensors and odometry can track a path previously taken. However, if you wanted to recreate that path that is a separate thing entirely. What are you trying to track the path previously taken during driver control for?
Of course, that is excluding all of the other motors used for the other different elements of the robot. But getting the path and timing down would be a huge help.
If a driver is good enough to score over a hundred points during the driver control skills period, then replicating that could double the score.
Search my postings. I’d got a thread(s) called ‘auton toolkit’. What you’re looking for is very similar to what we’ve done. It would be a good place to start.
Here is a better way to do that:
Record video of good path.
Create and tune a PID that uses GPS (x,y,heading) and calculates (magnitude, angle) that you need to drive/turn.
Then drive/turn towards a destination.
Create an array of all the waypoints and a threshold (when to move on to the next waypoint), and just create some logic that drives to your current waypoint, checks if you are within the threshold for that waypoint, and then i++ to the next item in the array, updating your waypoints to the next one down the list when it is appropriate.
Then tune, tune, tune until it looks like the video. You might need to point the waypoints to be places you never actually get if you have a large threshold. That way you drive towards it, and once you are close enough, turn towards the next waypoint without stopping.
Finally, when you reach the last item in the list, you stop.
You can then either insert scripts between each array execution to do other things.
Let me know if you have any questions.
The short answer to this is yes. A team did it before back in ChangeUp and used it for prog. I don’t remember what team however I know you use a Micro SD card to print stuff from the brain into a .txt file and that’ll save the information, and you can copy and paste it into prog as necessary and run it. Won’t be perfect but it’ll be close