LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
closedLoopController.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
10
11namespace okapi {
18template <typename Input, typename Output>
20 public:
21 virtual ~ClosedLoopController() = default;
22
28 virtual void setTarget(Input itarget) = 0;
29
35 virtual Input getTarget() = 0;
36
40 virtual Input getProcessValue() const = 0;
41
47 virtual Output getError() const = 0;
48
57 virtual bool isSettled() = 0;
58
63 virtual void reset() = 0;
64
69 virtual void flipDisable() = 0;
70
77 virtual void flipDisable(bool iisDisabled) = 0;
78
84 virtual bool isDisabled() const = 0;
85};
86} // namespace okapi
An abstract closed-loop controller.
virtual Input getTarget()=0
Gets the last set target, or the default target if none was set.
virtual bool isDisabled() const =0
Returns whether the controller is currently disabled.
virtual Output getError() const =0
Returns the last error of the controller.
virtual void flipDisable(bool iisDisabled)=0
Sets whether the controller is off or on.
virtual void reset()=0
Resets the controller's internal state so it is similar to when it was first initialized,...
virtual ~ClosedLoopController()=default
virtual void flipDisable()=0
Changes whether the controller is off or on.
virtual Input getProcessValue() const =0
virtual void setTarget(Input itarget)=0
Sets the target for the controller.
virtual bool isSettled()=0
Returns whether the controller has settled at the target.