SlideShare a Scribd company logo
1 of 39
Download to read offline
http://robo4j.io
Robo4J
@robo4j
Robotics on Java Simplified
Robo4J
Marcus Hirt, Oracle
Miroslav Wengner, MAN Truck & Bus AG
http://robo4j.io
Robo4J
@robo4j
Robo4J
• Easy to use framework for quickly getting started writing Java
for hardware
• Pure Java framework
• Uses Pi4J for GPIO access
• Core components independently usable
http://robo4j.io
Robo4J
@robo4j
robo4j-hw-pi
Robo4J Overview
robo4j-math
robo4j-core
robo4j-hw-lego
My Robot
robo4j-units-pi
robo4j-units-lego
robo4j-http
http://robo4j.io
Robo4J
@robo4j
Robo4J Hardware Modules
• Simple to use Java abstractions for hardware
• Can be used stand alone, does not depend on anything
robo4j-hw-*
http://robo4j.io
Robo4J
@robo4j
Hardware Example
public class HelloLcd {
public static void main(String[] args) throws Exception {
AdafruitLcd lcd = LcdFactory.createLCD();
lcd.setBacklight(Color.TEAL);
lcd.setText("Hello World!n-----Robo4J-----");
}
}
Adafruit LCD
http://robo4j.io
Robo4J
@robo4j
Robo4J Core
• Defines the core abstractions
• A RoboBuilder builds the RoboContext which is basically a ”robot”
• A RoboContext contains RoboReferences to RoboUnits, which are agents to
which messages can be sent
• Annotations on RoboUnits can change on which queue messages are sent
• Provides network services (autodiscovery, remote messaging)
• Is plain old Java
robo4j-core
http://robo4j.io
Robo4J
@robo4j
Robo4J Hardware Specific Units
• Pre-packaged, configurable units
• Easy to use
• Typically configured using XML (or programmatically)
robo4j-units-*
http://robo4j.io
Robo4J
@robo4j
Robo4J Threading
http://robo4j.io
Robo4J
@robo4j
Robo4J Threading
2
2
10
http://robo4j.io
Robo4J
@robo4j
Typical Project
1. Add the units for your hardware to your configuration
2. Add your own units for controlling behaviour
3. Add a class with a main method where you initialize it all
through a RoboBuilder
4. Run the main method
http://robo4j.io
Robo4J
@robo4j
Example
public class LcdExampleDeclarativeMain {
public static void main(String[] args) throws RoboBuilderException, IOException {
RoboBuilder builder = new RoboBuilder().add(getResource("robo4j.xml"));
RoboContext ctx = builder.build();
ctx.start();
ctx.getReference("lcd").sendMessage(
new LcdMessage("Robo4J: Welcome!nPress Up/Down!"));
System.out.println("Press enter to quit!");
System.in.read();
ctx.shutdown();
}
…
}
http://robo4j.io
Robo4J
@robo4j
robo4j.xml
<robo4j>
<roboUnit id="lcd">
<class>com.robo4j.units.rpi.lcd.AdafruitLcdUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x20</value>
</config>
</roboUnit>
<roboUnit id="buttons">
<class>com.robo4j.units.rpi.lcd.AdafruitButtonUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int”>0x20</value>
<value name="target" type="String">controller</value>
</config>
</roboUnit>
<roboUnit id="controller">
<class>com.robo4j.rpi.lcd.example.controller.LcdExampleController</class>
<config name="com.robo4j.root">
<value name="target" type="String">lcd</value>
</config>
</roboUnit>
</robo4j>
http://robo4j.io
Robo4J
@robo4j
Controller
@CriticalSectionTrait
public class LcdExampleController extends RoboUnit<AdafruitButtonEnum> {
…
public void onMessage(AdafruitButtonEnum message) {
if (!isDemoRunning()) {
processAdafruitMessage(message);
} else {
SimpleLoggingUtil.print(getClass(), "Skipping " + message + " due to test already running!");
}
}
public void onInitialization(Configuration configuration) throws ConfigurationException {
target = configuration.getString("target", null);
if (target == null) {
throw ConfigurationException.createMissingConfigNameException("target");
}
}
…
http://robo4j.io
Robo4J
@robo4j
Controller, continued
…
private void processAdafruitMessage(AdafruitButtonEnum myMessage) {
switch (myMessage) {
case DOWN:
moveToNextDemo();
break;
case UP:
moveToPreviousDemo();
break;
case SELECT:
runDemo();
break;
default:
sendLcdMessage(getContext(), String.format("Button %snis not in use...", myMessage));
}
}
}
http://robo4j.io
Robo4J
@robo4j
Adafruit LCD Demo
http://robo4j.io
Robo4J
@robo4j
Example – Robotic Arm
http://robo4j.io
Robo4J
@robo4j
Robotic Arm Demo
http://robo4j.io
Robo4J
@robo4j
Robo4J Networking
• Autodiscovery / Heartbeats / Native package format
• Messaging / Remote Contexts
http://robo4j.io
Robo4J
@robo4j
Autodiscovery Enablement
<robo4j>
<roboSystem>
<config name="com.robo4j.root">
<value name="poolSizeScheduler" type="int">2</value>
…
<config name="com.robo4j.messageServer">
<value name="port" type="int">0</value>
</config>
<config name="com.robo4j.discovery">
<value name="multicastAddress" type="String">238.12.15.254</value>
<value name="port" type="int">0x0FFE</value>
<value name="heartBeatInterval" type="int">250</value>
<value name="enabled" type="boolean">true</value>
<config name="com.robo4j.discovery.metadata">
<value name="name" type="String">Button Activator</value>
<value name="description" type="String">Little remote controlled button</value>
</config>
</config>
</config>
</roboSystem>
</robo4j>
http://robo4j.io
Robo4J
@robo4j
Remote Messaging
String id = "myid";
LookupService lookupService =
LookupServiceProvider.getDefaultLookupService();
RoboContext context = lookupService.getContext(id);
RoboReference<String> reference = context.getReference(id);
reference.sendMessage("Hello!");
http://robo4j.io
Robo4J
@robo4j
Lookup by Metadata
Stream<RoboContextDescriptor> matchingDescriptors =
lookupService.getDiscoveredContexts().values().stream().
filter((ctx) -> isRoboticOverlord(ctx));
…
private static boolean isRoboticOverlord(RoboContextDescriptor context) {
return context.getMetadata().containsKey("isRoboticOverlord");
}
http://robo4j.io
Robo4J
@robo4j
Button Presser Demo
with Autodiscovery
http://robo4j.io
Robo4J
@robo4j
Robo4J Http Communication
• Want to communicate messages to the units over http
• Simply add HttpServerUnit or HttpClientUnit
• Communication is implemented using Java NIO
• Messages by default sent as Json
• Translate from/to Json and the message type accepted by the unit
• Define your codecs: @HttpProducer, @HttpDecoder, @HttpEncoder
http://robo4j.io
Robo4J
@robo4j
Robo4J REST
• Default get operation is listing all registered units with their states
• Default post operation for a unit is to send a message to it
• There must be a registered http codec for converting from Json to
the message type for the message to be received
HTTP GET: http://<ROBO4J_IP>:<ROBO4J_PORT>
HTTP POST: http://<ROBO4J_IP>:<ROBO4J_PORT>/units/<unit id>
http://robo4j.io
Robo4J
@robo4j
Robo4J Example Get
HTTP GET : http://127.0.0.1:8025
uid: 142d7167-7a43-477e-8dfd-75fdd711b6da,
response: [
{
id:"controller",
com.robo4j.LifecycleState:"STARTED“
},
{
id:"httpServer",
com.robo4j.LifecycleState:"STOPPED"
},
...
]
http://robo4j.io
Robo4J
@robo4j
Robo4J Example Post
Example: http://localhost:8025/units/controller
BODY:
{“message”: “push“}
Returns HTTP code 202, if message was deserialized properly and
put on the bus. Returns 404 if unit is not found. Returns 501 if, for
example, no codec is present for the type required by the unit.
http://robo4j.io
Robo4J
@robo4j
Video Streaming Demo Configuration
<robo4j>
<roboUnit id="httpClient">
<class>com.robo4j.socket.http.units.HttpClientUnit</class>
<config name="com.robo4j.root">
<value name="address" type="String">SERVER_IP</value>
<value name="port" type="int">SERVER_PORT</value>
<value name="mode" type="boolean">true</value>
<value name="targetUnits" type="String">{"imageController":"POST"}</value>
</config>
</roboUnit>
<roboUnit id="imageController">
<class>com.robo4j.units.rpi.camera.RaspistillUnit</class>
<config name="com.robo4j.root">
<value name="targetOut" type="String">httpClient</value>
<value name="client" type="String">SERVER_IP</value>
<value name="clientPort" type="String">SERVER_PORT</value>
<value name="clientUri" type="String”>/<SERVER_ENDPOINT></value>
<value name="width" type="String">320</value>
<value name="height" type="String">240</value>
<value name="timelapse" type="String">100</value>
</config>
</roboUnit>
</robo4j>
• Two Robo4J Systems
• Robo4J on JavaFx
http://robo4j.io
Robo4J
@robo4j
Video and Image Streaming Demo
with Autodiscovery
http://robo4j.io
Robo4J
@robo4j
Robo4J and Lego
Robo4J supports LejOS 9.x on Java 8 and above
Hardware abstractions in robo4j-hw-lego
Units in robo4j-units-lego
Robo4J allows you to mix Lego functionality with other hardware
Turn On the robot named “Number42”
http://robo4j.io
Robo4J
@robo4j
Lego Robot Number42 is alive
<robo4j>
<roboUnit id="http">
<class>com.robo4j.socket.http.units.HttpServerUnit</class>
<config name="com.robo4j.root">
<value name="port" type="int">8025</value>
<value name="target" type="String">controller</value>
<value name="packages" type="String">com.robo4j.lego.j1kids.example.codec</value>
<value name="targetUnits" type="String">{"controller":"GET"}</value>
</config>
</roboUnit>
<roboUnit id="buttons">
<class>com.robo4j.units.lego.BrickButtonsUnit</class>
<config name="com.robo4j.root">
<value name="target" type="String">controller</value>
<value name="button_right" type="String">left</value>
<value name="button_left" type="String">right</value>
<value name="button_up" type="String">down</value>
<value name="button_down" type="String">up</value>
<value name="button_enter" type="String">enter</value>
</config>
</roboUnit>
<roboUnit id="lcd">
<class>com.robo4j.units.lego.LcdUnit</class>
<config name="com.robo4j.root">
</config>
</roboUnit>
<roboUnit id="controller">
<class>com.robo4j.lego.j1kids.example.controller.PlatformController</class>
<config name="com.robo4j.root">
<value name="target" type="String">platform</value>
</config>
</roboUnit>
<roboUnit id="weaponController">
<class>com.robo4j.lego.j1kids.example.controller.WeaponController</class>
<config name="com.robo4j.root">
<value name="target" type="String">weapon</value>
</config>
</roboUnit>
<roboUnit id="touchUnit">
<class>com.robo4j.units.lego.TouchUnit</class>
<config name="com.robo4j.root">
<value name="target" type="String">weaponController</value>
</config>
</roboUnit>
<roboUnit id="weapon">
<class>com.robo4j.units.lego.SingleMotorUnit</class>
<config name="com.robo4j.root">
</config>
</roboUnit>
<roboUnit id="platform">
<class>com.robo4j.units.lego.SimpleTankUnit</class>
<config name="com.robo4j.root">
<value name="leftMotorPort" type="String">B</value>
<value name="leftMotorType" type="Character">N</value>
<value name="rightMotorPort" type="String">C</value>
<value name="rightMotorType" type="Character">N</value>
</config>
</roboUnit>
</robo4j>
http://robo4j.io
Robo4J
@robo4j
Lego Demo
http://robo4j.io
Robo4J
@robo4j
Coff-E
• Robotic platform (Wall-E on Java)
• 3D printed + Makeblock + Pololu + Adafruit hardware
http://robo4j.io
Robo4J
@robo4j
http://robo4j.io
Robo4J
@robo4j
Coff-E at JavaOne 2016
The embedded video on this page was removed due to presentation size restrictions.
We’ve uploaded the embedded video on youtube here:
https://www.youtube.com/watch?v=cNLlPGiBzqg
http://robo4j.io
Robo4J
@robo4j
Configuration
<robo4j>
<roboUnit id="lcd">
<class>com.robo4j.units.rpi.lcd.AdafruitLcdUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x20</value>
</config>
</roboUnit>
<roboUnit id="buttons">
<class>com.robo4j.units.rpi.lcd.AdafruitButtonUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x20</value>
<value name="target" type="String">controller</value>
</config>
</roboUnit>
<robo4j>
<roboUnit id="motion">
<class>com.robo4j.units.rpi.roboclaw.RoboClawRCTankUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x40</value>
<value name="leftChannel" type="int">6</value>
<value name="rightChannel" type="int">7</value>
</config>
</roboUnit>
</robo4j>
<roboUnit id="laserscanner.servo">
<class>com.robo4j.units.rpi.pwm.PCA9685ServoUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x40</value>
<value name="channel" type="int">0</value>
<value name="trim" type="float">7</value>
<value name="shutdownValue" type="float">0</value>
</config>
</roboUnit>
<roboUnit id="laserscanner.tilt">
<class>com.robo4j.units.rpi.pwm.PCA9685ServoUnit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x40</value>
<value name="channel" type="int">1</value>
<value name="trim" type="float">-40</value>
<value name="inverted" type="boolean">true</value>
<value name="shutdownValue" type="float">0</value>
</config>
</roboUnit>
<roboUnit id="scanner">
<class>com.robo4j.units.rpi.lidarlite.LaserScanner</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x62</value>
<value name="servo" type="String">laserscanner.servo</value>
<value name="servoRange" type="float">45.0</value>
<value name="angularSpeed" type="float">100.0</value>
<value name="minAquisitionTime" type="float">2.5</value>
<value name="trim" type="float">5.5</value>
</config>
</roboUnit>
<roboUnit id="gyro">
<class>com.robo4j.units.rpi.gyro.GyroL3GD20Unit</class>
<config name="com.robo4j.root">
<value name="bus" type="int">1</value>
<value name="address" type="int">0x6b</value>
<value name="sensitivity" type="String">DPS_245</value>
<value name="enableHighPass" type="boolean">true</value>
<value name="period" type="int">10</value>
</config>
</roboUnit>
<roboUnit id="tank">
<class>com.robo4j.coffe.controllers.TankController</class>
<config name="com.robo4j.root">
<value name="useTracks" type="boolean">false</value>
<value name="maxSpeed" type="float">0.4</value>
</config>
</roboUnit>
<roboUnit id="scanprocessor">
<class>com.robo4j.coffe.units.ScanProcessor</class>
</roboUnit>
<roboUnit id="missioncontroller">
<class>com.robo4j.coffe.controllers.MissionController</class>
<config name="com.robo4j.root">
<value name="lcd" type="String">lcd</value>
<value name="tank" type="String">tank</value>
<value name="scanner" type="String">scanner</value>
<value name="scanProcessor" type="String">scanprocessor</value>
<value name="modeOfOperation" type="String">fastest_path</value>
</config>
</roboUnit>
.
. (GPS, magnetometer etc.)
.
</robo4j>
http://robo4j.io
Robo4J
@robo4j
Build Your Own Coff-E
• See Thingiverse for more information:
https://www.thingiverse.com/thing:1730244
• See the robo4j-coffe repo for code
http://robo4j.io
Robo4J
@robo4j
Tools Demo
JDK Mission Control Plug-in (JFR, LIDAR Scan Visualization)
Magnetometer Calibration Utility (MagViz)
http://robo4j.io
Robo4J
@robo4j
Summary
• Robots are fun
• Java and Robo4J lets you build them quickly
• We have just started
(had a bit of a break the past year getting/tending to
babies/toddlers)…
• …but hopefully this helps someone
• Please give us feedback!
Also build a robot. You will not regret it! :)
http://robo4j.io
Robo4J
@robo4j
For More Info
Robo4J Homepage: http://www.robo4j.io
Robo4J on Twitter: @robo4j
Marcus on Twitter: @hirt
Miro on Twitter: @miragemiko

