Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Climber SensorToMechanism Changed and LeftMotor Eliminated #76

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/main/Subsystems/Climber/Climber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

Climber::Climber() {

armLeftMotor.setFollow(armRightMotor.GetDeviceID(), true);

armRightMotor.setSensorToMechanism(ClimberConstants::ArmSensorToMechanism);
armRightMotor.configureMotionMagic(ClimberConstants::ArmCruiseVelocity, ClimberConstants::ArmCruiseAcceleration,
0.0_tr_per_s_cu);
Expand Down
1 change: 0 additions & 1 deletion src/main/Subsystems/Climber/Climber.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class Climber: public frc2::SubsystemBase {

private:
OverTalonFX armRightMotor {ClimberConstants::RightConfig(), "rio"};
OverTalonFX armLeftMotor {ClimberConstants::LeftConfig(), "rio"};

frc2::sysid::SysIdRoutine m_sysIdRoutine
{ frc2::sysid::Config
Expand Down
20 changes: 1 addition & 19 deletions src/main/Subsystems/Climber/ClimberConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
#include "OvertureLib/Sensors/OverCANCoder/OverCANCoder.h"

struct ClimberConstants {
constexpr static const double ArmSensorToMechanism = 200.0;
constexpr static const double ArmSensorToMechanism = 265.8461538;

constexpr static const units::turns_per_second_t ArmCruiseVelocity = 6.0_tps;
constexpr static const units::turns_per_second_squared_t ArmCruiseAcceleration = 13_tr_per_s_sq;

constexpr static const double RightArmMotorId = 20;
constexpr static const double LeftArmMotorId = 21;

constexpr static const units::degree_t ClosedPosition = 0_deg;
constexpr static const units::degree_t MiddlePosition = 20_deg; //The functionality of this position is still to be defined.. It is thought to be a reciving position for the cage.
Expand All @@ -32,21 +31,4 @@ struct ClimberConstants {
return rightConfig;
}

constexpr static const OverTalonFXConfig LeftConfig() {
OverTalonFXConfig leftConfig;
leftConfig.MotorId = LeftArmMotorId;
leftConfig.NeutralMode = ControllerNeutralMode::Brake;
leftConfig.Inverted = true;
leftConfig.useFOC = true;
leftConfig.CurrentLimit = 30_A;
leftConfig.StatorCurrentLimit = 30_A;
leftConfig.TriggerThreshold = 90_A;
leftConfig.TriggerThresholdTime = 1_s;
leftConfig.ClosedLoopRampRate = 0.05_s;
leftConfig.OpenLoopRampRate = 0.05_s;
leftConfig.PIDConfigs.WithKP(15.0);

return leftConfig;
}

};