Attention system for dummies

From Wiki for iCub and Friends
Jump to: navigation, search

Warning: this page has not been maintained and it contains information that is no longer up to date.

Attention! This how-to is written for linux users, but it may be useful for windows users also.

Startup the robot

  • Power up the robot. (laptop and powersupplies first, then when the robot-laptop has booted completely then turn the cpu and motor power switches on)
  • Get the robot software interface running. You can run this script (in the robot-laptop) to automate even more the startup (you'll need to have a yarp server running before):
yarp clean
cd /usr/local/src/robot/iCub/app/default/scripts/
./ &
./ cameras.xml &
ssh -t pc104 iCubInterface --config /usr/local/src/robot/iCub/app/iCubMunich01/conf/icubSafe.ini iCubInterface --config /usr/local/src/robot/iCub/app /iCubMunich01/conf/icubSafe.ini
killall yarpview
killall frameGrabberGui2
killall yarprun
ssh -t pc104 killall yarpdev
ssh -t pc104 killall yarprun
yarp clean

Don't close this console!
(If you want to turn off the robot software interface later, you have to press CTRL-C in this console, it will close all related software)
This will get the robot calibrated,up and running.
Disclaimer: This script is not perfect, if you find something you can improve then please modify this wiki entry.

  • You still have to press the "Run Selected" button in the Cluster Manager window manually.
  • You still need to activate the cameras: In the Application Manager window, press "Run" for the two yarpdev modules.

At this point the robot is ready to be used by the attention system.

Setting up the environment for running the attention system

You will probably need more than one computer to run the attention system. I was able to run the attention system with my laptop running only the graphical interface and a Intel(R) Core(TM)2 Quad CPU based computer running all the other modules.

Do the following steps in all the computers where you want to run modules.

  • Get yarp compiled and installed. (let's suppose the yarp source directory is /home/user/local/src/yarp2)
  • Get the iCub repository. (let's suppose the iCub base repository directory is /home/user/local/src/iCub)
  • Set the following environmental variables:
export YARP_DIR=/home/user/local/src/yarp2
export ICUB_DIR=/home/user/local/src/iCub
export ICUB_ROOT=/home/user/local/src/iCub
export PATH=$PATH:/home/user/local/src/iCub/bin

Compiling the iCub repository

Do the following steps in all the computers where you want to run modules.

  • I guess you will need some dependencies. I'm sure you'll need opencv to get the attention system compiled. Then install it!
  • cd /home/user/local/src/iCub
  • ccmake . (you'll probably need to activate CREATE_GUIS_GTK, CREATE_GUIS_GTKMM, CREATE_GUIS_QT, the rest worked for me. Be sure to check that there are no errors. Warnings are not a problem as I can tell)
  • make

wait for some time ... (go and play around with your other robots for example :), or write a wiki entry for something that could be useful for somebody else)

Note: you need to compile the iCub repository for Qt (CREATE_GUIS_QT) but when you Configure Cmake (at least on Windows) you may get an error message saying iCubGui will not compile, typically because GLUT can't be found. Don't worry - you don't need iCubGui for attention - just carry on and Generate the solution file and build the repository as normal.

Setting up and Starting up the attention system

  • Configure the application manager for the attention system
    • There is a configuration file template for the attention system in: /home/user/local/src/iCub/app/attentionDistributed/scripts/appConfig-visual.xml.template. Copy this file to appConfig-visual.xml in the same directory and edit it to your taste. Important things to change in the config file are the node names, if you have two computers lets name them (for Yarp purposes) "clientMachine" and "node1". Modify the config file so that the applicationGui module runs on the "clientMachine" and the other modules run on "node1" machine.
  • Running yarprun
    • In your strong computer run: yarprun --server /node1
    • In your small computer run: yarprun --server /clientMachine
  • Run the application manager
    • cd /home/user/local/src/iCub
    • ./app/attentionDistributed/scripts/
    • Check that the dependency node names are the right ones (if not then just change it on the GUI)
    • Press CheckDep, all indicators should go green (this checks whether yarprun is running in the nodes)
    • Run all the modules: Press the "Run Modules" button.
    • Connect modules: Press the "Connect" button.

Now the system should be up and running.

Using the attention system

In the ApplicationGui (in the clientMachine computer) you can control the attention system.

It will initially not do anything. You have to:

  • Go to salienceRight tab and press the button "Check all ports and connections"
  • Inside of "Configuration Connection" check that the symbol ">>" is green when is not green then press it!
  • Press "Connect All" button.
  • Press "Initialize Interface"
  • Now in "Salience Filter weights" you can select the weights you want for different things. Play around with it. In this moment the head should start moving looking towards your selected salience!