Skip to content

ev3dev-lang-java/ev3dev-lang-java

Repository files navigation

ev3dev-lang-java

EV3Dev-lang-Java is a Java project designed to build Software for Robots with EV3Dev hardware & the LeJOS way.

Dependency Status Travis CI

What is the latest EV3Dev version supported?

THe libraries was tested with the latest stable EV3Dev versions for Debian Jessie:

If you need further information about stable EV3Dev images, click here

Introduction

In Lego Mindstorms ecosystem, the default solution to develop Java software for Lego Mindstorms is LeJOS. But now exists one alternative, EV3Dev-lang-java a Java project running on the top of EV3Dev.

Lego Mindstorms ecosystem is a nice educational way to learn Java programming in general and Robotics in particular. Now, it is possible to install a complete Linux distro in the third generation of the product and others companies like Mindsensors & Dexter Industries has released products which interact with Sensors & Actuators from Lego ecosystem and that boards can use the Power of the popular board Raspberry Pi 3

Now, with the help of EV3Dev, it is possible to have the same Linux experience for multiple boards. So... why not develop a Java library for that Linux Distro? The answer is EV3Dev-lang-java. The project, takes the good things of both worlds: EV3Dev with the complete linux experience and LeJOS with the rich local navigation stack.

ScreenShot

What libraries contains EV3Dev-lang-java?

The project contains the following Java libraries/scripts:

Advantages of the usage of this project?

Basically, with this library you can develop educational robots with Java for the following bricks:

  • EV3 Brick
  • BrickPi+
  • BrickPi 3 (Scheduled on v0.7.0)
  • PiStorms

Now, with the same syntax, it is possible to deploy the software for robots on Raspberry Pi with BrickPi & PiStorms.

Any EV3 Brick uses a SoC: Sitara Processor AM1808 (from year 2010) to manage Sensors & Actuators but now with the usage of a BrickPi/PiStorms unit, it is possible to use the power of a Raspberry Pi 3.

2010 Chip included on EV3 Brick:

SoC: Sitara Processor AM1808
CPU: ARM9 300MHz
RAM: 16KB of Instruction Cache, 16KB of Data Cache ,8KB of RAM (Vector Table), 64KB of ROM

2016 Chip included on Raspberry Pi 3:

SoC: Broadcom BCM2837
CPU: 4× ARM Cortex-A53, 1.2GHz
RAM: 1GB LPDDR2 (900 MHz)

Features included in the whole project

Java features

  • Automatic installation of Oracle Java JDK 8 for Brickpi+/PiStorms + Raspberry Pi 3
  • Partial installation of Oracle Java JRE 8 for EV3 Brick
  • OpenJDK Java 9 EA support for Brickpi+/PiStorms + Raspberry Pi 3
  • Java profiling tools Support (Oracle mission control & JConsole)
  • Logging support based on SLF4J
  • Centralized logs with Kibana

Platform features

  • Support for EV3 Brick, PiStorms v1/v2, BrickPi+ & BrickPi 3

Lego Mindstorms features

  • Regulated Motor Support
  • Unregulated Motor Support
  • Sensor Support (EV3 sensors)
  • Sounds Support

Robotics

Roadmap

To check the roadmap, it is better to review the backlog: https://github.com/ev3dev-lang-java/ev3dev-lang-java/issues

Getting Started

1. Install EV3Dev on your brick

Follow the following link to install EV3Dev:

http://www.ev3dev.org/docs/getting-started/

Once you finish this step, you will have a complete Linux distro to run any Programming language

Note: Please, update your brick with latest update before continuing with the next step.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot

2. Install Java on your brick

For this step exist 2 paths.

2.1 EV3 Brick:

The EV3 Brick was designed with a SOC based on ARM EABI and the fastest JRE option is based on Oracle and it is not possible to download in an automatic way so you have to download the JRE on your local machine from here and later copy to your brick using scp:

scp "./ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" "robot@192.168.1.85:/home/robot"

Once, you have the file on the brick, you can continue the Java installation with the installer or do your self manually.

Using the installer:

cd /home/robot
mkdir installer
cd installer
wget -N https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/installer.sh
chmod +x installer.sh
sudo ./installer.sh help
sudo ./installer.sh

Manual way:

tar -zxvf "/home/robot/ejdk-8-fcs-b132-linux-arm-sflt-03_mar_2014.tar.gz" -C /opt
sudo update-alternatives --install /usr/bin/java java /opt/ejdk1.8.0/linux_arm_sflt/jre/bin/java 1
java -version

Now, you have Java on your EV3 Brick

2.2 BrickPi+ / PiStorms:

Using the installer, it is possible to automate everything:

cd /home/robot
mkdir installer
cd installer
wget -N https://raw.githubusercontent.com/ev3dev-lang-java/installer/develop/installer.sh
chmod +x installer.sh
sudo ./installer.sh help
sudo ./installer.sh

Further information about the installer here: https://github.com/ev3dev-lang-java/installer

3. Create your first Project and deploy on your Brick

Once you have the required infrastructure on your Brick, it is possible to experiment with the libraries in some ways:

3.1 Using a Gradle template project

If you like, you can experiment with the project, using the following project template:

https://github.com/ev3dev-lang-java/template_project_gradle

Download the project, update the file: deploy.gradle: with the IP of you Brick:

remotes {
    ev3dev {
        host = '10.0.1.3'
        user = 'robot'
        password = 'maker'
    }
}

To deploy the example on your brick, open a terminal and type:

./gradlew deployAndRun

3.2 Create a project from scratch:

Another alternative is the creation of a project from Scrach using Maven/Gradle.

To start a new project with this library, add the following repository and dependency.

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.ev3dev-lang-java</groupId>
    <artifactId>ev3dev-lang-java</artifactId>
    <version>v0.6.1</version>
</dependency>

Further information about the Maven dependency: https://jitpack.io/#ev3dev-lang-java/ev3dev-lang-java/v0.6.1

Unit testing

Exist many examples used to test the project. In the future we will automate a good % of the tests using JUnit testing and Mocks but at the moment, many features are tested manually.

Examples

Take a look the following examples to discover some features included with this Java project.

EV3Dev-lang-Java:

lejos-commons:

lejos-navigation:

Videos

UML Design

ScreenShot

References:

Packages

 
 
 

Contributors