| 16 | |
| 17 | |
| 18 | class FaceRecognitionNode: |
| 19 | def __init__(self): |
| 20 | self.load_parameters() |
| 21 | |
| 22 | subscribers = [ |
| 23 | message_filters.Subscriber('/detector/detections', DetectionArray), |
| 24 | message_filters.Subscriber('/face_feature_extractor/features', FeatureVectorArray) |
| 25 | ] |
| 26 | |
| 27 | # TypeSynchronizer doesn't work, the image time and the detection time are slightly different? |
| 28 | # self.ts = message_filters.TimeSynchronizer(subscribers, 5) |
| 29 | self.ts = message_filters.ApproximateTimeSynchronizer(subscribers, 5, 0.0001) |
| 30 | self.ts.registerCallback(self.callback) |
| 31 | |
| 32 | # load parameters from somewhere |
| 33 | def load_parameters(self): |
| 34 | package_path = rospkg.RosPack().get_path('recognition') |
| 35 | |
| 36 | # callback |
| 37 | def callback(self, people_detection_msg, face_features_msg): |
| 38 | print 'receive' |
| 39 | |
| 40 | |
| 41 | def main(): |