123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include <AP_Math/AP_Math.h>
- class Compass;
- class Compass_PerMotor {
- public:
- static const struct AP_Param::GroupInfo var_info[];
- Compass_PerMotor(Compass &_compass);
- bool enabled(void) const {
- return enable.get() != 0;
- }
-
- void set_voltage(float _voltage) {
-
- voltage = 0.9f * voltage + 0.1f * _voltage;
- }
- void calibration_start(void);
- void calibration_update(void);
- void calibration_end(void);
- void compensate(Vector3f &offset);
-
- private:
- Compass &compass;
- AP_Int8 enable;
- AP_Float expo;
- AP_Vector3f compensation[4];
-
- Vector3f base_field;
-
-
- Vector3f field_sum[4];
-
- float output_sum[4];
-
-
- uint16_t count[4];
-
- uint32_t start_ms[4];
-
-
- float voltage;
-
- bool running;
-
- float scaled_output(uint8_t motor);
-
- bool have_motor_map;
- uint8_t motor_map[4];
- };
|