Tuesday, November 4, 2014

XRobots at EclipseCon Europe 2014

EclipseCon Europe 2014 was special to me: Miro, Holger and me had been preparing a robot game for our booth, and I was very curious whether it would work as expected and more than that whether people would like it. It turned out to be a blast: Some attendees even spent the after hours to work on their programs offline, and returned to our booth the next day to prove it. And even for those who didn't choose to compete, it was still a great show to watch.

The game works as follows: You write a script to control a robot in a wrestling fight. You win the game when your robot turns the opponent over or pushes it outside of the ring. Within the script, you can define how your robot should react on specific conditions, e.g. when it is close to the opponent. The robots can move, rotate, drive curves and lift up their scoop. You can read the own and the opponent’s position, view direction and speed.

The DSL is of course implemented with Xtext. You only need a web browser to join the game. We have enhanced Holger’s Xtext in the Web code to provide a web-editor with the usual Xtext goodies such as live validation, content assist, syntax highlighting, hovers etc. It worked really well and we plan to spend more time on Xtext in the web soon. As we have embedded the expression library Xbase, you can use all kind of expression and control structures.

To run your script you have enter a token which is shown on the game display at our booth. As soon as both robots are assigned, the scripts are executed by an interpreter on our game server, which makes two Lego Mindstorms robots engage in a fight.

The involved tools include Lejos, Xtend, Xtext with Xbase, Eclipse, Orion, Jetty, JavaFX and more. To locate the robots precisely enough we had to go for a video solution based on OpenCV. The Making-Of has been rather exciting, so we decided to file a talk on this for EclipseCon NA 2015. If you plan to attend and want to hear the story, vote for it!

The robots’ next gig will be at Devoxx in Antwerp next week. Of course we’ll bring them to  EclipseCon 2015 in San Francisco, too.

Apart from the robots, EclipseCon Europe 2014 was again gorgeous. The three sessions I gave went fine, I met a lot of really nice people and for the first time I had the time to watch the amazing Circus Eclipse. Thanks to the organizers and to the community to make EclipseCon such a great event.

PS: Our talk The Making of XRobots has been selected as one of three early birds for EclipseCon NA 2015! See you there!