Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from auscompgeek/fix-smart-motion-min-vel
Browse files Browse the repository at this point in the history
Fix set smart motion min velocity call
  • Loading branch information
willtoth authored Feb 25, 2019
2 parents 095b30d + 722f380 commit f6cf130
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion C++/Smart Motion Example/src/main/cpp/Robot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class Robot : public frc::TimedRobot {
if((ff != kFF)) { m_pidController.SetFF(ff); kFF = ff; }
if((max != kMaxOutput) || (min != kMinOutput)) { m_pidController.SetOutputRange(min, max); kMinOutput = min; kMaxOutput = max; }
if((maxV != kMaxVel)) { m_pidController.SetSmartMotionMaxVelocity(maxV); kMaxVel = maxV; }
if((minV != kMinVel)) { m_pidController.SetSmartMotionMaxVelocity(minV); kMinVel = minV; }
if((minV != kMinVel)) { m_pidController.SetSmartMotionMinOutputVelocity(minV); kMinVel = minV; }
if((maxA != kMaxAcc)) { m_pidController.SetSmartMotionMaxAccel(maxA); kMaxAcc = maxA; }
if((allE != kAllErr)) { m_pidController.SetSmartMotionAllowedClosedLoopError(allE); allE = kAllErr; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void teleopPeriodic() {
kMinOutput = min; kMaxOutput = max;
}
if((maxV != maxVel)) { m_pidController.setSmartMotionMaxVelocity(maxV,0); maxVel = maxV; }
if((minV != minVel)) { m_pidController.setSmartMotionMaxVelocity(minV,0); minVel = minV; }
if((minV != minVel)) { m_pidController.setSmartMotionMinOutputVelocity(minV,0); minVel = minV; }
if((maxA != maxAcc)) { m_pidController.setSmartMotionMaxAccel(maxA,0); maxAcc = maxA; }
if((allE != allowedErr)) { m_pidController.setSmartMotionAllowedClosedLoopError(allE,0); allE = allowedErr; }

Expand Down

0 comments on commit f6cf130

Please sign in to comment.