As I'm trying to polish up Sabertooth, Joystick, and provide an interface in python you can do this
motor.attach(joystick.getAxis("y"))
I noticed MotorControl has getPowerLevel() & getPowerOutput()
As I'm trying to polish up Sabertooth, Joystick, and provide an interface in python you can do this
motor.attach(joystick.getAxis("y"))
I noticed MotorControl has getPowerLevel() & getPowerOutput()
# 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()
!!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
######################################### # 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()
!!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..
######################################### # 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()
!!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.
The BoofCv service is a wrapper for the BoofCV open source Java library for real-time computer vision and robotics applications.
References:
https://boofcv.org/index.php?title=Main_Page
It has a lot more possibilities than what has been used in MRL so far.
Careful if they are closed, tracking will get borked :)
Service refactored, as test, to use any servo controler
Some 3D parts :
https://www.thingiverse.com/thing:2548952
https://www.thingiverse.com/thing:1521400
https://www.thingiverse.com/thing:1751434
TODO :
- moveToBlocking instead of sleep
- 1 eyelid only blink
SAMPLE :
# 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
!!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 ).
# 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
!!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