Electrical Robot Configuration
Robot configuration
The exact device names to enter in Driver Hub → Configure Robot for our robot, read straight from the finished code. Every character counts: names are all lowercase, with underscores between words and no spaces.
2hubs
You need two hubs. The robot has six motors and a Control Hub only has four motor ports, so the drivetrain goes on the Control Hub and the mechanisms go on an Expansion Hub. The exact port numbers are up to your wiring. What has to match is the name and the device type. If one doesn't, hardwareMap.get(...) throws an error and the OpMode won't start.
| Configuration name | Port | Add it as | Code type | What it is |
|---|---|---|---|---|
| Drivetrain · 4 mecanum wheels | ||||
| front_left_motor | Motor | DC Motor (your goBILDA model) | DcMotor | Front-left wheel. Reversed in code. |
| front_right_motor | Motor | DC Motor (your goBILDA model) | DcMotor | Front-right wheel. |
| back_left_motor | Motor | DC Motor (your goBILDA model) | DcMotor | Back-left wheel. Reversed in code. |
| back_right_motor | Motor | DC Motor (your goBILDA model) | DcMotor | Back-right wheel. |
| Mechanisms | ||||
| intake_motor | Motor | DC Motor (your goBILDA model) | DcMotor | Intake that pulls game pieces in. |
| shooter | Motor | DC Motor (your goBILDA model) | DcMotorEx | Flywheel. DcMotorEx is the same physical port. The "Ex" just unlocks velocity control in code. |
| hood | Servo | Servo | Servo | Shooter hood. A positional servo that sets the shot angle. |
| feeder | Servo | Continuous Rotation Servo | CRServo | Indexer that feeds pieces into the flywheel. Must be a Continuous Rotation Servo, not a regular one. |
| Sensors · I2C | ||||
| pinpoint | I2C | goBILDA® Pinpoint Odometry Computer | GoBildaPinpointDriver | Odometry computer that tracks the robot's position on the field. Use I2C bus 1–3. |
| imu | I2C | Control Hub built-in IMU | IMU | The Control Hub's built-in heading sensor, on internal I2C bus 0. Usually already named imu. |
Before you save
Six things to double-check
- 1Names are case-sensitiveThey must match the code character for character: lowercase and underscores, with no spaces or capitals.
- 2Pick the right motor modelChoose your exact goBILDA motor when you add each one, so the encoder counts and speed limits are right.
- 3feeder is a CRServoAdd it as a Continuous Rotation Servo, or it will only twitch instead of spinning.
- 4pinpoint on I2C, not bus 0Add it as the goBILDA Pinpoint Odometry Computer device type (SDK 12.0+), on bus 1, 2 or 3.
- 5imu is usually already thereIt's the Control Hub's built-in IMU. If it's missing, add it on the Control Hub's I2C bus 0.
- 6Save, then activateActivate the configuration after you save it, then restart your OpMode.
Why does bus 0 matter? See Electrical Gremlins → Port gotchas.