jawaff / KinectController

Control your computer using your body. The KinectController turns the Kinect into a controller that allows configurable actions to be emulated when configurable gestures are triggered by the user.
0 stars 0 forks source link

There's a problem with the generated pattern that's being passed to Esper. #12

Closed jawaff closed 8 years ago

jawaff commented 8 years ago

Here's the exception that we're getting. It shows the pattern that is supposedly invalid, but it looks correct to me for the most part. It seems like the "as gestureId" part is the problem, but I thought that sort of thing was supported by Esper. I'm pretty sure we used the same thing in the prototype and it worked.

Exception in thread "main" com.espertech.esper.client.EPStatementSyntaxException: Incorrect syntax near ''left_click'' near reserved keyword 'as' ['left_click' as gestureId from pattern[every ((AngleRule(end1=7, vertex=5, end2=3, angle > 180) or AngleRule(end1=7, vertex=5, end2=3, angle < 150)) -> AngleRule(end1=7, vertex=5, end2=3, angle > 150, angle < 180)) and every ((AngleRule(end1=7, vertex=3, end2=2, angle > 100) or AngleRule(end1=7, vertex=3, end2=2, angle < 80)) -> AngleRule(end1=7, vertex=3, end2=2, angle > 80, angle < 100)) and every ((AngleRule(end1=7, vertex=3, end2=10, angle > 100) or AngleRule(end1=7, vertex=3, end2=10, angle < 80)) -> AngleRule(end1=7, vertex=3, end2=10, angle > 80, angle < 100))]] at com.espertech.esper.epl.parse.ExceptionConvertor.convertStatement(ExceptionConvertor.java:47) at com.espertech.esper.epl.parse.ParseHelper.parse(ParseHelper.java:117) at com.espertech.esper.core.service.EPAdministratorHelper.compileEPL(EPAdministratorHelper.java:101) at com.espertech.esper.core.service.EPAdministratorHelper.compileEPL(EPAdministratorHelper.java:72) at com.espertech.esper.core.service.EPAdministratorImpl.createEPLStmt(EPAdministratorImpl.java:116) at com.espertech.esper.core.service.EPAdministratorImpl.createEPL(EPAdministratorImpl.java:66) at com.lcsc.hackathon.kinectcontroller.esper.EsperHandler.setPattern(EsperHandler.java:68) at com.lcsc.hackathon.kinectcontroller.controller.ControllerStateMachine.loadGestures(ControllerStateMachine.java:99) at com.lcsc.hackathon.kinectcontroller.controller.ControllerStateMachine.changeState(ControllerStateMachine.java:78) at com.lcsc.hackathon.kinectcontroller.config.ControllerFSMFactory.addState(ControllerFSMFactory.java:33) at com.lcsc.hackathon.kinectcontroller.config.ControllerFSMFactory.parseVersion1(ControllerFSMFactory.java:81) at com.lcsc.hackathon.kinectcontroller.config.ControllerFSMFactory.create(ControllerFSMFactory.java:48) at com.lcsc.hackathon.kinectcontroller.Main.parseConfig(Main.java:60) at com.lcsc.hackathon.kinectcontroller.Main.(Main.java:52) at com.lcsc.hackathon.kinectcontroller.Main.main(Main.java:46)

jawaff commented 8 years ago

Apparently Esper just wanted a select at the beginning of the query. I thought that wasn't necessary, but it apparently is. So this part is now fixed.