To follow along, download and unzip the RBB and optional jarfiles. Also download and unzip the Robocup Finals RBB. This example will assume the example RBB (robocup2011finals.h2.db) and the jar files are in the current directory (so that short relative pathnames can be used).
Launch the example:
cd <rbbjars>; java -jar rbbexamples-1.9.4.jar jdbc:h2:file:robocup2011finalsSelect the "Show" dropbox and select one of the games:
game=HELIOS2011-vs-MarliK,type=positionMove the Time scrollbar at the bottom and the players and ball will appear:
The soccer example introduces several RBB concepts:
The following command will show when the ball was in play for each game in the database.
java -jar rbb-1.9.4.jar ui timeline -multiTimeline id=Ball,game -endTime 600000 jdbc:h2:tcp:localhost/robocup2011finals
The following get command find time periods when all 3 balls in the database were active, and output them in a text file:
java -jar rbb-1.9.4.jar get -tagsOnly jdbc:h2:tcp:localhost/robocup2011finals id=Ball id=Ball id=Ball > all.rbb
Next put the new events into the rbb:
java -jar rbb-1.9.4.jar put -setTags game=all jdbc:h2:tcp:localhost/robocup2011finals < all.rbb
Re-running the timeline command above shows the time periods when all 3 balls were active (notice the new all line):
java -jar rbb-1.9.4.jar delete jdbc:h2:tcp:localhost/robocup2011finals game=all
java -jar rbb-1.9.4.jar ml getFeatures -rbb jdbc:h2:tcp://localhost/robocup2011finals \ -input ballpos type=position,id=Ball `: get the ball position and label it 'ballpos' `\ -input playerpos type=position,game= `: get any other co-occurring position from the same game the ball is in, and label it 'playerpos' `\ -DistanceFE distance:ballpos:playerpos:SCALAR `: calculate the distance from the ball to the player and label it 'distance' `\ -BetweenFE distance:0:2 `: stop here unless the distance is between 0 and 2 `\ -CreateEventFE *=playerpos.*,type=possession:true:true `: create an event in the RBB, inheriting tags from playerpos but overwriting 'type=position' with 'type=possession' `
java -jar rbb-1.9.4.jar ml getFeatures -rbb jdbc:h2:tcp://localhost/robocup2011finals -input ballpos type=position,id=Ball -input playerpos type=position,game= -DistanceFE distance:ballpos:playerpos:SCALAR -BetweenFE distance:0:2 -CreateEventFE *=playerpos.*,type=possession:true:true
To find all the ball possessions by player 7 on the HELIOS team in their game against Marlik:
java -jar rbb-1.9.4.jar get jdbc:h2:tcp:localhost/robocup2011finals type=possession,shirtNum=7,team=HELIOS2011,game=HELIOS2011-vs-MarliKThe output:
end=153.25,game=HELIOS2011-vs-MarliK,id=Ball,id=L7,inputEvents=1128:1135,shirtNum=7,side=L,start=151.25,team=HELIOS2011,type=possession end=283.25,game=HELIOS2011-vs-MarliK,id=Ball,id=L7,inputEvents=1151:1158,selected=1,shirtNum=7,side=L,start=279.75,team=HELIOS2011,type=possession end=838.25,game=HELIOS2011-vs-MarliK,id=Ball,id=L7,inputEvents=1243:1250,shirtNum=7,side=L,start=836.75,team=HELIOS2011,type=possession ..
A "give and go" is a play in which the player with the ball gets around a defender by passing to a team-mate who then returns the ball (hopefully after the defender is left behind). In this example it is defined as two possession events by the same player with one intervening possession by a team-mate:
java -jar rbb-1.9.4.jar findEventSequences -filter type=possession -group game -regextag id '(.)(\d)\1(?!\2).\1\2' -summarize type=give-and-go,parentEvent -put jdbc:h2:tcp:localhost/robocup2011finals
Use the timeline to display all give-and-go plays by one team in one game:
java -jar rbb-1.9.4.jar ui timeline -multiTimeline type=give-and-go,game=HELIOS2011-vs-MarliK,team=HELIOS2011,id -endTime 6000000 jdbc:h2:tcp:localhost/robocup2011finals