mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
While final would seem to make sense for RobotMap values (as these values should be constant at runtime), RobotMap values are often not truly final in the Java sense of the word, as on real robots they often change between project builds (e.g. they often can and will be changed by teams as wiring changes on the physical robot). Unfortunately, incremental compilation in Eclipse follows Java rules, and doesn't track cross-module dependencies on final variable values, resulting in very non-intuitive behavior when a final variable's value is changed: other (unchanged) Java modules using the final variable are NOT recompiled (as is necessary to pick up the new value), and there is no easy way to force recompilation of every Java file in the project. Change-Id: I75b13aaf4f4a687698f853d5e11eef5f904716ea
19 lines
771 B
Java
19 lines
771 B
Java
package $package;
|
|
/**
|
|
* The RobotMap is a mapping from the ports sensors and actuators are wired into
|
|
* to a variable name. This provides flexibility changing wiring, makes checking
|
|
* the wiring easier and significantly reduces the number of magic numbers
|
|
* floating around.
|
|
*/
|
|
public class RobotMap {
|
|
// For example to map the left and right motors, you could define the
|
|
// following variables to use with your drivetrain subsystem.
|
|
// public static int leftMotor = 1;
|
|
// public static int rightMotor = 2;
|
|
|
|
// If you are using multiple modules, make sure to define both the port
|
|
// number and the module. For example you with a rangefinder:
|
|
// public static int rangefinderPort = 1;
|
|
// public static int rangefinderModule = 1;
|
|
}
|