Project Structure¶
Warning
Updating replaces anything you change outside the custom folder. The updater saves your copies in rw-backup/ first.
Your code: custom/¶
custom/include/
autonomous.h: declarations for autonomous routinesrobot-config.h: declarations for robot devicesuser.h: declarations for user functions
custom/src/
autonomous.cpp: your autonomous routinesrobot-config.cpp: your robot's device configurationuser.cpp: user functions
Template code¶
include/
motor-control.h: core drive and motion control function declarationspid.h: reusable PID controller class declarationutils.h: math and geometry utility functionsmcl.h: Monte Carlo localization (particle filter)path.h: motion profile and path mathpath-following.h: profiled moves and path followersdrive-log.h: drive calibration for the simulatorauton-selector.h: auton selectordriver-control.h: driver control helpershardware.h: the few things RW asks of the robot (motors, sensors, screen, SD card), so the rest of RW is the same on VEXcode and PROSvex.h: standard VEX libraries and device setup
src/vexcode/
main.cpp: competition entry point and control flowhardware.cpp: the VEXcode version ofhardware.h, using your devices fromcustom/
src/ (the same code runs on VEXcode and PROS)
motor-control.cpp: core drive and motion control function implementationspid.cpp: PID controller logicutils.cpp: math and geometry utility function implementations (odometry and distance reset math)mcl.cpp: particle filter mathpath.cpp: motion profiles, path smoothing, speed planning, pure pursuit and RAMSETE mathpath-following.cpp:driveProfiled,turnProfiled,followPath,followPathRamsete,measureDriveFeedforwarddrive-log.cpp:calibrateDrive, which records a run for the simulatorauton-selector.cpp: auton selectordriver-control.cpp: driver control helpersholonomic.cpp: X-drives, mecanum drives and H-drives:strafeToPose,strafe,driveHolonomic(see Drive Types)
Computer-side tools¶
These aren't part of the robot build.
- tests/: computer-side tests for the odometry and distance reset math, plus an MCL field simulation. See Testing on a Computer
- sim/: the simulator.
run-sim.shruns it,viewer.htmlis the replay page,drive-model.his the drive physics,fit-profile.shcalibrates it from your robot,find-compiler.shfinds a C++ compiler for the scripts,vex/holds the stand-in VEX API, andsim-hooks.his how the stand-in talks to the simulated robot - tools/: the updater.
update.ps1(Windows) andupdate.sh(Mac and Linux) update the project to a new version, andrw-files.txtlists RW's files so they know what to replace. In VS Code's menu bar, Terminal > Run Task... > Update RW-Template runs them
The PROS version¶
In a PROS project, your files are src/rw-config.cpp, src/rw-autons.cpp, src/rw-user.cpp and include/rw-config.h, which do the job of the custom/ folder. RW's own files are include/rw/, firmware/RW-Template.a, firmware/rw-template.mk and sim/ (with sim/pros/ in place of sim/vex/), and pros c apply RW-Template replaces them when you update. See Using PROS.
The RW-Template repository builds that template from its pros/ folder, with the same src/ and include/ code as the VEXcode version plus pros/rw/hardware.cpp, the PROS version of hardware.h.