Skip to content

Commit

Permalink
Removed reset profiled move state.
Browse files Browse the repository at this point in the history
  • Loading branch information
NottheIRS committed Mar 15, 2024
1 parent f8d1294 commit b86d1de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/main/cpp/subsystems/LauncherHAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ LauncherHAL::LauncherHAL()
m_FlywheelTop.GetConfigurator().Apply(configs);
m_FlywheelBottom.GetConfigurator().Apply(configs);

m_currentAngle = -100.0;
}

void LauncherHAL::SetFlywheelSpeed(double speed)
Expand Down Expand Up @@ -172,6 +173,12 @@ void LauncherHAL::SetAngle(double angle)

void LauncherHAL::ProfiledMoveToAngle(double angle)
{
if (std::fabs(m_currentAngle - angle) >= 1e-8)
{
m_profileState = 0;
m_currentAngle = angle;
}

switch(m_profileState)
{
case 0:
Expand Down Expand Up @@ -234,5 +241,5 @@ double LauncherHAL::GetFlywheelSpeed()

void LauncherHAL::ResetProfiledMoveState()
{
m_profileState = 0;
// m_profileState = 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ void LauncherManager::ResetLauncher()
m_goToSubPos = false;
m_visionResetProfiledMoveState = false;
}

void LauncherManager::HandleInput(LauncherInput &launcherInput, LauncherOutput &launcherOutput, IntakeInput &intakeInput, IntakeOutput &intakeOutput)
{

Expand Down
2 changes: 1 addition & 1 deletion src/main/include/subsystems/LauncherHAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ class LauncherHAL
double m_ProfileStartPos;
double m_indexerSpeed;
int m_profileState = 0;

double m_currentAngle;
void SetAngle(double angle);
};

0 comments on commit b86d1de

Please sign in to comment.