More Related Content

What's hot

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMRafael Winterhalter
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracerrahulrevo
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Charles Nutter
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...Christopher Frohoff
 
Burp Plugin Development for Java n00bs - 44CON 2012
Burp Plugin Development for Java n00bs - 44CON 2012Burp Plugin Development for Java n00bs - 44CON 2012
Burp Plugin Development for Java n00bs - 44CON 201244CON
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Sylvain Wallez
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overviewjeresig
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performanceRafael Winterhalter
 
OCCI Specification Walkthrough
OCCI Specification WalkthroughOCCI Specification Walkthrough
OCCI Specification Walkthroughbefreax
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portletriround
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMatt Butcher
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Anton Arhipov
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)JiandSon
 
Getting started with Java 9 modules
Getting started with Java 9 modulesGetting started with Java 9 modules
Getting started with Java 9 modulesRafael Winterhalter
 
Cloud Plugfest OCCI, pyssf and OpenStack
Cloud Plugfest OCCI, pyssf and OpenStackCloud Plugfest OCCI, pyssf and OpenStack
Cloud Plugfest OCCI, pyssf and OpenStackAndy Edmonds
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924yohanbeschi
 

What's hot (20)

JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
Making Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVMMaking Java more dynamic: runtime code generation for the JVM
Making Java more dynamic: runtime code generation for the JVM
 
