ED-209, with Joystick Control

Most of the services I created manually, and used the gui to connect the services methods together.

Like joy.xaXisRaw - > panServo.move()

Here is a Python script to listen for the a certain button press:

  1. joy= runtime.createAndStart("joy","Joystick")
  2. from java.lang import Integer
  3. from java.lang import System
  5. python.send("trigger","moveTo",90)
  7. def input():  #function gets called when button is pressed
  8.     joybutton = msg_joy_button1.data[0]
  9.     System.out.println(joybutton==0) #print value of button
  10.     if (joybutton==0):
  11.       python.send("trigger","moveTo",100)
  12.     else: python.send("trigger","moveTo",20)
  13.     return object
  15. #create a message route from joy to python so we can listen for button
  16. joy.addListener("button1", python.name"input"Integer(1).getClass());