Sunday, January 15, 2017

Getting Started with robo4j-hw-rpi

This blog will provide a step-by-step instruction for how to quickly get started with the robo4j-hw-rpi module. We will use the Adafruit LCD as an example, but any of the supported hardware would be used in pretty much the same way. Also, if you wish support for certain 1 wire protocol sensors, like the Dallas DS18B20 temperature sensors, or the AM2302/DHT11/DHT22 temperature and humidity sensors, you can find a library for them in my private blog (for now).

Installing the Software

First of all the software required must be installed on the Raspberry Pi:
  1. Install PI4J.
    curl -s get.pi4j.com | sudo bash
  2. Set up the Raspberry for i2c communication.
  3. Install the Oracle JDK (if not already installed).
    sudo apt-get install oracle-java8-jdk
  4. Ensure that the Oracle JDK is the one in use (use java –version to verify).
    If not change so that it is. There can be a massive performance difference
  5. Clone the robo4j repo.
    git clone https://github.com/Robo4J/robo4j.git
  6. Run gradlew build in the robo4j root directory.
  7. Install Eclipse (optional, but good if you want to play around with the examples a bit).
    apt-get install eclipse

Setting up Eclipse (Optional)

For an easy way to play around with the examples, we can set up Eclipse on our Raspberry Pi.
  1. Install Egit.
    Inside of Eclipse, go to Help | Install New Software…
    Add a new update site with the following URL:
    http://download.eclipse.org/egit/updates-3.7.1/
  2. Install the Gradle plug-in.
    http://download.eclipse.org/buildship/updates/e42/releases/2.x/
  3. Go to Robo4J on GitHub and clone the repo using Egit from within Eclipse.
  4. Import the projects into Eclipse.
Note that the Eclipse version currently installed by Raspbian will be a rather old version - Eclipse 3.8.0. This unfortunately means that it will not support JDK 8. This does not matter, as the robo4j-hw-rpi and robo4j-math projects only require Java SE 1.7.
Normally you would probably like to develop in a more modern version of Eclipse (or some other IDE) and just use the command line to build robo4j.

Running the Demos

