Active Brake
By default, the drivetrain is on coast
where if you let go of the joysticks the robot will continue to move a bit. Â Generally, this seems like the preferred way the community likes to control their robots, and people don't like the feel of driving on brake
or hold
(which is a fully preference-based decision). Â
Active brake gives you more control than these 3 states. Â Active brake will run a P loop when you let go of the joysticks, giving you full control over how aggressive this is. Â You can use it along with coast
and have the kP
be super low so you still feel like it's on coast but it'll only move so far. Â
void initialize() {
 // . . .
chassis.opcontrol_drive_activebrake_set(2.0); Â // Sets the active brake kP. We recommend ~2. Â 0 will disable. Â
 // . . .
}