config¶
org.horizon36596.simloop.config
Implement these interfaces in your robot project to supply its dimensions, motion limits and device names. SimLoop reads that configuration without importing your robot or season code.
What you implement¶
| Interface | Describes |
|---|---|
SimRobotConfig |
The robot: its drive motor names, its odometry device name, its drivetrain config. |
DrivetrainSimConfig |
Chassis geometry and the drive motors' limits. |
MechanismSimConfig |
One powered axis: time constant, speed ceiling, end stops, gravity. |
PositionalServoSimConfig |
A servo joint: what command maps to what position, plus deadband and quantum. |
ContinuousRotationSimConfig |
A CR-servo axis. |
Units, exactly¶
DrivetrainSimConfig
| Method | Unit |
|---|---|
trackWidth(), wheelBase(), wheelRadius() |
inches |
ticksPerInch() |
encoder ticks per inch of wheel travel |
maxVelocityTicksPerSecond() |
ticks per second |
maxAccel() |
reciprocal seconds (how fast speed chases command) |
maxLateralVelocityTicksPerSecond() |
ticks per second — a strafe figure, and it is not the forward one |
wheelMountingSigns() |
unitless +1/-1 per wheel, [frontLeft, frontRight, backLeft, backRight] |
fieldHalfWidth(), fieldHalfHeight() |
inches |
MechanismSimConfig
| Method | Unit |
|---|---|
timeConstant() |
seconds, strictly positive |
maxSpeed() |
your position units per second, strictly positive |
minPosition(), maxPosition() |
your position units |
gravityHoldPowerFraction() |
unitless, [0, 1); 0 means no gravity load |
PositionalServoSimConfig
| Method | Unit |
|---|---|
positionAtCommandZero(), positionAtCommandOne() |
your position units |
commandDeadband(), commandQuantum() |
servo command units, the same [0, 1] scale as the command |
Set strafe speed and wheel mounting signs deliberately
maxLateralVelocityTicksPerSecond() and wheelMountingSigns() have defaults, so a config that
omits them compiles. A wrong mounting sign can make the simulated robot spin instead of drive;
a wrong strafe speed changes its response to the path follower. Check these values against your
robot before tuning the controller from simulation results.
Positional servos: why two separate numbers¶
commandDeadband and commandQuantum are different failures and a control law that fixes one does not
fix the other.
- A quantum makes the reachable positions a grid, so the best possible aim is half a quantum off, and no smoothing helps.
- A deadband makes the joint stick wherever it happened to stop, so the error depends on which direction it approached from.
positionAtCommandZero() is allowed to be greater than positionAtCommandOne(). That is just a servo
mounted so increasing command drives the joint the other way, and it needs no "reversed" flag. Neither
endpoint has to lie inside the mechanism's end stops either — a hard stop reached before the servo's full
sweep is a real build, and the plant simply stops there.
What this package will not do¶
- It will not validate your physics. Values are checked for being finite and ordered, not for being true.
- It will not read your robot configuration file. The device names are strings you supply; nothing parses an FTC config XML.
- It will not convert units. Pick inches or millimetres, degrees or radians, and stay in them everywhere.
- It does not describe your subsystems. There is no place here to say "I have an intake". These are numbers, not a robot model.