There are two ways of running the demos. One through building the robo4j.jar file with Gradle, and one through Eclipse.
Here is how you would, for example, run the LCD demo using the robo4j.jar built by gradle:
sudo java –classpath robo4j-hw-rpi/build/libs/robo4j-hw-rpi-alpha-0.2.jar:/opt/pi4j/lib/* com.robo4j.hw.rpi.i2c.adafruitlcd.Demo
If you are playing around with the code in Eclipse, do the following:
  1. With Eclipse started, open a command line and change directory to the robo4j/robo4j-hw-rpi/bin folder.
  2. Search for the demo/example corresponding to the hardware set up you want to test in the examples folder in the eclipse project.
    For example, if you have an Adafruit LCD shield, you would use the com.robo4j.hw.rpi.i2c.adafruitlcd.Demo class.
  3. Run the demo from the command line.
    Do not forget to add the PI4J classes to the classpath, for example:
    sudo java –classpath .:/opt/pi4j/lib/* com.robo4j.hw.rpi.i2c.adafruitlcd.Demo
Running the LCD shield demo would show you something similar to this:

Have fun!

Robo4J Raspberry Pi Support

There are now two new modules in Robo4J:
  • robo4j-math
    Some basic math definitions and functions that may prove useful when building robots. This module will provide common data definitions like points and lines, and also provide feature extraction and other functionality that will prove useful when building robots. We’re currently moving Coff-E to Robo4J, which means this module will grow quite a bit during the upcoming months.
  • robo4j-hw-rpi
    Provides abstractions for commonly used off-the-shelf hardware. Does not have dependencies on any other module but math, and can be used as easy to consume, stand-alone, Java hardware abstractions.
Now, if you are getting started with the Raspberry Pi and hardware, the robo4j-hw-rpi provides a quick way get started. It provides examples that are ready to run for some of the most commonly used chips and protocols out there. Using robo4j-hw-rpi can be used as simple, stand alone, java abstractions for accessing your hardware. It does not require you to buy into the rest of the framework, though we hope that using robo4j fully would be the natural next step once we get further along with our implementation.

If your particular piece of hardware is missing, please let us know. Or why not join our effort and add a nice Java abstraction for your favorite piece of hardware to the library?

Saturday, January 14, 2017

Robo4J on GitHub

The Robo4J team has now created an organisation on GitHub

We will continuously publish all updates to the Robo4J core framework, and all the other related modules, to the repositories in this new location.

Over time we plan on publishing sample code, ranging from little snippets of sample code showing how to use a certain piece of hardware, all the way up to a working autonomous robotic vehicle.

Enjoy!

Robo4J is entering the Year 2017!

  Robo4J Team wants to wish you all a beautiful start and happy New Year 2017. 
This year will be very important for the Robo4J framework. A lot of amazing things are already in the queue and waiting for the right time to be published. In such way we keep Java Robotics and IoT community full informed about the continual progress.

 The first Robo4J 2017 announcement is about the core development team. The team currently consists from two brilliant engineers with many years of experiences on the JVM field and pure Java Enthusiasts: 

Miro Wengner

twitter: @miragemiko
email: miro@robo4j.io

Marcus Hirt

twitter: @hirt
email: marcus@robo4j.io

Happy New Year 2017! 

updated section ABOUT

Monday, September 26, 2016

Robo4j.io at JavaOne 2016 - few words


   Robo4j.io framework has been selected for JavaOne4Kids part. Robo4j.io autor (@miragemiko) and the main commiter to the project has also attended many talks about robotics, Internet of Things and future inotvations, similar to the different discussion about Java 9 fugure. He also participated at Java Community Process and Java Hub at JavaOne 2016. 

  Out of all JavaOne 2016 experiences have crystallised and confirmed the future directions of Robo4j.io framework development. Although this post is not fully focused on the details we can separate those direction in following groups: 
1. Reactive framework (platform)
    robo4j has been since the beginning designed a the non-blocking platform for highly concurrent tasks/events that needs to under the certain conditions synchronised and processed.
2. Microservices design 
   robo4j has been divided into the fully independent units. Those units are accepting/providing connection with the rest of the world using specific protocols. Units are distributed over the ecosystem and they are fully independent.
3. Machine-learning and big data
  robo4j provides sockets to plug different types of data storages and algorithms that are later used as the inputs/outputs for internal or external actions. 

 We do pay special attention on those three mentioned points. Why ? Robo4j.io framwork intents to be the framework that fully hightly supports distributed systems. Such point is becoming to be crucial in the upcoming age of Internet Of Things, Clouds etc. 

   All of three mentioned points are representing a lot of work and touched framework continual evolution that need to be done to achieve the expecting goal.

   ...And as the CERN is taking a care about small things, Let's move the robo4j forward
to the next milestone!!

Sunday, September 11, 2016

Robo4j Design Sketch

Following design sketch should draw out the core ideas how the Robo4j framework is internally designed and what to expect. The ability of any Image  to carry much bigger mass of information than written text is fully appreciated here. 
  Robo4j Framework is meant to be fully agent system. Every agent has ability to interact with any other agent over appropriate interfaces. Every agent can create his own decision which is then transmitted to the Robo4j core message bus. 
  Robo4j Message Bus represents the abstraction of the communication line with underlying core system logic. Core logic is then executed on real hardware which represent the robot to the outside word.  
  Robo4j provides direct IO Socket based communication line which allows user to interact with the Robo4j System. Every external user action is then transmitted to the system core, analysed and presented as the Robo4j Event (Reaction). Robo4j provides also various connector with different data storages.
  In general Robo4j is Agent and Event based system which synchronises asynchronously incoming events.

Wednesday, September 7, 2016

Robo4j Officially at JavaOne, JavaOne4Kids :: we will create the future


  Robo4j will introduce and present its simplicity at JavaOne4Kids (not Only for Kids ;) as the part of JavaOne conference.
We have reserved 2 hours slot full of fun. We in those two amazing hours we will assemble the robot and write different programs. 
Robo4j will make robot alive. 
  
  See you there! Robo4j is looking forward for you!
JavaOne4Kids agenda