Skip to content

Commit

Permalink
Add environment-based conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Benteng Ma committed Jun 17, 2024
1 parent a0b3b15 commit 43b8e47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions skills/src/lasr_skills/describe_people.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3

import os
import cv2
import rospy
import smach
Expand All @@ -26,9 +26,12 @@ def __init__(self):
)

with self:
# conditional topic and crop method for flexibility
rgb_topic = "/xtion/rgb/image_raw" if "tiago" in os.environ["ROS_MASTER_URI"] else "/camera/image_raw"
crop_method = "closest" if "tiago" in os.environ["ROS_MASTER_URI"] else "centered"
smach.StateMachine.add(
"GET_IMAGE",
GetCroppedImage(object_name="person", crop_method="closest"),
GetCroppedImage(object_name="person", crop_method=crop_method, rgb_topic=rgb_topic),
transitions={"succeeded": "CONVERT_IMAGE"},
)
smach.StateMachine.add(
Expand Down

0 comments on commit 43b8e47

Please sign in to comment.