View Single Post
  #3   Spotlight this post!  
Unread 28-06-2011, 22:24
Jared Russell's Avatar
Jared Russell Jared Russell is online now
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Joystick recording for Auton.

One of the things you will probably find if you go the route of playing back joystick commands is that your bot is going to do somewhat different things each time! Maybe one time it will drive further, or not turn quite the same amount, as the time before. Why is this?

When you are recording a joystick command during teleop, that command is usually being sent as a PWM value (you can think of this as an "average voltage") to a motor. But what happens if you record the data with a 12.8V battery, then play it back with a 12.5V battery? Or if your wheels have worn a bit. Or if it's warmer than when you first recorded. Or if there's a slight uneven spot in the carpet. Etc. Etc.

You will get slight differences that might mean the difference between hanging that ubertube and dropping it to the left of the peg!

I very much recommend you do what you set out to do, as it is a great learning exercise. But if you are not satisfied with the repeatability of the solution, don't stop there! You will learn about great tools such as sensors (encoders + gyros) and control algorithms (PID controllers) if you keep investigating. Imagine if you recorded the wheel speeds instead of the joystick or PWM values. If you know you want to go 5 feet per second, and have a sensor that can measure your current speed, there are techniques to force your wheel to go 5 feet per second regardless of battery, environment, wear, etc.