Skip to content

Commit

Permalink
Added a simple loop to refresh the frame taken, should work fine.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed Feb 27, 2024
1 parent d4a677a commit 7d1d84b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions skills/src/lasr_skills/vision/get_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,11 @@ def __init__(self, topic: str = None):

def execute(self, userdata):
try:
userdata.img_msg_2d = rospy.wait_for_message(
self.topic1, Image)
userdata.img_msg_3d = rospy.wait_for_message(
self.topic2, PointCloud2)
for _ in range(5): # This is a little change, see if helps avoid having delayed frame issue.
userdata.img_msg_2d = rospy.wait_for_message(
self.topic1, Image)
userdata.img_msg_3d = rospy.wait_for_message(
self.topic2, PointCloud2)
except Exception as e:
print(e)
return 'failed'
Expand Down

0 comments on commit 7d1d84b

Please sign in to comment.