Building a java tracer
Building a java tracerBuilding a java tracer
Building a java tracer
 
Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013Beyond JVM - YOW! Sydney 2013
Beyond JVM - YOW! Sydney 2013
 
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
OWASP SD: Deserialize My Shorts: Or How I Learned To Start Worrying and Hate ...
 
Burp Plugin Development for Java n00bs - 44CON 2012
Burp Plugin Development for Java n00bs - 44CON 2012Burp Plugin Development for Java n00bs - 44CON 2012
Burp Plugin Development for Java n00bs - 44CON 2012
 
Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!Inside the JVM - Follow the white rabbit!
Inside the JVM - Follow the white rabbit!
 
JavaScript Library Overview
JavaScript Library OverviewJavaScript Library Overview
JavaScript Library Overview
 
An introduction to JVM performance
An introduction to JVM performanceAn introduction to JVM performance
An introduction to JVM performance
 
OCCI Specification Walkthrough
OCCI Specification WalkthroughOCCI Specification Walkthrough
OCCI Specification Walkthrough
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
 
Job Managment Portlet
Job Managment PortletJob Managment Portlet
Job Managment Portlet
 
Mashups with Drupal and QueryPath
Mashups with Drupal and QueryPathMashups with Drupal and QueryPath
Mashups with Drupal and QueryPath
 
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
Why Doesn't Java Has Instant Turnaround - Con-FESS 2012
 
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
2013.02.02 지앤선 테크니컬 세미나 - Xcode를 활용한 디버깅 팁(OSXDEV)
 
