123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #pragma once
- #include <AP_Common/AP_Common.h>
- #include <AP_HAL/AP_HAL.h>
- #include <AP_Param/AP_Param.h>
- #include <AP_Math/AP_Math.h>
- class TrackPidClass{
- public:
- TrackPidClass(float _p1,float _i1,float _d1,float _p2,float _i2,float _d2);
-
- float motor1_head_target;
- float motor1_head_measure;
- float error_head1;
- float error_last_head1;
- float error_last2_head1;
- float p1;
- float i1;
- float d1;
- float sum1;
- int16_t motor1_out;
-
- float motor2_head_target;
- float motor2_head_measure;
- float error_head2;
- float error_last_head2;
- float error_last2_head2;
- float p2;
- float i2;
- float d2;
- float sum2;
- int16_t motor2_out;
- int16_t updatePID1(float target,float measure,float _error,float MAX);
- int16_t updatePID2(float target,float measure,float _error,float MAX);
- };
|