Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
cameron-goddard committed Dec 13, 2024
1 parent bda490e commit 8780358
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/Control Tasks/MotorControlTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void MotorControlTask::execute() {
set_white();
}

if (sfr::motor::spinning_up ) {
if (sfr::motor::spinning_up) {
vlogln("asking it to spin up: ");
spinup();
}
Expand Down Expand Up @@ -66,7 +66,7 @@ void MotorControlTask::control() {
time_curr = millis();

sfr::imu::failed_init = true;
if (sfr::imu::failed_init == false){
if (sfr::imu::failed_init == false) {

// calculate PID terms
proportional = Kp * error_curr;
Expand All @@ -85,18 +85,17 @@ void MotorControlTask::control() {
duty_cycle = 1920.00;
}
// convert duty cycle to angle for esc
}else{ // open loop

} else { // open loop
duty_cycle = 1800;
}

angle = map(duty_cycle, 1000, 2000, 0, 180);
vlogln("ANGLE: " + String(angle));
// write to esc
esc.write(angle);


// store values to be recorded
// store values to be recorded
sfr::controller::record_error = error_curr;
sfr::controller::record_delta_error = error_curr - error_prev;
sfr::controller::record_delta_time = time_curr - time_prev;
Expand Down
2 changes: 1 addition & 1 deletion src/Monitors/IMUMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ void IMUMonitor::execute() {
} else {
vlogln("Error: IMU failed to read");
// TODO: Log this failure.
sfr::imu::failed_init = true; //change to diff boolean
sfr::imu::failed_init = true; // change to diff boolean
}
}

0 comments on commit 8780358

Please sign in to comment.