LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
chassisController.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
13#include <memory>
14#include <valarray>
15
16namespace okapi {
18 public:
26 explicit ChassisController() = default;
27
28 virtual ~ChassisController() = default;
29
35 virtual void moveDistance(QLength itarget) = 0;
36
42 virtual void moveRaw(double itarget) = 0;
43
49 virtual void moveDistanceAsync(QLength itarget) = 0;
50
56 virtual void moveRawAsync(double itarget) = 0;
57
63 virtual void turnAngle(QAngle idegTarget) = 0;
64
70 virtual void turnRaw(double idegTarget) = 0;
71
77 virtual void turnAngleAsync(QAngle idegTarget) = 0;
78
84 virtual void turnRawAsync(double idegTarget) = 0;
85
91 virtual void setTurnsMirrored(bool ishouldMirror) = 0;
92
98 virtual bool isSettled() = 0;
99
103 virtual void waitUntilSettled() = 0;
104
108 virtual void stop() = 0;
109
115 virtual void setMaxVelocity(double imaxVelocity) = 0;
116
120 virtual double getMaxVelocity() const = 0;
121
125 virtual ChassisScales getChassisScales() const = 0;
126
131
135 virtual std::shared_ptr<ChassisModel> getModel() = 0;
136
140 virtual ChassisModel &model() = 0;
141};
142} // namespace okapi
virtual ChassisModel & model()=0
virtual void waitUntilSettled()=0
Delays until the currently executing movement completes.
virtual ChassisScales getChassisScales() const =0
Get the ChassisScales.
virtual double getMaxVelocity() const =0
virtual void setTurnsMirrored(bool ishouldMirror)=0
Sets whether turns should be mirrored.
virtual void moveDistanceAsync(QLength itarget)=0
Sets the target distance for the robot to drive straight (using closed-loop control).
virtual void moveDistance(QLength itarget)=0
Drives the robot straight for a distance (using closed-loop control).
virtual void moveRaw(double itarget)=0
Drives the robot straight for a distance (using closed-loop control).
virtual void turnAngleAsync(QAngle idegTarget)=0
Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
virtual ~ChassisController()=default
virtual std::shared_ptr< ChassisModel > getModel()=0
ChassisController()=default
A ChassisController adds a closed-loop layer on top of a ChassisModel.
virtual void setMaxVelocity(double imaxVelocity)=0
Sets a new maximum velocity in RPM [0-600].
virtual AbstractMotor::GearsetRatioPair getGearsetRatioPair() const =0
Get the GearsetRatioPair.
virtual void turnAngle(QAngle idegTarget)=0
Turns the robot clockwise in place (using closed-loop control).
virtual void stop()=0
Interrupts the current movement to stop the robot.
virtual void moveRawAsync(double itarget)=0
Sets the target distance for the robot to drive straight (using closed-loop control).
virtual void turnRaw(double idegTarget)=0
Turns the robot clockwise in place (using closed-loop control).
virtual bool isSettled()=0
Checks whether the internal controllers are currently settled.
virtual void turnRawAsync(double idegTarget)=0
Sets the target angle for the robot to turn clockwise in place (using closed-loop control).
A version of the ReadOnlyChassisModel that also supports write methods, such as setting motor speed.
A simple structure representing the full ratio between motor and wheel.