Skip to content

Commit

Permalink
Fix linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ssejrog committed Dec 4, 2024
1 parent 5fbede5 commit fc8bebd
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/EZ-Template/PID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "main.h"
#include "util.hpp"
#include "EZ-Template/api.hpp"
#include "api.h"

using namespace ez;

Expand Down
2 changes: 1 addition & 1 deletion src/EZ-Template/auton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "main.h"
#include "EZ-Template/api.hpp"

Auton::Auton() {
Name = "";
Expand Down
2 changes: 1 addition & 1 deletion src/EZ-Template/auton_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "main.h"
#include "EZ-Template/api.hpp"

AutonSelector::AutonSelector() {
auton_count = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/EZ-Template/drive/drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.

#include <list>

#include "main.h"
#include "EZ-Template/sdcard.hpp"
#include "okapi/api/units/QAngle.hpp"
#include "pros/llemu.hpp"
#include "pros/screen.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/EZ-Template/drive/pid_tuner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/api.hpp"
#include "EZ-Template/sdcard.hpp"
#include "liblvgl/llemu.hpp"
#include "pros/llemu.hpp"
#include "pros/misc.h"

Expand Down
1 change: 0 additions & 1 deletion src/EZ-Template/drive/pto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <vector>

#include "drive.hpp"
#include "main.h"

bool Drive::pto_check(pros::Motor check_if_pto) {
auto does_exist = std::find(pto_active.begin(), pto_active.end(), check_if_pto.get_port());
Expand Down
5 changes: 2 additions & 3 deletions src/EZ-Template/drive/set_pid/set_drive_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/util.hpp"
#include "main.h"
#include "EZ-Template/api.hpp"
#include "okapi/api/units/QAngle.hpp"

/////
Expand Down Expand Up @@ -139,7 +138,7 @@ void Drive::pid_drive_set(double target, int speed, bool slew_on, bool toggle_he
// Prioritize custom fwd/rev constants. Otherwise, use the same for fwd and rev
if (fwd_rev_drivePID.constants_set_check() && !new_drive_pid->constants_set_check())
new_drive_pid = &fwd_rev_drivePID;

PID::Constants pid_drive_consts = new_drive_pid->constants_get();
leftPID.constants_set(pid_drive_consts.kp, pid_drive_consts.ki, pid_drive_consts.kd, pid_drive_consts.start_i);
rightPID.constants_set(pid_drive_consts.kp, pid_drive_consts.ki, pid_drive_consts.kd, pid_drive_consts.start_i);
Expand Down
3 changes: 1 addition & 2 deletions src/EZ-Template/drive/set_pid/set_odom_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/util.hpp"
#include "main.h"
#include "EZ-Template/api.hpp"
#include "okapi/api/units/QAngle.hpp"

/////
Expand Down
3 changes: 1 addition & 2 deletions src/EZ-Template/drive/set_pid/set_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/util.hpp"
#include "main.h"
#include "EZ-Template/api.hpp"
#include "okapi/api/units/QAngle.hpp"

// Updates max speed
Expand Down
3 changes: 1 addition & 2 deletions src/EZ-Template/drive/set_pid/set_swing_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/util.hpp"
#include "main.h"
#include "EZ-Template/api.hpp"
#include "okapi/api/units/QAngle.hpp"

/////
Expand Down
3 changes: 1 addition & 2 deletions src/EZ-Template/drive/set_pid/set_turn_pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "EZ-Template/util.hpp"
#include "main.h"
#include "EZ-Template/api.hpp"
#include "okapi/api/units/QAngle.hpp"

/////
Expand Down
27 changes: 14 additions & 13 deletions src/EZ-Template/drive/user_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "main.h"
#include "drive.hpp"
#include "pros/misc.h"

void Drive::opcontrol_arcade_scaling(bool enable) { arcade_vector_scaling = enable; }
bool Drive::opcontrol_arcade_scaling_enabled() { return arcade_vector_scaling; }
Expand Down Expand Up @@ -292,12 +293,12 @@ void Drive::opcontrol_tank() {
// Toggle for controller curve
opcontrol_curve_buttons_iterate();

auto analog_left_value = master.get_analog(ANALOG_LEFT_Y);
auto analog_right_value = master.get_analog(ANALOG_RIGHT_Y);
auto analog_left_value = master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y);
auto analog_right_value = master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y);

// Put the joysticks through the curve function
int l_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_LEFT_Y)));
int r_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_RIGHT_Y)));
int l_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y)));
int r_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y)));

// Set robot to l_stick and r_stick, check joystick threshold, set active brake
opcontrol_joystick_threshold_iterate(l_stick, r_stick);
Expand All @@ -315,12 +316,12 @@ void Drive::opcontrol_arcade_standard(e_type stick_type) {
// Check arcade type (split vs single, normal vs flipped)
if (stick_type == SPLIT) {
// Put the joysticks through the curve function
fwd_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_LEFT_Y)));
turn_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(ANALOG_RIGHT_X)));
fwd_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y)));
turn_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_X)));
} else if (stick_type == SINGLE) {
// Put the joysticks through the curve function
fwd_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_LEFT_Y)));
turn_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(ANALOG_LEFT_X)));
fwd_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_Y)));
turn_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_X)));
}

// Set robot to l_stick and r_stick, check joystick threshold, set active brake
Expand All @@ -339,12 +340,12 @@ void Drive::opcontrol_arcade_flipped(e_type stick_type) {
// Check arcade type (split vs single, normal vs flipped)
if (stick_type == SPLIT) {
// Put the joysticks through the curve function
fwd_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(ANALOG_RIGHT_Y)));
turn_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_LEFT_X)));
fwd_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y)));
turn_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_LEFT_X)));
} else if (stick_type == SINGLE) {
// Put the joysticks through the curve function
fwd_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(ANALOG_RIGHT_Y)));
turn_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(ANALOG_RIGHT_X)));
fwd_stick = opcontrol_curve_right(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_Y)));
turn_stick = opcontrol_curve_left(clipped_joystick(master.get_analog(pros::E_CONTROLLER_ANALOG_RIGHT_X)));
}

// Set robot to l_stick and r_stick, check joystick threshold, set active brake
Expand Down
1 change: 1 addition & 0 deletions src/EZ-Template/sdcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
#include <filesystem>

#include "auton_selector.hpp"
#include "liblvgl/llemu.hpp"
#include "pros/llemu.hpp"
#include "util.hpp"

Expand Down
7 changes: 4 additions & 3 deletions src/EZ-Template/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

#include "util.hpp"

#include "main.h"
#include "EZ-Template/api.hpp"
#include "liblvgl/llemu.hpp"
#include "pros/llemu.hpp"
#include "pros/misc.h"

pros::Controller master(pros::E_CONTROLLER_MASTER);

Expand Down

0 comments on commit fc8bebd

Please sign in to comment.