A solution that allows you to record and playback robot movements.
Motor values are recorded at a set interval and saved via serial connection or to the micro-SD card.
This solution contains three projects, Replay
is a VEXCode V5 Pro C++ project to record movements, Interpreter
is a CMake C++ project to read the input and save it to a file to be copied into a program, and ReplayTest
is a VEXCode V5 Pro C++ project to quickly test the interpreted output.
This solution contains three projects, Replay
is a VEXCode V5 Pro C++ project to record movements, Interpreter
is a CMake C++ project to read the input and save it to a file to be copied into a program, and ReplayTest
is a VEXCode V5 Pro C++ project to quickly test the interpreted output.
This program may not always replay motions with 100% accuracy. Currently, it is configured to record values that a motor is set to at a certain interval. This can be modified, however. The longer a recording is, the less accurate it will be as it progresses through. It is crucial to start the robot in the same position every time. Recording and been designed to be as precise and as efficient as possible to help eliminate any discrepancies with timing.
- VEXcode V5 Pro
- CMake
- C++ compiler (g++, Clang, Visual Studio, etc.)
- Micro-SD Card (formatted to FAT-32)
See README.md
of Replay
, Interpreter
, and ReplayTest
for more information for each project.
- Configure
Replay
- Change the robot configuration accordingly
- Set if you'd like to output to serial, micro-SD card, or both
- Add your
opcontrol
code to control the robot
- Compile and Upload
Replay
to your robot - Run
Replay
(default slot is slot #7)- Starts recording after a 2 second delay
- End recording by pressing the buttons
Y
andA
on the main controller at the same time
- Save output to computer
- Run Interpreter on the file
- Modify and build if necessary
- Usage
interpret inputFile outputFile
- Paste output where it needs to go
- Test the program with
ReplayTest
(default slot is slot #8)
- Test the program with
It shouldn't be too hard to port Replay
and ReplayTest
over to the PROS.
If you do manage it get it working on PROS, submit a pull request.
Some features that would be nice to have later:
- PROS support
- Creating a program that allows you to select from a list of already recorded files and then play them back from inside of the robot without ever having to go to the computer to generate the code
- Allow pausing while recording
- Figure out how to record encoder/sensor values and use them in a meaningful way
- A GUI to manage and edit recorded data