Skip to content

Commit

Permalink
Use camera_frame_id parameter as the frame id of transform to the det…
Browse files Browse the repository at this point in the history
…ected human
  • Loading branch information
Wiktor-99 committed Jul 14, 2024
1 parent 1dad9cb commit 36c865e
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions human_detector/human_detector/human_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,18 +138,18 @@ def timer_callback(self):
self.publish_image_with_detected_human()

def broadcast_timer_callback(self):
t = TransformStamped()
t.header.stamp = self.get_clock().now().to_msg()
t.header.frame_id = 'camera_link'
t.child_frame_id = self.parameters.detected_human_frame_id
t.transform.translation.x = self.detected_human_position_world['x']
t.transform.translation.y = self.detected_human_position_world['y']
t.transform.translation.z = self.detected_human_position_world['z']
t.transform.rotation.x = 0.0
t.transform.rotation.y = 0.0
t.transform.rotation.z = 0.0
t.transform.rotation.w = 1.0
self.tf_broadcaster.sendTransform(t)
transform = TransformStamped()
transform.header.stamp = self.get_clock().now().to_msg()
transform.header.frame_id = self.parameters.camera_frame_id
transform.child_frame_id = self.parameters.detected_human_frame_id
transform.transform.translation.x = self.detected_human_position_world['x']
transform.transform.translation.y = self.detected_human_position_world['y']
transform.transform.translation.z = self.detected_human_position_world['z']
transform.transform.rotation.x = 0.0
transform.transform.rotation.y = 0.0
transform.transform.rotation.z = 0.0
transform.transform.rotation.w = 1.0
self.tf_broadcaster.sendTransform(transform)

def draw_person_pose(self, image, landmarks):
if landmarks is not None:
Expand Down

0 comments on commit 36c865e

Please sign in to comment.