Main File¶
Warning
Looking for the raw code or download? See the GitHub repository.
The robot’s complete code is under one file, main.cpp. This is done so as to simplify development as instances the given Proteus libraries could not be easily reused in multiple classes.
Global Variables & Constants¶
Note
This does not include the motor, servo, and sensor definitions.
Type |
Name |
Description |
|---|---|---|
Constant |
|
The maximum RPM for IGWAN motors, used in setRadSToPercent |
Constant |
|
The encoder resolution, used in countsToRadDisp |
Constant |
|
The time between iterations in the PI control loop |
Constant |
|
The number of encoder counts per inch, used in all forward functions |
Constant |
|
The default correction percent speed for correctHeading |
|
|
Stores the X coordinate for the start of the ramp waypoint, set by setupRPS |
|
|
Stores the Y coordinate for the start of the ramp waypoint, set by setupRPS |
|
|
Stores the heading for the start of the ramp waypoint, set by setupRPS |
|
|
Stores the X coordinate for levers waypoint, set by setupRPS |
|
|
Stores the Y coordinate for levers waypoint, set by setupRPS |
|
|
Stores the heading for levers waypoint, set by setupRPS |
|
|
Stores the X coordinate for the burger flip waypoint, set by setupRPS |
|
|
Stores the Y coordinate for the burger flip waypoint, set by setupRPS |
|
|
The default timeout length for the corrections, in case the motors do not move |
|
|
Motor 1’s current error from the PIMoveTo, used by setRadSToPercent |
|
|
Motor 2’s current error from the PIMoveTo, used by setRadSToPercent |
|
|
Motor 3’s current error from the PIMoveTo, used by setRadSToPercent |