GLOBAL:MinimaDistanza:300 // minimum distance where an object has to be in order to consider // it as an obstacle // New positions definition DEF:POSE:Aspetta_Osso // Position where the dog wait the bone in his mouth Head_tilt:90 Head_mouth:-50 END DEF:POSE:Tieni_Osso // Position where the dog keep the bone in the mouth Head_tilt:0 Head_mouth:-10 END DEF:POSE:Molla_Osso // Position where the dog leave the bone Head_tilt:-90 Head_mouth:-60 END // System initialization SET:Power:1 POSE:AIBO:slp_slp POSE:AIBO:oStanding SET:Melody_id:0 // Event Handlers ONCALL:Melody_id:=:1:Ferma:1:Tracking_Palla // melody 1 recognition ONCALL:&:Gsensor_status:1:Ripristino:0 // fall down // main program :Main MOVE:HEAD:HOME WAIT DO CALL:VaiAvanti CALL:GiraADestra LOOP // infinite cycle :VaiAvanti WHILE:Distance:>=:MinimaDistanza MOVE:LEGS:STEP:SLOW:FORWARD:1 // go forward WAIT WEND RETURN :GiraADestra WHILE:Distance:<:MinimaDistanza MOVE:LEGS:STEP:RIGHT_TURN:0:2 // turn right WAIT WEND RETURN :Ferma SET:Melody_id:0 POSE:AIBO:oStanding RESUME :Tracking_Palla // Ball tracking SET:COLOR:PINK MOVE:HEAD:C-TRACKING:2000 WHILE:Cdt_npixel:<:200 MOVE:LEGS:STEP:SLOW:FORWARD:2 WAIT MOVE:HEAD:C-TRACKING:200 WAIT WEND POSE:AIBO:oStanding WAIT POSE:APK:Aspetta_Osso PLAY:LIGHT:joy1_eye:10 PLAY:SOUND:bow1_ddp WAIT FOR:i:1:8 MOVE:TAIL:ABS:0:-180:100 WAIT MOVE:TAIL:ABS:0:180:100 WAIT NEXT WAIT:1000 MOVE:HEAD:HOME POSE:APK:Tieni_Osso WAIT STOP:LIGHT MOVE:LEGS:STEP:RIGHT_TURN:0:24 WAIT STOP:AIBO POSE:AIBO:oStanding SET:Touch_head_press:0 WAIT:2000 WHILE:Touch_head_press:<:50 WAIT:100 WEND MOVE:HEAD:ABS:-90:0:0:1000 WAIT:HEAD POSE:APK:Molla_Osso WAIT:1000 MOVE:HEAD:HOME WAIT:HEAD POSE:AIBO:oSitting WAIT:AIBO :FermaTutto // stop the robot POSE:AIBO:slp_slp WAIT HALT :Ripristino QUIT:AIBO MOVE:AIBO:ReactiveGU // stand up WAIT RESUME