Next version 'Nixie' is coming soon !

Help us to get ready with MyRobotLab version Nixie: try it !
Javadoc link
Example code (from branch develop):
#########################################
# Joystick.py
# categories: input sensor joystick
# more info @: http://myrobotlab.org/service/Joystick
#########################################
# start the services
joy = runtime.start("joy","Joystick")
python = runtime.start("python","Python")
#this set which kind of controller you want to poll data from
#it is the number you can see in the Joystick GUI when you open the list of devices
joy.setController(5)
 
#tell joystick service to send data to python as a message only when new data is aviable
joy.addInputListener(python)
 
#this is the method in python which receive the data from joystick service
#it is triggered only when new data arrive, it's not a loop !
def onJoystickInput(data):
 #this print the name of the key/button you pressed (it's a String)
 #this print the value of the key/button (it's a Float)
 print data.id, data.value
 if (data.id == "3"):
     print("button 3 was pressed its value is", data.value)
 elif (data.id == "x"):
     print("stick x", data.value)    
Example configuration (from branch develop):
!!org.myrobotlab.service.config.JoystickConfig
analogListeners: null
componentListeners: null
controller: null
listeners: null
peers: null
type: Joystick

 

 

This service allows input from usb joysticks or gamepads. You can attach to a joystick and examine axis or button data.  These button and joystick events can be sent to other services, such as servos or motor services.  It could be used for a "manual" override to take control of a robot.

MRL currently uses create-labs libraries to interface with serial info - They did a great job of normalizing the Java and doing a full build of 6 types (windows 64/32, Linux 64/32 & Mac 64/32)

Unfortunately the current Jar is filtering out ttyACMx which is the identifier for serial devices for Arduino Uno & Mega..

A easy work-around is to make a symbolic link like this :

ln -s /dev/ttyACM0 /dev/ttyUSB0 

you might need to chown or chmod the new link to give it the appropriate permissions

 

The new Joystick service will use JInput & be supported on Windows, Linux & Mac.  It will support Joysticks, Gamepads & Rumblers.  It will have configurable transforms, so you can send the output of an axis directly to an Arduino, Motor shield, or Servo ....

Up to 12 buttons are supported and each button event can be routed to another service...

More to come !

 

Hi guys! :)

I have a project that uses arduino and pan/tilt servos to track a desired color. With the use of a camera and myrobotlab, this project slowly come to life. I and with the help of GroG, are working on it to make it possible. However, it's not yet done and the project is still under progress. Here's some of the highlights of the project. Comments and Suggestions will be greatly appreciated :)

First, you need to download MRL:

"Finally"...  presenting "The Arduino Service - reloaded (again)" -  it's not ready for "prime time" , but it's starting to come together.  It would be great if I could get some testing & feedback..  with enough updates I'm hoping it might even be useful :)

If your interested,
here are the steps to get started in graphic detail..

Digital inputs are now working. I'd do a screenshot of a Arduino Mega 2560 - but only have a Uno compatible board this minute.  The 2560 give you a LOT of lines. Finally seperated Arduino IDE's compiler & uploader from the gui.  Still needs a bit of clean up.  I like the new Rainbow Traces !  Starting to move on to OpenCV updates !  So much has changed.....

Here's a video from a very cool project by morrows_end & Kegfloater

They are using a Jython state machine to control a 3D simulator (SEAR) and will be using the same control logic to plug into a real Roomba.

 

 

With this short Jython script, an Arduino service is created and a Arduino sketch is compiled then uploaded to the microcontroller.  In this case the sketch is MRLComm which allows communication between MRL and Arduio, but other sketches could be loaded too, depending on the state of the Borg :)

 

Here's a preview..  Complete with Java & Jython consoles, plus lovely open, save, restart and execute buttons.  I'll be looking into autocompletion and caret positioning after Jython errors....