Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 010df208 authored by Hendrik Wagenaar's avatar Hendrik Wagenaar
Browse files

Add 180 rotation to sensord orientation

Bug: None
Test: Manually tested locally
Change-Id: I135416a2c5be68172ff466bad503261adf29c5a9
parent d787577e
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -435,6 +435,15 @@ void PoseService::UpdatePoseMode() {
            kRotX90 * Rotationd(AngleAxisd(-k90DegInRad, kVecAxisY));
            kRotX90 * Rotationd(AngleAxisd(-k90DegInRad, kVecAxisY));
        start_from_head_rotation =
        start_from_head_rotation =
            (pose_state.sensor_from_start_rotation * kPostRotation).inverse();
            (pose_state.sensor_from_start_rotation * kPostRotation).inverse();
      } else if (device_orientation_type_ == kOrientationTypeLandscape180) {
        const Rotationd kPreRotation =
            Rotationd(AngleAxisd(k90DegInRad * 2.0, kVecAxisY)) *
            Rotationd(AngleAxisd(k90DegInRad * 2.0, kVecAxisZ));
        const Rotationd kPostRotation = kRotX90;
        start_from_head_rotation =
            (kPreRotation *
             pose_state.sensor_from_start_rotation * kPostRotation)
                .inverse();
      } else {
      } else {
        const Rotationd kPreRotation =
        const Rotationd kPreRotation =
            Rotationd(AngleAxisd(k90DegInRad, kVecAxisZ));
            Rotationd(AngleAxisd(k90DegInRad, kVecAxisZ));
+2 −0
Original line number Original line Diff line number Diff line
@@ -43,6 +43,8 @@ class PoseService : public pdx::ServiceBase<PoseService> {
    kOrientationTypePortrait = 1,
    kOrientationTypePortrait = 1,
    // Landscape device.
    // Landscape device.
    kOrientationTypeLandscape = 2,
    kOrientationTypeLandscape = 2,
    // 180 Landscape device.
    kOrientationTypeLandscape180 = 3,
  };
  };


  // Initializes the service. Keeps a reference to sensor_thread, which must be
  // Initializes the service. Keeps a reference to sensor_thread, which must be