ImuMeasurement.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <tests/Measurement.h>
  3. namespace gtsam {
  4. /**
  5. *\brief Contains data from the IMU mesaurements.
  6. */
  7. class ImuMeasurement : public Measurement {
  8. public:
  9. enum Name { BODY = 0, RF_FOOT = 1, RH_FOOT = 2 };
  10. Name name; ///< Unique string identifier
  11. Eigen::Vector3d I_a_WI; ///< Raw acceleration from the IMU (m/s/s)
  12. Eigen::Vector3d I_w_WI; ///< Raw angular velocity from the IMU (rad/s)
  13. ImuMeasurement()
  14. : Measurement("ImuMeasurement"), I_a_WI{0, 0, 0}, I_w_WI{0, 0, 0} {}
  15. ~ImuMeasurement() override {}
  16. friend std::ostream& operator<<(std::ostream& stream,
  17. const ImuMeasurement& meas);
  18. };
  19. std::ostream& operator<<(std::ostream& stream, const ImuMeasurement& meas) {
  20. stream << "IMU Measurement at time = " << meas.time << " : \n"
  21. << "dt : " << meas.dt << "\n"
  22. << "I_a_WI: " << meas.I_a_WI.transpose() << "\n"
  23. << "I_w_WI: " << meas.I_w_WI.transpose() << "\n";
  24. return stream;
  25. }
  26. } // namespace gtsam