Skip to content

Commit

Permalink
change set_brake_mode to set_brake_mode_all
Browse files Browse the repository at this point in the history
  • Loading branch information
Rocky14683 committed Jun 27, 2024
1 parent ddec0fd commit d2b4317
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/VOSS/chassis/DiffChassis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ DiffChassis::DiffChassis(std::initializer_list<int8_t> left_motors,

this->slew_step = slew_step > 0 ? slew_step : 200;
this->brakeMode = brakeMode;
this->left_motors->set_brake_mode(this->brakeMode);
this->right_motors->set_brake_mode(this->brakeMode);
this->left_motors->set_brake_mode_all(this->brakeMode);
this->right_motors->set_brake_mode_all(this->brakeMode);
this->prev_voltages = {0, 0};
}

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

void DiffChassis::set_brake_mode(pros::motor_brake_mode_e mode) {
this->brakeMode = mode;
this->left_motors->set_brake_mode(mode);
this->right_motors->set_brake_mode(mode);
this->left_motors->set_brake_mode_all(mode);
this->right_motors->set_brake_mode_all(mode);
}

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

} else if (v.left == 0) {
this->left_motors->set_brake_mode(pros::MotorBrake::hold);
this->left_motors->set_brake_mode_all(pros::MotorBrake::hold);
this->left_motors->brake();
if (v_max > max) {
v.right = v.right * max / v_max;
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ auto ec = voss::controller::ExitConditions::new_conditions()
return master.get_digital(pros::E_CONTROLLER_DIGITAL_UP);
});

auto chassis = voss::chassis::DiffChassis(LEFT_MOTORS, RIGHT_MOTORS, pid, ec,
auto chassis = voss::chassis::DiffChassis(LEFT_MOTORS, RIGHT_MOTORS, pid, ec, 0,
pros::E_MOTOR_BRAKE_COAST);

pros::IMU imu(16);
Expand Down

0 comments on commit d2b4317

Please sign in to comment.