Fix errors from previous commit

This commit is contained in:
evlryah 2023-09-27 18:11:45 -05:00
parent 6b778e2321
commit 05b28b578a

View File

@ -94,16 +94,17 @@ swerve_drive updateSwerveCommand(swerve_drive input)
robot_current_measured_speed = fabs( (front_left_measured_speed + front_right_measured_speed + back_left_measured_speed + back_right_measured_speed) / (float) (4 * (ENCODER_BUFFER_ENTRY_COUNT - 1)) );
// Determine how quickly it is safe to change the orientation of the wheels, given the robot's current speed
if(robot_current_measured_speed <= MAX_SPEED_WHEEL_SPIN && )
if(robot_current_measured_speed <= MAX_SPEED_WHEEL_SPIN /* || TODO: difference between current spin and target spin is above a certain number of degrees */)
{ // Robot is going below maximum speed to significantly spin wheels
// TODO as of 20230927 : set stepper motor power and target
} else { // Robot is going above the maximum speed to significantly spin wheels at full power, and the wheels are being commanded to spin significantly, so limit the power supplied to the spin stepper motors
// TODO as of 20230927 : set stepper motor power and target, limit power due to high body speed, decelerate to allow robot to modify steering safely (set motor power to 0)
front_left_power = 0.0f;
front_right_power = 0.0f;
back_left_power = 0.0f;
back_right_power = 0.0f;
out.front_left_power = 0.0f;
out.front_right_power = 0.0f;
out.back_left_power = 0.0f;
out.back_right_power = 0.0f;
}
// Set the new commanded orientation of the spin stepper motors