Skip to content

Commit d2b4317

Browse files
committed
change set_brake_mode to set_brake_mode_all
1 parent ddec0fd commit d2b4317

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Diff for: src/VOSS/chassis/DiffChassis.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ DiffChassis::DiffChassis(std::initializer_list<int8_t> left_motors,
3535

3636
this->slew_step = slew_step > 0 ? slew_step : 200;
3737
this->brakeMode = brakeMode;
38-
this->left_motors->set_brake_mode(this->brakeMode);
39-
this->right_motors->set_brake_mode(this->brakeMode);
38+
this->left_motors->set_brake_mode_all(this->brakeMode);
39+
this->right_motors->set_brake_mode_all(this->brakeMode);
4040
this->prev_voltages = {0, 0};
4141
}
4242

@@ -55,8 +55,8 @@ void DiffChassis::arcade(double forward_speed, double turn_speed) {
5555

5656
void DiffChassis::set_brake_mode(pros::motor_brake_mode_e mode) {
5757
this->brakeMode = mode;
58-
this->left_motors->set_brake_mode(mode);
59-
this->right_motors->set_brake_mode(mode);
58+
this->left_motors->set_brake_mode_all(mode);
59+
this->right_motors->set_brake_mode_all(mode);
6060
}
6161

6262
// Evoke the chassis to move according to how it was set up using the
@@ -114,7 +114,7 @@ bool DiffChassis::execute(DiffChassisCommand cmd, double max) {
114114
[this, max](diff_commands::Swing& v) {
115115
double v_max = std::max(fabs(v.left), fabs(v.right));
116116
if (v.right == 0) {
117-
this->right_motors->set_brake_mode(pros::MotorBrake::hold);
117+
this->right_motors->set_brake_mode_all(pros::MotorBrake::hold);
118118
this->right_motors->brake();
119119
if (v_max > max) {
120120
v.left = v.left * max / v_max;
@@ -124,7 +124,7 @@ bool DiffChassis::execute(DiffChassisCommand cmd, double max) {
124124
this->prev_voltages = {v.left, 0.0};
125125

126126
} else if (v.left == 0) {
127-
this->left_motors->set_brake_mode(pros::MotorBrake::hold);
127+
this->left_motors->set_brake_mode_all(pros::MotorBrake::hold);
128128
this->left_motors->brake();
129129
if (v_max > max) {
130130
v.right = v.right * max / v_max;

Diff for: src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ auto ec = voss::controller::ExitConditions::new_conditions()
5656
return master.get_digital(pros::E_CONTROLLER_DIGITAL_UP);
5757
});
5858

59-
auto chassis = voss::chassis::DiffChassis(LEFT_MOTORS, RIGHT_MOTORS, pid, ec,
59+
auto chassis = voss::chassis::DiffChassis(LEFT_MOTORS, RIGHT_MOTORS, pid, ec, 0,
6060
pros::E_MOTOR_BRAKE_COAST);
6161

6262
pros::IMU imu(16);

0 commit comments

Comments
 (0)