Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rennis250 committed Aug 21, 2024
1 parent b3ad60f commit cc8a873
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions alpha-lab/imu-transformations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ the `gaze_scene_to_world` function to reconstruct the pose of the eyes in the wo

When studying head orientation and gaze orientation as observers navigate a 3D environment, it can be useful
to know how much these quantities deviate from pointing at a given landmark. For instance, you might want to
know when someone’s gaze or heading deviates from pointing at the horizon. This can be simplified by
know when someone’s gaze or heading deviates from parallel with the horizon. This can be simplified by
converting world points from Cartesian to spherical coordinates. The orientation values from the IMU are already in such a format.
For the values returned by `gaze_scene_to_world`, the function below will do the necessary transformation.
When wearing Neon normally, then an elevation and azimuth of 0 degrees corresponds to a neutral orientation:
Expand All @@ -96,7 +96,6 @@ eye3d = pd.read_csv("3d_eye_states.csv")
imu = pd.read_csv("imu.csv")

gaze_ts = gaze["timestamp [ns]"]
eye3d_ts = eye3d["timestamp [ns]"]
imu_ts = imu["timestamp [ns]"]

# We have more gaze datapoints (sampled at 200Hz) than
Expand Down Expand Up @@ -133,6 +132,11 @@ eyeball_centers_left = np.array([

imu_headings = imu_heading_in_world(quaternions_resampled)

world_accelerations = imu_acceleration_in_world(
accelerations_resampled,
quaternions_resampled,
)

world_gazes = gaze_scene_to_world(
gaze["elevation [deg]"],
gaze["azimuth [deg]"],
Expand All @@ -145,11 +149,6 @@ eye_centers_left_world, optical_axes_left_world = eyestate_to_world(
quaternions_resampled,
)

world_accelerations = imu_acceleration_in_world(
accelerations_resampled,
quaternions_resampled,
)

gaze_elevations_world, gaze_azimuths_world = cartesian_to_spherical_world(world_gazes)
```

Expand Down

0 comments on commit cc8a873

Please sign in to comment.