Getting started with Java 9 modules
Getting started with Java 9 modulesGetting started with Java 9 modules
Getting started with Java 9 modules
 
Live Updating Swift Code
Live Updating Swift CodeLive Updating Swift Code
Live Updating Swift Code
 
Fixing the Java Serialization Mess
Fixing the Java Serialization Mess Fixing the Java Serialization Mess
Fixing the Java Serialization Mess
 
Cloud Plugfest OCCI, pyssf and OpenStack
Cloud Plugfest OCCI, pyssf and OpenStackCloud Plugfest OCCI, pyssf and OpenStack
Cloud Plugfest OCCI, pyssf and OpenStack
 
Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924Introduction to the Java bytecode - So@t - 20130924
Introduction to the Java bytecode - So@t - 20130924
 

Similar to Robotics on Java Simplified

From Concept to Robotic Overlord with Robo4J
From Concept to Robotic Overlord with Robo4J From Concept to Robotic Overlord with Robo4J
From Concept to Robotic Overlord with Robo4J Miro Wengner
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSocketsGonzalo Ayuso
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4琛琳 饶
 
A slightly advanced introduction to node.js
A slightly advanced introduction to node.jsA slightly advanced introduction to node.js
A slightly advanced introduction to node.jsSudar Muthu
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Racksickill
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Anna Klepacka
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails exampleRoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails exampleRailwaymen
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilitiesDefconRussia
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6Nobuo Danjou
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineChun-Yu Wang
 
SwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup GroupSwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup GroupErnest Jumbe
 
Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2ukdpe
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesciklum_ods
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningMichel Schildmeijer
 
Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with RackDonSchado
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013Alexandre Morgaut
 

Similar to Robotics on Java Simplified (20)

From Concept to Robotic Overlord with Robo4J
From Concept to Robotic Overlord with Robo4J From Concept to Robotic Overlord with Robo4J
From Concept to Robotic Overlord with Robo4J
 
5.node js
5.node js5.node js
5.node js
 
Nodejs and WebSockets
Nodejs and WebSocketsNodejs and WebSockets
Nodejs and WebSockets
 
{{more}} Kibana4
{{more}} Kibana4{{more}} Kibana4
{{more}} Kibana4
 
A slightly advanced introduction to node.js
A slightly advanced introduction to node.jsA slightly advanced introduction to node.js
A slightly advanced introduction to node.js
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
 
RoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails exampleRoR Workshop - Web applications hacking - Ruby on Rails example
RoR Workshop - Web applications hacking - Ruby on Rails example
 
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilitiesVorontsov, golovko   ssrf attacks and sockets. smorgasbord of vulnerabilities
Vorontsov, golovko ssrf attacks and sockets. smorgasbord of vulnerabilities
 
plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6plackdo, plack-like web interface on perl6
plackdo, plack-like web interface on perl6
 
How to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machineHow to implement a simple dalvik virtual machine
How to implement a simple dalvik virtual machine
 
SwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup GroupSwampDragon presentation: The Copenhagen Django Meetup Group
SwampDragon presentation: The Copenhagen Django Meetup Group
 
Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2Windows Server 2008 for Developers - Part 2
Windows Server 2008 for Developers - Part 2
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Rapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devicesRapid java backend and api development for mobile devices
Rapid java backend and api development for mobile devices
 
Oracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuningOracle WebLogic Diagnostics & Perfomance tuning
Oracle WebLogic Diagnostics & Perfomance tuning
 
PHP Development Tools
PHP  Development ToolsPHP  Development Tools
PHP Development Tools
 
Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with Rack
 
End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013End-to-end HTML5 APIs - The Geek Gathering 2013
End-to-end HTML5 APIs - The Geek Gathering 2013
 

More from Marcus Hirt

Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission ControlMarcus Hirt
 
Diagnose Your Microservices
Diagnose Your MicroservicesDiagnose Your Microservices
Diagnose Your MicroservicesMarcus Hirt
 
Production Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMProduction Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMMarcus Hirt
 
Contributing to JDK Mission Control
Contributing to JDK Mission ControlContributing to JDK Mission Control
Contributing to JDK Mission ControlMarcus Hirt
 
Using Java Flight Recorder
Using Java Flight RecorderUsing Java Flight Recorder
Using Java Flight RecorderMarcus Hirt
 
Java Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveJava Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveMarcus Hirt
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the BoxMarcus Hirt
 

More from Marcus Hirt (7)

Getting Started with JDK Mission Control
Getting Started with JDK Mission ControlGetting Started with JDK Mission Control
Getting Started with JDK Mission Control
 
Diagnose Your Microservices
Diagnose Your MicroservicesDiagnose Your Microservices
Diagnose Your Microservices
 
Production Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVMProduction Time Profiling and Diagnostics on the JVM
Production Time Profiling and Diagnostics on the JVM
 
Contributing to JDK Mission Control
Contributing to JDK Mission ControlContributing to JDK Mission Control
Contributing to JDK Mission Control
 
Using Java Flight Recorder
Using Java Flight RecorderUsing Java Flight Recorder
Using Java Flight Recorder
 
Java Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep DiveJava Mission Control: Java Flight Recorder Deep Dive
Java Mission Control: Java Flight Recorder Deep Dive
 
Production Time Profiling Out of the Box
Production Time Profiling Out of the BoxProduction Time Profiling Out of the Box
Production Time Profiling Out of the Box
 

Recently uploaded

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 

Recently uploaded (20)

Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 

