tlv_sensor.h 704 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #include <SimpleFOC.h>
  3. #include <Tlv493d.h>
  4. class TlvSensor : public Sensor {
  5. public:
  6. TlvSensor();
  7. // initialize the sensor hardware
  8. void init();
  9. // Get current shaft angle from the sensor hardware, and
  10. // return it as a float in radians, in the range 0 to 2PI.
  11. // - This method is pure virtual and must be implemented in subclasses.
  12. // Calling this method directly does not update the base-class internal fields.
  13. // Use update() when calling from outside code.
  14. float getSensorAngle();
  15. private:
  16. Tlv493d tlv_ = Tlv493d();
  17. float x_;
  18. float y_;
  19. uint32_t last_update_;
  20. };