Next version 'Nixie' is coming soon !

Help us to get ready with MyRobotLab version Nixie: try it !
Javadoc link
Example code (from branch develop):
# FileConnector crawler
# Crawls a directory and publishes a docment for each files found
def onDocument(doc):
    print(doc)
fc = runtime.start("fc","FileConnector")
fc.addListener("publishDocument","python","onDocument")
# start crawling
fc.setDirectory(".myrobotlab")
fc.startCrawling()
sleep(5)
fc.stopCrawling()
Example configuration (from branch develop):
!!org.myrobotlab.service.config.ServiceConfig
listeners: null
peers: null
type: FileConnector

FileConnector is a service that crawls thru a folder and publishes one document for each found file.

Hi,

I 'am still slowly trying to learn the software but have come into another problem, by any chance will anyone know what I need to look at to try and get the head working, I have an Arudino mega 2560 setup as the left side, I can start the left hand and that all works fine but when I try and start the head I get an error

[AWT-EventQueue-0] ERROR class org.myrobotlab.swing.InMoovGui - can't process [start head]

Myrobot lab version 1.0.2577

 

Thanks

Matt

 

 

Javadoc link
Example code (from branch develop):
#########################################
# DatabaseConnector.py
# more info @: http://myrobotlab.org/service/DatabaseConnector
#########################################
 
database = runtime.start("database","DatabaseConnector")
database.setDriver("com.mysql.jdbc.Driver")
database.connectionString="jdbc:mysql://localhost/sakila"
database.jdbcUser="user"
database.jdbcPassword="password"
 
# crawlers publish documents
def onDocument(doc):
    print(doc)
 
database.addListener("publishDocument","python","onDocument")
 
database.setIdField("actor_id")
database.setSql("select actor_id, first_name, last_name from actor")
 
if not ('virtual' in globals() and virtual):
# start crawling
  database.startCrawling()
  sleep(5)
  database.stopCrawling()
Example configuration (from branch develop):
!!org.myrobotlab.service.config.ServiceConfig
listeners: null
peers: null
type: DatabaseConnector

DatabaseConnector is a service that executes a select statement from a database and publishes a document for each line. The example is using MySQL database with the example database that is included when you download it from here: https://dev.mysql.com/downloads/

It uses the jdbc driver so it can be used with most databases.

 

 

Dom wants to use A6 & A7 on the Nano

I'm about to add the 2 pins in the Arduino service pin definition for the Nano .. but what are the "real" addresses of these pins ?

They are not listed on any documentation .. I found this excellent description regarding these mysterious and silly pins on the Arduino forums..

Javadoc link
Example code (from branch develop):
#########################################
# CsvConnector.py
# categories: ingest
# more info @: http://myrobotlab.org/service/CsvConnector
#########################################
# uncomment for virtual hardware
# virtual = True
 
# crawlers publish documents
def onDocument(doc):
    print(doc)
 
# start the service
csvconnector = runtime.start("csvconnector","CsvConnector")
 
csvconnector.setFilename("crazybigdata.csv")
 
csvconnector.setColumns("FirstName", "LastName", "Sex", "Occupation", "Address")
csvconnector.setSeparator(";")
csvconnector.addListener("publishDocument","python","onDocument")
 
# start crawling
csvconnector.startCrawling()
 
sleep(5)
 
csvconnector.stopCrawling()
Example configuration (from branch develop):
!!org.myrobotlab.service.config.ServiceConfig
listeners: null
peers: null
type: CsvConnector

CsvConnector is a service that reads a comma separated file ( .csv ) and publishes one document for each row. 

 

Javadoc link
Example code (from branch develop):
# Start the services needed
raspi = runtime.start("raspi","RasPi")
hat = runtime.start("hat","AdafruitMotorHat4Pi")
m1 = runtime.start("m1","MotorHat4Pi")
# Attach the HAT to i2c bus 1 and address 0x60
hat.attach("raspi","1","0x60")
# Use the M1 motor port and attach the motor to the hat
m1.setMotor("M1")
m1.attach("hat")
# Now everything is wired up and we run a few tests
# Full speed forward
m1.move(1) 
sleep(3)
# half speed forward
m1.move(.5)
sleep(3)
# Move backward at 60% speed
m1.move(-.6)
sleep(3)
# Stop
m1.move(0)
# Now you should be able to use the GUI or a script to control the motor
Example configuration (from branch develop):
!!org.myrobotlab.service.config.MotorHat4PiConfig
axis: null
controller: null
listeners: null
locked: false
mapper:
  clip: true
  inverted: false
  maxIn: 100.0
  maxOut: 100.0
  minIn: -100.0
  minOut: -100.0
motorId: null
peers: null
type: MotorHat4Pi

MotorHat4Pi is a motor connected to the AdafruitMotorHat4Pi driver board that can be used on the Raspberry PI. It can drive 4 DC motors ( implemented in mrl ) or two stepper motors ( yet to be implemented ).

https://www.adafruit.com/product/2348

Javadoc link
Example code (from branch develop):
# Start the services needed
raspi = runtime.start("raspi","RasPi")
hat = runtime.start("hat","AdafruitMotorHat4Pi")
m1 = runtime.start("m1","MotorHat4Pi")
# Attach the HAT to i2c bus 1 and address 0x60
hat.attach("raspi","1","0x60")
# Use the M1 motor port and attach the motor to the hat
m1.setMotor("M1")
m1.attach("hat")
# Now everything is wired up and we run a few tests
# Full speed forward
m1.move(1) 
sleep(3)
# half speed forward
m1.move(.5)
sleep(3)
# Move backward at 60% speed
m1.move(-.6)
sleep(3)
# Stop
m1.move(0)
# Now you should be able to use the GUI or a script to control the motor
Example configuration (from branch develop):
!!org.myrobotlab.service.config.ServiceConfig
listeners: null
peers: null
type: AdafruitMotorHat4Pi

AdafruitMotorHat4Pi is a motor driver board that can be used on the Raspberry PI. It can drive 4 DC motors ( implemented in mrl ) or two stepper motors ( yet to be implemented ).

https://www.adafruit.com/product/2348

To use the motor you need thee services running on the PI.

1. The raspi service. http://myrobotlab.org/service/RasPi

2. This service. It represents the board it'self and communicates with the Raspberry PI using the i2c protocol.

3. One to four MotorHat4P services, one for each motor: http://myrobotlab.org/service/MotorHat4Pi