Create service for using face recognition
User Story/Description
As a user I would like to be able to ask face recognition to start analyzing and find a person and then subsequently turn off again so no unnecessary faces are found which can cause issues later on in the receptionist scenario.
Definition of Done
When a service can be called and it returns the faces found by the face recognition. Might also be a good idea to proof check what we return, for example check that we find the same faces for 3 iterations in a row or something similar.
How
Most likely it will be a service that "turns on" the /image callback in visage_face_analysis.cpp ROS2 node. If we stop the callback from being run then no new images will be sent to the visage_server.cpp web client which means no more faces will be added to our database during this time. (For a quickfix a topic containing a bool can also be used to check at the beginning of the callback)
If we make it a service it is very important that we are sure we get correct data back and that we proof-check it! Since this MUST work
Create a general service behaviour that can perform any service call: Documentation for this (but for an action) can be found on url: http://docs.ros.org/en/kinetic/api/py_trees_ros/html/tutorials.html#tutorial-4-introspecting-the-tree
and repo: http://repo.ros2.org/status_page/ros_foxy_default.html?q=py_trees
Solotion
- Have edit the visage_face_analysis server so it still subscribe on the '/image' topic and create face detection data. Moreover it also takes a service request and response by sending the face detection data over topic '/face_analysis'
- Have created a service client behaviour_face_analysis witch is a py_tree.behaviour that request face analysis data from the visage_face_analysis server. It makes a validity check whereas it needs to get the same FaceDetection.id 3 times.
- Lastly a tree_face_analysis file was created with a definition of a visage face analysis tree root, this is more of a template of how the face analysis tree branch should look like and was used for testing.