Robotics on Java Simplified

  • 1. http://robo4j.io Robo4J @robo4j Robotics on Java Simplified Robo4J Marcus Hirt, Oracle Miroslav Wengner, MAN Truck & Bus AG
  • 2. http://robo4j.io Robo4J @robo4j Robo4J • Easy to use framework for quickly getting started writing Java for hardware • Pure Java framework • Uses Pi4J for GPIO access • Core components independently usable
  • 4. http://robo4j.io Robo4J @robo4j Robo4J Hardware Modules • Simple to use Java abstractions for hardware • Can be used stand alone, does not depend on anything robo4j-hw-*
  • 5. http://robo4j.io Robo4J @robo4j Hardware Example public class HelloLcd { public static void main(String[] args) throws Exception { AdafruitLcd lcd = LcdFactory.createLCD(); lcd.setBacklight(Color.TEAL); lcd.setText("Hello World!n-----Robo4J-----"); } } Adafruit LCD
  • 6. http://robo4j.io Robo4J @robo4j Robo4J Core • Defines the core abstractions • A RoboBuilder builds the RoboContext which is basically a ”robot” • A RoboContext contains RoboReferences to RoboUnits, which are agents to which messages can be sent • Annotations on RoboUnits can change on which queue messages are sent • Provides network services (autodiscovery, remote messaging) • Is plain old Java robo4j-core
  • 7. http://robo4j.io Robo4J @robo4j Robo4J Hardware Specific Units • Pre-packaged, configurable units • Easy to use • Typically configured using XML (or programmatically) robo4j-units-*
  • 10. http://robo4j.io Robo4J @robo4j Typical Project 1. Add the units for your hardware to your configuration 2. Add your own units for controlling behaviour 3. Add a class with a main method where you initialize it all through a RoboBuilder 4. Run the main method
  • 11. http://robo4j.io Robo4J @robo4j Example public class LcdExampleDeclarativeMain { public static void main(String[] args) throws RoboBuilderException, IOException { RoboBuilder builder = new RoboBuilder().add(getResource("robo4j.xml")); RoboContext ctx = builder.build(); ctx.start(); ctx.getReference("lcd").sendMessage( new LcdMessage("Robo4J: Welcome!nPress Up/Down!")); System.out.println("Press enter to quit!"); System.in.read(); ctx.shutdown(); } … }
  • 12. http://robo4j.io Robo4J @robo4j robo4j.xml <robo4j> <roboUnit id="lcd"> <class>com.robo4j.units.rpi.lcd.AdafruitLcdUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x20</value> </config> </roboUnit> <roboUnit id="buttons"> <class>com.robo4j.units.rpi.lcd.AdafruitButtonUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int”>0x20</value> <value name="target" type="String">controller</value> </config> </roboUnit> <roboUnit id="controller"> <class>com.robo4j.rpi.lcd.example.controller.LcdExampleController</class> <config name="com.robo4j.root"> <value name="target" type="String">lcd</value> </config> </roboUnit> </robo4j>
  • 13. http://robo4j.io Robo4J @robo4j Controller @CriticalSectionTrait public class LcdExampleController extends RoboUnit<AdafruitButtonEnum> { … public void onMessage(AdafruitButtonEnum message) { if (!isDemoRunning()) { processAdafruitMessage(message); } else { SimpleLoggingUtil.print(getClass(), "Skipping " + message + " due to test already running!"); } } public void onInitialization(Configuration configuration) throws ConfigurationException { target = configuration.getString("target", null); if (target == null) { throw ConfigurationException.createMissingConfigNameException("target"); } } …
  • 14. http://robo4j.io Robo4J @robo4j Controller, continued … private void processAdafruitMessage(AdafruitButtonEnum myMessage) { switch (myMessage) { case DOWN: moveToNextDemo(); break; case UP: moveToPreviousDemo(); break; case SELECT: runDemo(); break; default: sendLcdMessage(getContext(), String.format("Button %snis not in use...", myMessage)); } } }
  • 18. http://robo4j.io Robo4J @robo4j Robo4J Networking • Autodiscovery / Heartbeats / Native package format • Messaging / Remote Contexts
  • 19. http://robo4j.io Robo4J @robo4j Autodiscovery Enablement <robo4j> <roboSystem> <config name="com.robo4j.root"> <value name="poolSizeScheduler" type="int">2</value> … <config name="com.robo4j.messageServer"> <value name="port" type="int">0</value> </config> <config name="com.robo4j.discovery"> <value name="multicastAddress" type="String">238.12.15.254</value> <value name="port" type="int">0x0FFE</value> <value name="heartBeatInterval" type="int">250</value> <value name="enabled" type="boolean">true</value> <config name="com.robo4j.discovery.metadata"> <value name="name" type="String">Button Activator</value> <value name="description" type="String">Little remote controlled button</value> </config> </config> </config> </roboSystem> </robo4j>
  • 20. http://robo4j.io Robo4J @robo4j Remote Messaging String id = "myid"; LookupService lookupService = LookupServiceProvider.getDefaultLookupService(); RoboContext context = lookupService.getContext(id); RoboReference<String> reference = context.getReference(id); reference.sendMessage("Hello!");
  • 21. http://robo4j.io Robo4J @robo4j Lookup by Metadata Stream<RoboContextDescriptor> matchingDescriptors = lookupService.getDiscoveredContexts().values().stream(). filter((ctx) -> isRoboticOverlord(ctx)); … private static boolean isRoboticOverlord(RoboContextDescriptor context) { return context.getMetadata().containsKey("isRoboticOverlord"); }
  • 23. http://robo4j.io Robo4J @robo4j Robo4J Http Communication • Want to communicate messages to the units over http • Simply add HttpServerUnit or HttpClientUnit • Communication is implemented using Java NIO • Messages by default sent as Json • Translate from/to Json and the message type accepted by the unit • Define your codecs: @HttpProducer, @HttpDecoder, @HttpEncoder
  • 24. http://robo4j.io Robo4J @robo4j Robo4J REST • Default get operation is listing all registered units with their states • Default post operation for a unit is to send a message to it • There must be a registered http codec for converting from Json to the message type for the message to be received HTTP GET: http://<ROBO4J_IP>:<ROBO4J_PORT> HTTP POST: http://<ROBO4J_IP>:<ROBO4J_PORT>/units/<unit id>
  • 25. http://robo4j.io Robo4J @robo4j Robo4J Example Get HTTP GET : http://127.0.0.1:8025 uid: 142d7167-7a43-477e-8dfd-75fdd711b6da, response: [ { id:"controller", com.robo4j.LifecycleState:"STARTED“ }, { id:"httpServer", com.robo4j.LifecycleState:"STOPPED" }, ... ]
  • 26. http://robo4j.io Robo4J @robo4j Robo4J Example Post Example: http://localhost:8025/units/controller BODY: {“message”: “push“} Returns HTTP code 202, if message was deserialized properly and put on the bus. Returns 404 if unit is not found. Returns 501 if, for example, no codec is present for the type required by the unit.
  • 27. http://robo4j.io Robo4J @robo4j Video Streaming Demo Configuration <robo4j> <roboUnit id="httpClient"> <class>com.robo4j.socket.http.units.HttpClientUnit</class> <config name="com.robo4j.root"> <value name="address" type="String">SERVER_IP</value> <value name="port" type="int">SERVER_PORT</value> <value name="mode" type="boolean">true</value> <value name="targetUnits" type="String">{"imageController":"POST"}</value> </config> </roboUnit> <roboUnit id="imageController"> <class>com.robo4j.units.rpi.camera.RaspistillUnit</class> <config name="com.robo4j.root"> <value name="targetOut" type="String">httpClient</value> <value name="client" type="String">SERVER_IP</value> <value name="clientPort" type="String">SERVER_PORT</value> <value name="clientUri" type="String”>/<SERVER_ENDPOINT></value> <value name="width" type="String">320</value> <value name="height" type="String">240</value> <value name="timelapse" type="String">100</value> </config> </roboUnit> </robo4j> • Two Robo4J Systems • Robo4J on JavaFx
  • 28. http://robo4j.io Robo4J @robo4j Video and Image Streaming Demo with Autodiscovery
  • 29. http://robo4j.io Robo4J @robo4j Robo4J and Lego Robo4J supports LejOS 9.x on Java 8 and above Hardware abstractions in robo4j-hw-lego Units in robo4j-units-lego Robo4J allows you to mix Lego functionality with other hardware Turn On the robot named “Number42”
  • 30. http://robo4j.io Robo4J @robo4j Lego Robot Number42 is alive <robo4j> <roboUnit id="http"> <class>com.robo4j.socket.http.units.HttpServerUnit</class> <config name="com.robo4j.root"> <value name="port" type="int">8025</value> <value name="target" type="String">controller</value> <value name="packages" type="String">com.robo4j.lego.j1kids.example.codec</value> <value name="targetUnits" type="String">{"controller":"GET"}</value> </config> </roboUnit> <roboUnit id="buttons"> <class>com.robo4j.units.lego.BrickButtonsUnit</class> <config name="com.robo4j.root"> <value name="target" type="String">controller</value> <value name="button_right" type="String">left</value> <value name="button_left" type="String">right</value> <value name="button_up" type="String">down</value> <value name="button_down" type="String">up</value> <value name="button_enter" type="String">enter</value> </config> </roboUnit> <roboUnit id="lcd"> <class>com.robo4j.units.lego.LcdUnit</class> <config name="com.robo4j.root"> </config> </roboUnit> <roboUnit id="controller"> <class>com.robo4j.lego.j1kids.example.controller.PlatformController</class> <config name="com.robo4j.root"> <value name="target" type="String">platform</value> </config> </roboUnit> <roboUnit id="weaponController"> <class>com.robo4j.lego.j1kids.example.controller.WeaponController</class> <config name="com.robo4j.root"> <value name="target" type="String">weapon</value> </config> </roboUnit> <roboUnit id="touchUnit"> <class>com.robo4j.units.lego.TouchUnit</class> <config name="com.robo4j.root"> <value name="target" type="String">weaponController</value> </config> </roboUnit> <roboUnit id="weapon"> <class>com.robo4j.units.lego.SingleMotorUnit</class> <config name="com.robo4j.root"> </config> </roboUnit> <roboUnit id="platform"> <class>com.robo4j.units.lego.SimpleTankUnit</class> <config name="com.robo4j.root"> <value name="leftMotorPort" type="String">B</value> <value name="leftMotorType" type="Character">N</value> <value name="rightMotorPort" type="String">C</value> <value name="rightMotorType" type="Character">N</value> </config> </roboUnit> </robo4j>
  • 32. http://robo4j.io Robo4J @robo4j Coff-E • Robotic platform (Wall-E on Java) • 3D printed + Makeblock + Pololu + Adafruit hardware
  • 34. http://robo4j.io Robo4J @robo4j Coff-E at JavaOne 2016 The embedded video on this page was removed due to presentation size restrictions. We’ve uploaded the embedded video on youtube here: https://www.youtube.com/watch?v=cNLlPGiBzqg
  • 35. http://robo4j.io Robo4J @robo4j Configuration <robo4j> <roboUnit id="lcd"> <class>com.robo4j.units.rpi.lcd.AdafruitLcdUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x20</value> </config> </roboUnit> <roboUnit id="buttons"> <class>com.robo4j.units.rpi.lcd.AdafruitButtonUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x20</value> <value name="target" type="String">controller</value> </config> </roboUnit> <robo4j> <roboUnit id="motion"> <class>com.robo4j.units.rpi.roboclaw.RoboClawRCTankUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x40</value> <value name="leftChannel" type="int">6</value> <value name="rightChannel" type="int">7</value> </config> </roboUnit> </robo4j> <roboUnit id="laserscanner.servo"> <class>com.robo4j.units.rpi.pwm.PCA9685ServoUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x40</value> <value name="channel" type="int">0</value> <value name="trim" type="float">7</value> <value name="shutdownValue" type="float">0</value> </config> </roboUnit> <roboUnit id="laserscanner.tilt"> <class>com.robo4j.units.rpi.pwm.PCA9685ServoUnit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x40</value> <value name="channel" type="int">1</value> <value name="trim" type="float">-40</value> <value name="inverted" type="boolean">true</value> <value name="shutdownValue" type="float">0</value> </config> </roboUnit> <roboUnit id="scanner"> <class>com.robo4j.units.rpi.lidarlite.LaserScanner</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x62</value> <value name="servo" type="String">laserscanner.servo</value> <value name="servoRange" type="float">45.0</value> <value name="angularSpeed" type="float">100.0</value> <value name="minAquisitionTime" type="float">2.5</value> <value name="trim" type="float">5.5</value> </config> </roboUnit> <roboUnit id="gyro"> <class>com.robo4j.units.rpi.gyro.GyroL3GD20Unit</class> <config name="com.robo4j.root"> <value name="bus" type="int">1</value> <value name="address" type="int">0x6b</value> <value name="sensitivity" type="String">DPS_245</value> <value name="enableHighPass" type="boolean">true</value> <value name="period" type="int">10</value> </config> </roboUnit> <roboUnit id="tank"> <class>com.robo4j.coffe.controllers.TankController</class> <config name="com.robo4j.root"> <value name="useTracks" type="boolean">false</value> <value name="maxSpeed" type="float">0.4</value> </config> </roboUnit> <roboUnit id="scanprocessor"> <class>com.robo4j.coffe.units.ScanProcessor</class> </roboUnit> <roboUnit id="missioncontroller"> <class>com.robo4j.coffe.controllers.MissionController</class> <config name="com.robo4j.root"> <value name="lcd" type="String">lcd</value> <value name="tank" type="String">tank</value> <value name="scanner" type="String">scanner</value> <value name="scanProcessor" type="String">scanprocessor</value> <value name="modeOfOperation" type="String">fastest_path</value> </config> </roboUnit> . . (GPS, magnetometer etc.) . </robo4j>
  • 36. http://robo4j.io Robo4J @robo4j Build Your Own Coff-E • See Thingiverse for more information: https://www.thingiverse.com/thing:1730244 • See the robo4j-coffe repo for code
  • 37. http://robo4j.io Robo4J @robo4j Tools Demo JDK Mission Control Plug-in (JFR, LIDAR Scan Visualization) Magnetometer Calibration Utility (MagViz)
  • 38. http://robo4j.io Robo4J @robo4j Summary • Robots are fun • Java and Robo4J lets you build them quickly • We have just started (had a bit of a break the past year getting/tending to babies/toddlers)… • …but hopefully this helps someone • Please give us feedback! Also build a robot. You will not regret it! :)
  • 39. http://robo4j.io Robo4J @robo4j For More Info Robo4J Homepage: http://www.robo4j.io Robo4J on Twitter: @robo4j Marcus on Twitter: @hirt Miro on Twitter: @miragemiko