LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
settledUtil.hpp
Go to the documentation of this file.
1
/*
2
* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
*/
6
#pragma once
7
8
#include "
okapi/api/units/QTime.hpp
"
9
#include "
okapi/api/util/abstractTimer.hpp
"
10
#include <memory>
11
12
namespace
okapi
{
13
class
SettledUtil
{
14
public
:
24
explicit
SettledUtil
(std::unique_ptr<AbstractTimer> iatTargetTimer,
25
double
iatTargetError = 50,
26
double
iatTargetDerivative = 5,
27
QTime iatTargetTime = 250_ms);
28
29
virtual
~SettledUtil
();
30
37
virtual
bool
isSettled
(
double
ierror);
38
42
virtual
void
reset
();
43
44
protected
:
45
double
atTargetError
= 50;
46
double
atTargetDerivative
= 5;
47
QTime
atTargetTime
= 250_ms;
48
std::unique_ptr<AbstractTimer>
atTargetTimer
;
49
double
lastError
= 0;
50
};
51
}
// namespace okapi
QTime.hpp
abstractTimer.hpp
okapi::SettledUtil
Definition
settledUtil.hpp:13
okapi::SettledUtil::~SettledUtil
virtual ~SettledUtil()
okapi::SettledUtil::atTargetTime
QTime atTargetTime
Definition
settledUtil.hpp:47
okapi::SettledUtil::atTargetDerivative
double atTargetDerivative
Definition
settledUtil.hpp:46
okapi::SettledUtil::reset
virtual void reset()
Resets the "at target" timer and clears the previous error.
okapi::SettledUtil::isSettled
virtual bool isSettled(double ierror)
Returns whether the controller is settled.
okapi::SettledUtil::lastError
double lastError
Definition
settledUtil.hpp:49
okapi::SettledUtil::SettledUtil
SettledUtil(std::unique_ptr< AbstractTimer > iatTargetTimer, double iatTargetError=50, double iatTargetDerivative=5, QTime iatTargetTime=250_ms)
A utility class to determine if a control loop has settled based on error.
okapi::SettledUtil::atTargetError
double atTargetError
Definition
settledUtil.hpp:45
okapi::SettledUtil::atTargetTimer
std::unique_ptr< AbstractTimer > atTargetTimer
Definition
settledUtil.hpp:48
okapi
Definition
chassisController.hpp:16
include
okapi
api
control
util
settledUtil.hpp
Generated by
1.9.8