def __init__(self): rospy.init_node('face_detect_demo') self.wait_for_time() self.lights = robot_api.Lights() rospy.sleep(0.5) self.head = robot_api.FullBodyLookAt( tf_listener=tf.TransformListener()) self.body = robot_api.Base() self.social_cues = robot_api.Social_Cues(move_head=False, use_sounds=False) self.publisher = rospy.Publisher('face_pose_marker', Marker, queue_size=10) self.command_sub = rospy.Subscriber('move_command', Bool, queue_size=1, callback=self.command_callback) self.face_already_seen = False self.move_command = False self.num_faces = 0 vision = robot_api.Vision() vision.activate("face_detector", config={"fps": 1}) rospy.sleep(0.5) vision.wait_until_ready(timeout=10) vision.face_change.connect(self.face_callback) if SOCIAL_CUES: self.social_cues.express_neutral() rospy.spin()
def main(): rospy.init_node('face_detection_demo') vision = robot_api.Vision() # Activate Vision API's Face Detector vision.activate("face_detector", config={"fps": 3}) rospy.sleep(0.5) vision.wait_until_ready(timeout=10) vision.req_mods( [["activate", "face_detector", { "fps": 3 }, { "skip_ratio": 3 }]], []) face_change = FaceChange() # Trigger callback rospy.Subscriber('vision/results', FrameResults, face_change.callback) # setup follow faces facesDemo = FaceInteractionDemo() # Trigger callback rospy.Subscriber('vision/face_count', Int8, facesDemo.onFaceCount) rospy.Subscriber('vision/most_confident_face_pos', PointStamped, facesDemo.onFacePos) rospy.Subscriber('come_here_kuri', Int8, facesDemo.navigateTo) rospy.spin()
def main(): rospy.init_node('face_emotion_demo') vision = robot_api.Vision() # Activate Vision API's Face Detector vision.activate("face_detector", config={"fps": 3}) rospy.sleep(0.5) vision.wait_until_ready(timeout=10) vision.req_mods( [["activate", "face_detector", { "fps": 3 }, { "skip_ratio": 3 }]], []) face_command = FaceCommand() # Trigger callback rospy.Subscriber('vision/results', FrameResults, face_command.callback) rospy.Subscriber('vision/commands/follow', Int8, face_command.command_callback) rospy.spin()
def __init__(self): self.lights = robot_api.Lights() self._listener = tf.TransformListener() self.head = robot_api.FullBodyLookAt(tf_listener=self._listener) self.body = robot_api.Base() self.nav_client = NavWaypoint() self.publisher = rospy.Publisher('face_pose_marker', Marker, queue_size=10) self.num_faces = 0 self.count = 0 self.face_point = None # self.talk_position = None self.look_at = True self.wait_for_time() vision = robot_api.Vision() vision.activate("face_detector", config={"fps": 1}) rospy.sleep(0.5) vision.wait_until_ready(timeout=10) self.face_sub = rospy.Subscriber('vision/results', FrameResults, self.face_callback, queue_size=1)
def __init__(self): self.face_pub = rospy.Publisher('vision/most_confident_face_pos', PointStamped, queue_size=10) self.num_faces_pub = rospy.Publisher('vision/face_count', Int8, queue_size=10) self.lights = robot_api.Lights() self.head = robot_api.Head() self.lock = RLock() self.base = robot_api.Base() self.lastFacePos = None self.vision = robot_api.Vision() # Activate Vision API's Face Detector self.vision.activate("face_detector", config={"fps": 3}) rospy.sleep(0.5) self.vision.wait_until_ready(timeout=10) self.vision.req_mods([["activate", "face_detector", {"fps": 3}, {"skip_ratio": 3}]], []) # Trigger callback rospy.Subscriber('vision/results', FrameResults, self.callback) rospy.Subscriber('vision/most_confident_face_pos', PointStamped, self.onFacePos) rospy.Subscriber('come_here_kuri', Int8, self.navigateTo) rospy.sleep(0.5) rospy.spin()