LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
asyncPosPidController.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
14#include <memory>
15
16namespace okapi {
17class AsyncPosPIDController : public AsyncWrapper<double, double>,
18 public AsyncPositionController<double, double> {
19 public:
34 const std::shared_ptr<ControllerInput<double>> &iinput,
35 const std::shared_ptr<ControllerOutput<double>> &ioutput,
36 const TimeUtil &itimeUtil,
37 double ikP,
38 double ikI,
39 double ikD,
40 double ikBias = 0,
41 double iratio = 1,
42 std::unique_ptr<Filter> iderivativeFilter = std::make_unique<PassthroughFilter>(),
43 const std::shared_ptr<Logger> &ilogger = Logger::getDefaultLogger());
44
59 const std::shared_ptr<OffsetableControllerInput> &iinput,
60 const std::shared_ptr<ControllerOutput<double>> &ioutput,
61 const TimeUtil &itimeUtil,
62 double ikP,
63 double ikI,
64 double ikD,
65 double ikBias = 0,
66 double iratio = 1,
67 std::unique_ptr<Filter> iderivativeFilter = std::make_unique<PassthroughFilter>(),
68 const std::shared_ptr<Logger> &ilogger = Logger::getDefaultLogger());
69
73 void tarePosition() override;
74
80 void setMaxVelocity(std::int32_t imaxVelocity) override;
81
88
95
96 protected:
97 std::shared_ptr<OffsetableControllerInput> offsettableInput;
98 std::shared_ptr<IterativePosPIDController> internalController;
99};
100} // namespace okapi
AsyncPosPIDController(const std::shared_ptr< ControllerInput< double > > &iinput, const std::shared_ptr< ControllerOutput< double > > &ioutput, const TimeUtil &itimeUtil, double ikP, double ikI, double ikD, double ikBias=0, double iratio=1, std::unique_ptr< Filter > iderivativeFilter=std::make_unique< PassthroughFilter >(), const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
An async position PID controller.
std::shared_ptr< IterativePosPIDController > internalController
void tarePosition() override
Sets the "absolute" zero position of the controller to its current position.
void setMaxVelocity(std::int32_t imaxVelocity) override
This implementation does not respect the maximum velocity.
AsyncPosPIDController(const std::shared_ptr< OffsetableControllerInput > &iinput, const std::shared_ptr< ControllerOutput< double > > &ioutput, const TimeUtil &itimeUtil, double ikP, double ikI, double ikD, double ikBias=0, double iratio=1, std::unique_ptr< Filter > iderivativeFilter=std::make_unique< PassthroughFilter >(), const std::shared_ptr< Logger > &ilogger=Logger::getDefaultLogger())
An async position PID controller.
std::shared_ptr< OffsetableControllerInput > offsettableInput
IterativePosPIDController::Gains getGains() const
Gets the current gains.
void setGains(const IterativePosPIDController::Gains &igains)
Set controller gains.
static std::shared_ptr< Logger > getDefaultLogger()
Utility class for holding an AbstractTimer, AbstractRate, and SettledUtil together in one class since...
Definition timeUtil.hpp:18