Skip to content

Commit

Permalink
Updated camera movement suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed Jun 27, 2024
1 parent 83d3329 commit 600435b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
18 changes: 4 additions & 14 deletions skills/src/lasr_skills/adjust_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,12 @@
'leftEye',
'leftEar',
'leftShoulder',
'leftElbow',
'leftWrist',
'leftHip',
'leftKnee',
'leftAnkle',
}

RIGHT = {
'rightEye',
'rightEar',
'rightShoulder',
'rightElbow',
'rightWrist',
'rightHip',
'rightKnee',
'rightAnkle',
}

HEAD = {
Expand Down Expand Up @@ -80,12 +70,12 @@ def execute(self, userdata):
miss_head = len(missing_keypoints.intersection(HEAD)) >= 3
miss_middle = len(missing_keypoints.intersection(MIDDLE)) >= 2
miss_torso = len(missing_keypoints.intersection(TORSO)) >= 3
miss_left = len(missing_keypoints.intersection(LEFT)) >= 5
miss_right = len(missing_keypoints.intersection(RIGHT)) >= 5
miss_left = len(missing_keypoints.intersection(LEFT)) >= 2
miss_right = len(missing_keypoints.intersection(RIGHT)) >= 2
rospy.logwarn(f"Missing head: {miss_head}, middle: {miss_middle}, torso: {miss_torso}, left: {miss_left}, right: {miss_right}.")
needs_to_move_up = miss_head and (not miss_torso or not miss_middle)
needs_to_move_down = not miss_head and miss_torso and miss_middle
needs_to_move_left = miss_left
needs_to_move_right = miss_right
needs_to_move_left = miss_right
needs_to_move_right = miss_left
rospy.logwarn(f"Needs to move up: {needs_to_move_up}, down: {needs_to_move_down}, left: {needs_to_move_left}, right: {needs_to_move_right}.")
return "finished"
8 changes: 4 additions & 4 deletions skills/src/lasr_skills/describe_people.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __init__(self):
object_name="person",
crop_method=crop_method,
rgb_topic=rgb_topic,
use_mask=True,
use_mask=False,
),
transitions=transitions,
)
Expand Down Expand Up @@ -85,8 +85,8 @@ def __init__(self):
],
),
transitions={
"succeeded": "GET_IMAGE",
"failed": "GET_IMAGE",
"succeeded": "CONVERT_IMAGE",
"failed": "ADJUST_CAMERA",
},
)

Expand All @@ -96,7 +96,7 @@ def __init__(self):
}
else:
transitions={
"finished": "GET_IMAGE_AGAIN",
"finished": "GET_IMAGE",
}
smach.StateMachine.add(
"ADJUST_CAMERA",
Expand Down

0 comments on commit 600435b

Please sign in to comment.