Example #1
0
    def face_enrollment_stop_cb(self, req):
        """Callback of face service requests """
        #        rospy.loginfo("FACE: Disabling face enrollment" )
        stop = StopEnrollmentResponse()
        if self.name != "":

            stop.enrollment_ok = True
            stop.numFacesEnrolled = 1
            stop.error_msg = ''
            cara = FaceDetection()
            cara.name = self.name
            cara.confidence = self.minConfidence
            self.recognized_face.faces.append(cara)
        else:
            stop.error_msg = "no name face"
            stop.enrollment_ok = False
            stop.numFacesEnrolled = 0

        return stop
 def face_enrollment_stop_cb (self, req):
     
     """Callback of face service requests """
 #        rospy.loginfo("FACE: Disabling face enrollment" )
     stop = StopEnrollmentResponse()
     if self.name!="" :
         
         stop.enrollment_ok=True
         stop.numFacesEnrolled=1
         stop.error_msg=''
         cara = FaceDetection()
         cara.name = self.name
         cara.confidence = self.minConfidence
         self.recognized_face.faces.append(cara)
     else:
         stop.error_msg="no name face"
         stop.enrollment_ok=False
         stop.numFacesEnrolled=0
      
     return stop
Example #3
0
    def face_cb(self, data):
        faces = data
        Face = FaceDetection()
        per = person()

        if faces.faces:
            for Face in faces.faces:
                per.targetId = 1
                per.x = Face.position.z
                per.y = -Face.position.x
                per.status = 4
                self.persons.peopleSet.append(per)
            self.follow_person_pub.publish(self.persons)
 def run(self):
     """Publishing usersaid when face recognitionL is enabled """
     # TODO: add tags, add other fields, take into account loaded grammar to put other text in the recognized sentence
     while not rospy.is_shutdown():
         if self.enabled:
             self.recognized_face.header.stamp=rospy.Time.now()
             self.recognized_face.header.frame_id = '/stereo_gazebo_right_camera_optical_frame'
            
             if self.isData():
                 #New face
                 face = FaceDetection()
                 face.x= 262
                 face.y= 200
                 face.width= 61
                 face.height= 61
                 face.eyesLocated= True
                 face.leftEyeX= 307
                 face.leftEyeY= 215
                 face.rightEyeX= 276
                 face.rightEyeY= 217
                 face.position.x=-0.0874395146966
                 face.position.y= -0.0155512560159
                 face.position.z= 0.945071995258
                 face.name="roger"
                 
                 self.recognized_face.faces.append(face)
        
             self.face_pub.publish(self.recognized_face)
                     
         rospy.sleep(3)
Example #5
0
    def run(self):
        """Publishing usersaid when face recognitionL is enabled """
        # TODO: add tags, add other fields, take into account loaded grammar to put other text in the recognized sentence
        while not rospy.is_shutdown():
            if self.enabled:
                self.recognized_face.header.stamp = rospy.Time.now()
                self.recognized_face.header.frame_id = '/stereo_gazebo_right_camera_optical_frame'

                if self.isData():
                    #New face
                    face = FaceDetection()
                    face.x = 262
                    face.y = 200
                    face.width = 61
                    face.height = 61
                    face.eyesLocated = True
                    face.leftEyeX = 307
                    face.leftEyeY = 215
                    face.rightEyeX = 276
                    face.rightEyeY = 217
                    face.position.x = -0.0874395146966
                    face.position.y = -0.0155512560159
                    face.position.z = 0.945071995258
                    face.name = "roger"

                    self.recognized_face.faces.append(face)

                self.face_pub.publish(self.recognized_face)

            rospy.sleep(3)