Skip to content

Commit

Permalink
Merge pull request #1774 from moiri/stream_head_pose_tracker
Browse files Browse the repository at this point in the history
Stream Head Pose to ZMQ
  • Loading branch information
Patrick Faion authored Jan 7, 2020
2 parents 6e1aa01 + 631e126 commit ba43d70
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down

0 comments on commit ba43d70

Please sign in to comment.