JMotor
Loading...
Searching...
No Matches
JSwerveAngleControlLoopP.h
Go to the documentation of this file.
1#ifndef JSWERVE_ANGLE_CONTROL_LOOP_P_H
2#define JSWERVE_ANGLE_CONTROL_LOOP_P_H
5public:
6 float kP = 0;
7 float range = 0;
8 // TODO: COMMENT
9 JSwerveAngleControlLoopP(float _kP, float _range)
10 {
11 kP = _kP;
12 range = _range;
13 }
14 float calculate(float error)
15 {
16 return constrain(kP * error, -range, range);
17 }
18};
19#endif // JSWERVE_ANGLE_CONTROL_LOOP_P_H
Definition JSwerveAngleControlLoop.h:4
Definition JSwerveAngleControlLoopP.h:4
float range
Definition JSwerveAngleControlLoopP.h:7
float calculate(float error)
Definition JSwerveAngleControlLoopP.h:14
float kP
Definition JSwerveAngleControlLoopP.h:6
JSwerveAngleControlLoopP(float _kP, float _range)
Definition JSwerveAngleControlLoopP.h:9