Object Tracking

VERY IMPORTANT: FOR ALL STEPS, YOU MUST HAVE SOMEONE "SPOT" THE ROBOT, MEANING THAT THE SPOTTER IS ACTIVELY READY TO CATCH THE ROBOT IN CASE IT STARTS TO FALL.

Choregraphe has modules that allow Naos to track (recognize and follow) certain objects. The objects that they are trained to recognize with no further training are specific types of red balls and human faces. In this tutorial, you will be using the Nao to track your face.

  1. Open Choregraphe by opening a terminal and typing choregraphe.

  2. During our movement, we want the Nao to be standing, so the first thing we should do is add a Stand Up motion. In the box list on the left side of the Choregraphe window, select Motions -> Stand Up and then drag and drop it onto the flow diagram panel. Notice that there are several inputs and outputs to the stand up box, as well as a wrench. Clicking on a wrench in the box allows you to set parameters for that box. For Stand Up, the parameter is how many times the Nao should try to stand up before giving up. The default parameter is 3, which is fine for us, so we will not change it. Mouse over the different input and output options to see their tool-tips.


  3. We also want to the Nao to finish in a sitting position, so we need to add a Sit Down box. We do that by selecting Motions -> Sit Down and dragging and dropping it onto the flow diagram in the same way as the stand up box. Then, we connect Sit Down's onStopped outputs to the main onStopped output.


  4. Save the current Choregraphe movement by clicking on File -> Save project. Save the project as tracking. Save your work frequently in Choregraphe.

  5. We will now add a Tracking box. Select Tracking -> WB tracker and drag and drop it onto the flow diagram.

  6. Set up the parameters of the WB tracker by clicking on the wrench in the WB tracker box. Set the target choice to be Face and the Time before lost (s) to be 3.0. This will set up the Nao to track a human face.

  7. Connect both outputs of the Stand Up box to the input of the WB tracker box.

  8. Connect the onStopped output of the WB tracker box to the input of the Sit Down box.

  9. To stop the Nao tracking, we need to add a stopping mechanism. Select Sensors -> Tactile Head and drag and drop it onto the flow diagram.

  10. Connect the main onStart to the onStart input of the Tactile Head box.

  11. We would also like to be able to tell if the Nao has successfully found its target to track. We can do this by changing the Nao's eyes to certain colors if they have successfully found an object to track or if they have lost the object they're tracking. Select LEDs -> Eyes LEDs and drag and drop two of these boxes onto the flow diagram.

  12. Connect the foundTarget output of the WB tracker to the onStart input of the first Eyes LEDs box (mouse over the different outputs on WB tracker to see what the different outputs are). Connect the isLost output of the WB tracker to the onStart input of the second Eyes LEDs box.

  13. Double-click on the first Eyes LEDs box. If the color is not set to green, set it to green by clicking on the colored square in the Color Edit box. Click on root to return to the main flow diagram.

  14. Double-click on the second Eyes LEDs box. Set the color to blue and then click on root to return to the main flow diagram.

  15. Click on the wrench of each Eyes LEDs box to set the Duration to 0.4 seconds.

  16. Check the following image to confirm that all connections were made properly.



  17. Turn on a Nao to test.

  18. Wait for robot to connect. Once connected, make sure stiffness is enabled. Then click play.

  19. Make sure that you are in front of the Nao, at eye-level when it stands up so that it may track your face.

  20. Once it has found your face (when its eyes turn green), move slowly around to make sure the Nao is following your face. Again, one person should be prepared to catch the Nao in case of a fall.

  21. When you are through tracking, tap the Nao's head so that it will stop tracking and sit down.

  22. Remember to disconnect the Nao in Choregraphe and turn it off when you are finished.