Merge "Add 180 rotation to sensord orientation" into oc-dev
diff --git a/services/vr/sensord/pose_service.cpp b/services/vr/sensord/pose_service.cpp
index 32a2160..2c4fc30 100644
--- a/services/vr/sensord/pose_service.cpp
+++ b/services/vr/sensord/pose_service.cpp
@@ -435,6 +435,15 @@
             kRotX90 * Rotationd(AngleAxisd(-k90DegInRad, kVecAxisY));
         start_from_head_rotation =
             (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 {
         const Rotationd kPreRotation =
             Rotationd(AngleAxisd(k90DegInRad, kVecAxisZ));
diff --git a/services/vr/sensord/pose_service.h b/services/vr/sensord/pose_service.h
index 899d5fb..4df5036 100644
--- a/services/vr/sensord/pose_service.h
+++ b/services/vr/sensord/pose_service.h
@@ -43,6 +43,8 @@
     kOrientationTypePortrait = 1,
     // Landscape device.
     kOrientationTypeLandscape = 2,
+    // 180 Landscape device.
+    kOrientationTypeLandscape180 = 3,
   };
 
   // Initializes the service. Keeps a reference to sensor_thread, which must be