Next version 'Nixie' is coming soon !

Help us to get ready with MyRobotLab version Nixie: try it !
Javadoc link
Example code (from branch develop):
#########################################
# AdafruitMotorShield.py
# description: motor control
# categories: motor control
# more info @: http://myrobotlab.org/service/AdafruitMotorShield
#########################################
# virtual = True
port = "COM99"
 
# virtual hardware
if ('virtual' in globals() and virtual):
    virtualArduino = runtime.start("virtualArduino", "VirtualArduino")
    virtualArduino.connect(port)
 
# The AFMotor API is supported through Jython
fruity = runtime.start("fruity","AdafruitMotorShield")
 
# connect the arduino to serial com port 3
fruity.connect(port)
 
# create a motor on port 4 of the AdaFruit board
motor1 = fruity.createDCMotor(4)
 
# move forward at 40% power
motor1.move(0.4)
 
sleep(1)
 
# move reverse at 50% power
motor1.move(-0.5)
 
sleep(1)
 
# stops motor
motor1.stop()
 
# stops motor and locks it so it can not
# be moved until it is unlocked
# motor1.stopAndLock()
 
# unlocks motor
# motor1.unlock()
 
# sets max power regardles of move command
# this will allow the motor to go at max 90%
# full power forward or reverse
# motor1.setMaxPower(0.9)

The  Adafruit Motor Shield is a service which will create a number of sub services.  It will create 4 Motor, 2 Servo, and 1 Arduino service.  This shield uses its own library, so MRLComm.ino will need to be modified.
Fortunately, the Arduino service will have the modified MRLComm.ino pre loaded in its editor.  This will need to be compiled & uploaded into the Arduino.

Here's a portion of a screencap I made while trying to sort out some driver/hardware issues.

Basically, it's a matrix of versions of the same software arranged by where they were procured from.  But first, a little explanation might be in order.

Quiet computer's USB powering the RasPi

Noisy computer's USB powering the RasPi

2012.10.04 
WooHoo ! - This is a picture of data streaming from an Arduino connected to the Raspberry Pi (running MRL  instance RasPi) connected to my PC (running MRL instance MRL76732)

Finally... Yay !

This morning I finally got this work end to end with a streaming 3D point cloud.  It was slow, but it worked !  The kinect is fast but the display is painfully slow.  If a robot was using the 3D cloud, it wouldn't need a display anyway and there is probably display acceleration software I could be using like JOGL, but its a start !

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)    

 

 

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: