-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
112 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
#include "subsystems/IntakeSubsystem.h" | ||
#include <frc/smartdashboard/SmartDashboard.h> | ||
|
||
IntakeSubsystem::IntakeSubsystem() { | ||
|
||
ConfigureIntakeMotor(consts::intake::physical::INVERT_MOTOR, consts::intake::physical::INTAKE_RATIO, consts::intake::current_limits::SUPPLY_CURRENT_LIMIT, consts::intake::current_limits::STATOR_CURRENT_LIMIT); | ||
ConfigureMotorSignals(); | ||
SetName("IntakeSubsystem"); | ||
frc::SmartDashboard::PutData(this); | ||
} | ||
|
||
// This method will be called once per scheduler run | ||
void IntakeSubsystem::Periodic() {} | ||
|
||
bool IntakeSubsystem::ConfigureIntakeMotor(bool invert, | ||
units::scalar_t intakeGearing, | ||
units::ampere_t supplyCurrentLimit, | ||
units::ampere_t statorCurrentLimit) { | ||
return true; | ||
} | ||
|
||
|
||
bool IntakeSubsystem::ConfigureMotorSignals() { | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d7b9781 | ||
f5a5c55 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright (c) FRC 2053. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the MIT License file in the root of this project | ||
|
||
#pragma once | ||
|
||
#include <frc/system/plant/DCMotor.h> | ||
#include <units/base.h> | ||
#include <units/velocity.h> | ||
#include <wpi/interpolating_map.h> | ||
#include <units/dimensionless.h> | ||
#include <units/moment_of_inertia.h> | ||
|
||
#include "str/Gains.h" | ||
|
||
namespace consts { | ||
namespace intake { | ||
namespace can_ids { | ||
inline constexpr int INTAKE = 17; | ||
} // namespace can_ids | ||
|
||
namespace current_limits { | ||
inline constexpr units::ampere_t SUPPLY_CURRENT_LIMIT = 60_A; | ||
inline constexpr units::ampere_t STATOR_CURRENT_LIMIT = 180_A; | ||
} // namespace current_limits | ||
|
||
namespace physical { | ||
|
||
inline constexpr bool INVERT_MOTOR = false; | ||
|
||
inline constexpr units::scalar_t INTAKE_RATIO = (24.0 / 16.0); | ||
|
||
inline constexpr frc::DCMotor SHOOTER_MOTOR = frc::DCMotor::Falcon500(1); | ||
|
||
inline constexpr units::meter_t WHEEL_RADIUS = 1_in; | ||
|
||
//From onshape doc | ||
inline constexpr units::kilogram_square_meter_t FLYWHEEL_MOI = 12.350445 * 1_in * 1_in * 1_lb; | ||
} // namespace physical | ||
} // namespace intake | ||
} // namespace consts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
#pragma once | ||
|
||
#include <frc2/command/SubsystemBase.h> | ||
#include <units/current.h> | ||
#include <units/base.h> | ||
#include <networktables/NetworkTableInstance.h> | ||
#include <networktables/DoubleTopic.h> | ||
#include <constants/IntakeConstants.h> | ||
|
||
class IntakeSubsystem : public frc2::SubsystemBase { | ||
public: | ||
IntakeSubsystem(); | ||
|
||
/** | ||
* Will be called periodically whenever the CommandScheduler runs. | ||
*/ | ||
void Periodic() override; | ||
|
||
|
||
private: | ||
void UpdateNTEntries(); | ||
bool ConfigureIntakeMotor(bool invert, | ||
units::scalar_t intakeGearing, | ||
units::ampere_t supplyCurrentLimit, | ||
units::ampere_t statorCurrentLimit); | ||
bool ConfigureMotorSignals(); | ||
|
||
std::shared_ptr<nt::NetworkTable> nt{ | ||
nt::NetworkTableInstance::GetDefault().GetTable("Intake")}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters