Skip to content

Commit

Permalink
depth camera update 2
Browse files Browse the repository at this point in the history
Signed-off-by: Ken Haagh <[email protected]>
  • Loading branch information
KenH2 committed Dec 14, 2023
1 parent e4ae7e0 commit 724254e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions people_tracking/src/people_tracking/depth_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,18 @@ def find_closest_index(self, desired_time):

def get_depth_data(self, data):
"""Get data from image and publish it to the topic if data available."""
desired_time = data.desired_timestamp
desired_image = self.find_closest_index(desired_time)
# desired_time = data.desired_timestamp
# desired_image = self.find_closest_index(desired_time)
#
# if desired_image is not None:
# bridge = CvBridge()
# depth_image_msg = bridge.cv2_to_imgmsg(desired_image, encoding="passthrough")
# return depth_image_msg
# else:
# rospy.logwarn("No depth image available.")
# return Image()

if desired_image is not None:
bridge = CvBridge()
depth_image_msg = bridge.cv2_to_imgmsg(desired_image, encoding="passthrough")
return depth_image_msg
else:
rospy.logwarn("No depth image available.")
return Image()
return self.bridge.cv2_to_imgmsg(self.depth_images[-1][1], encoding="passthrough")


if __name__ == '__main__':
Expand Down

0 comments on commit 724254e

Please sign in to comment.