Nao Colored Object Detection
The Colored Object Detection module was developed by Vincent Berenz and can bee added to NAO. The module is described as, "allowing detection of blue, red, green and yellow objects. Adding more colors is also possible."
Install on Nao
Word of warning… this has only been tested on NAO Next Gen. If you have a Nao Next Gen, then download the module and follow these instructions.
Use an ftp program like filezilla to connect to nao.local:
- Create a folder in the root called 'mymodules'
- Upload the file 'libcolored_object_detection.so' into that folder
- the module comes with an example 'autoload.ini' that you can upload to /naoqi/preferences ** if you have never edited Nao's autoload.ini, you can overwrite the autoload.ini on the robot with the file included in the module; otherwise of course merge in the configuration manually.
Confirm it Worked
To confirm the module was installed properly
- Browse to your Nao (http://nao.local).
- Go to the "advanced" menu and then to "naoqi".
- Select the "restart" button to restart naoqi on the robot.
- After restart the module should show up in the list as "ColoredObjectDetection"
Using the Module in Choregraphe
If you create a script box with this code.
# get the module codProxy = ALProxy("ColoredObjectDetection") # subscribe ALMemory Event codProxy.subscribe("ColoredObjectDetection")
You can then right-click on the margin in choregraphe and "Add Input from ALMemory", which will be stimulated when nao recognizes an object. The list returned by the module consist of:
# color color = value # more than -1 if detected NbPixels = self.value # position Yaw = value Pitch = value X = value Y = value