diff --git a/pupil_src/shared_modules/head_pose_tracker/controller/online_controller.py b/pupil_src/shared_modules/head_pose_tracker/controller/online_controller.py index f2802a2bf6..d4c7bea848 100644 --- a/pupil_src/shared_modules/head_pose_tracker/controller/online_controller.py +++ b/pupil_src/shared_modules/head_pose_tracker/controller/online_controller.py @@ -47,6 +47,7 @@ def _on_recent_events(self, events): self._calculate_current_markers(events["frame"]) self._calculate_current_pose(events["frame"]) self._save_key_markers() + events["head_pose"] = self._create_head_pose_events() def _calculate_current_markers(self, frame): self._detection_storage.current_markers = worker.online_detection(frame) @@ -60,6 +61,14 @@ def _calculate_current_pose(self, frame): self._camera_intrinsics, ) + def _create_head_pose_events(self): + """ + Creates head pose events to be added to the current list of events. + """ + position = {"topic": "head_pose"} + position.update(self._localization_storage.current_pose) + return [position] + def _save_key_markers(self): if self._general_settings.optimize_markers_3d_model: self._optimization_storage.all_key_markers += pick_key_markers.run(