Allow for falcon inverting in swerve_module
Signed-off-by: Maxwell Henderson <maxwell.henderson@mailbox.org>
Change-Id: Ibbe7a28396fa3f249788d3f7b1e18d3eb384f0ec
diff --git a/frc971/wpilib/swerve/swerve_drivetrain_writer.cc b/frc971/wpilib/swerve/swerve_drivetrain_writer.cc
index 2b6ef9e..bfc5d73 100644
--- a/frc971/wpilib/swerve/swerve_drivetrain_writer.cc
+++ b/frc971/wpilib/swerve/swerve_drivetrain_writer.cc
@@ -37,8 +37,8 @@
void DrivetrainWriter::WriteConfigs() {
for (auto module : {front_left_, front_right_, back_left_, back_right_}) {
- module->rotation->WriteConfigs(false);
- module->translation->WriteConfigs(false);
+ module->rotation->WriteConfigs();
+ module->translation->WriteConfigs();
}
}
diff --git a/frc971/wpilib/swerve/swerve_module.h b/frc971/wpilib/swerve/swerve_module.h
index 534f0ce..f449afa 100644
--- a/frc971/wpilib/swerve/swerve_module.h
+++ b/frc971/wpilib/swerve/swerve_module.h
@@ -8,14 +8,15 @@
namespace swerve {
struct SwerveModule {
- SwerveModule(int rotation_id, int translation_id, std::string canbus,
+ SwerveModule(FalconParams rotation_params, FalconParams translation_params,
+ std::string canbus,
std::vector<ctre::phoenix6::BaseStatusSignal *> *signals,
double stator_current_limit, double supply_current_limit)
- : rotation(std::make_shared<Falcon>(rotation_id, canbus, signals,
+ : rotation(std::make_shared<Falcon>(rotation_params, canbus, signals,
stator_current_limit,
supply_current_limit)),
- translation(std::make_shared<Falcon>(translation_id, canbus, signals,
- stator_current_limit,
+ translation(std::make_shared<Falcon>(translation_params, canbus,
+ signals, stator_current_limit,
supply_current_limit)) {}
void WriteModule(