By now, you should be an expert of the following components 😉:
We want you to develop a rather simple module that employs the Cartesian Interface
and the Gaze Interface
to accomplish the following tasks:
- Make iCub look down at the table.
- Detect the blue ball in both image planes.
- Retrieve the ball position in the Cartesian domain.
- Let iCub look at the ball.
- Finally, ask iCub to reach for the ball and make it roll.
The outcome should look like the animation below:
Some of the points reported above have been already addressed in the code (e.g. detection of the blue ball), so you need to fill in the missing gaps highlighted by the comment // FILL IN THE CODE
.
Once done, you can test your code in two ways:
- Manually: running the yarpmanager scripts provided from within app/scripts and yielding corresponding commands to the module rpc port.
- Automatically: running the script test.sh in the smoke-test directory. Take into account these important points:
- We use a timeout of 120 s to check the status of rpc communication, meaning that you have 120 s max to accomplish each rpc command.
- When you reply to rpc commands, we assume the robot has finished the movement (e.g. see this line in the
respond
method). - The smoke-test will add a little random displacement to the initial position of the ball 😉
-
To make the blue ball show up within the simulator, you have to turn on the flag RENDER::objects in the
iCub_parts_activation.ini
file.To do so, follow these steps (the smoke-test does them for you):
# import the file for customization $ yarp-config context --import simConfig iCub_parts_activation.ini # open the file $ gedit ~/.local/share/yarp/contexts/simConfig/iCub_parts_activation.ini
Now, edit the file by setting the option objects equal to on (under the group RENDER).
Also, you might find this resource quite useful to get accustomed with configuration files in Yarp 😃
-
Alternatively, you can use this model within Gazebo. Be careful, the smoke-test does work only with iCub_SIM.