Homework 2

1. Provide solutions of plan failures or non-social behaviors in the cocktail-party plan of the HRI VM (user: ubuntu, password: marrtino), taking inspiration by the situations described in Homework 1. In particular, add some interactions using the MODIM framework and modify the plan adding Execution Rules.

2. Produce:

- PDF document describing the provided solutions

- video of the execution of the plans

3. Submit report + video through Classroom

Notes:

1) Update the VM with the following commands:

cd ~/src/robocupathome-pnp

git pull origin master

cd ~/src/modim

git checkout -- src/GUI/ws_server.py

git pull origin master

cd ~/src/PetriNetPlans

git pull origin master

cd ~/ros/catkin_ws

catkin_make

2) Prepare your working environment

Create a working folder

mkdir -p ~/demos/my_cocktail_party

for defining MODIM actions (in actions folder) and collect images (img folder)

Copy the cocktail_party demo from

cd ~/demos/my_cocktail_party

cp -a ~/src/robocupathome_pnp/demos/cocktail_party/* .

3) Run the default demo

Terminal 1:

cd ~/src/modim/src/GUI

python ws_server.py

Terminal 2:

cd ~/demos/my_cocktail_party

python -m SimpleHTTPServer 8000

Terminal 3:

firefox http://localhost:8000/

Terminal 4:

cd ~/src/stage_environments/scripts/

./start_simulation.py

Choose: peccioli@Home map, diago robot, srrg_localizer, move_base, rcathome demo

Click on Start button

Terminal 5:

cd ~/demos/my_cocktail_party/plans

./runplan.sh diago_0 cocktail_party_interaction

4) Modify the demo and run a new version

If you modify only the plan, just run run_plan.sh again

If you modify the HTML layout, reload the HTML page from the browser

If you modify actions in actions.cpp, recompile (catkin_make)

5) Quit demo

Press Quit button in the Simulation launcher GUI

CTRL-C Modim servers (Terminal 1)

CTRL-C HTTP server (Terminal 2)

*** UPDATE FOR USING PNP VARIABLES ***

1) update the VM with the following commands:

cd <PATH-TO>/PetriNetPlans

git pull origin master

cd PNP/build

make

sudo make install

password: marrtino

cd <PATH-TO>/robocupathome-pnp

git pull origin master

cd ros/catkin_ws

catkin_make

2) Test the new cocktailparty plan

3) now you can use the following additional actions

unknownvar_@X : sets variable @X to unknown

set_@X_value : sets variable @X to value

and condition

equal_@X_value : true if variable @X is equal to value

Note: names of PNP actions and conditions can be expressed as list of terms separated by '_' (e.g., goto_fridge)

A variable is always filling an entire term (e.g., goto_@X) and cannot be part of another term (e.g., goto@X is not correct).

Consequently, in the name 'action_@X000_somethingelse' the term '@X000' denotes the variable X000.