EV3Dev-lang-Java is a Java project designed to build Software for Robots with EV3Dev hardware & the LeJOS way.
What is the latest EV3Dev version supported?
THe libraries was tested with the latest stable EV3Dev versions for Debian Jessie:
- EV3 Brick: 4.4.47-19-ev3dev-ev3
- RaspberryPi 3 with BrickPi+ & PiStorms: 4.4.47-19-ev3dev-rpi2
If you need further information about stable EV3Dev images, click here
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.
What libraries contains EV3Dev-lang-java?
The project contains the following Java libraries/scripts:
- EV3Dev-lang-java: Low level interation with EV3Dev
- lejos-commons: LeJOS interfaces & utilities
- lejos-navigation: LeJOS navigation stack
- RPLidar4J: RPLidar A1 support
- Installer: A set of Bash scripts to automate some operations with your brick
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)
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
- Automatic installation of OpenCV
- eSpeak TTS (Text to speech) Support
- LeJOS Sensor filter Support
- LeJOS local navigation stack Support
- RPLidar A1 (2D Lidar) Support
To check the roadmap, it is better to review the backlog:
https://github.com/ev3dev-lang-java/ev3dev-lang-java/issues
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
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
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
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.
Take a look the following examples to discover some features included with this Java project.
EV3Dev-lang-Java:
- ev3dev.misc
- BumperCar
- BumperCar2
- ev3dev.robotics.tts
- TTSDemo
- TTSDemo2
- ev3dev.actuators
- LCDDrawIconsTest
- LCDDrawImagesTest
- LCDDrawLinesTest
- LCDDrawRectanglesTest
- LCDFontTest
- LCDTest
- LCDWriteTextTest
- SoundDemo
- ev3dev.actuators.ev3
- LEDExample
- ev3dev.actuators.lego.motors
- LargeMotorDemo
- LargeMotorDemo2
- MediumMotorDemo
- MotorEventTest
- MultipleMotorsDemo
- MultipleMotorsStopDemo
- RegulatedMotorRotateDemo
- RegulatedMotorRotateDemo
- RegulatedMotorRotateToDemo
- UnregulatedMotorDemo
- UnregulatedMotorDemo2
- UnregulatedMutilpleMotorDemo
- ev3dev.sensors
- BatteryDemo
- ButtonExample
- ev3dev.sensors.ev3
- ColorSensorDemo
- ColorSensorDemo2
- ColorSensorDemo3
- ColorSensorMultipleDemo
- GyroSensorDemo
- GyroSensorDemo2
- GyroSensorDemo3
- IRSensorDemo
- IRSensorDemo2
- IRSensorDemo3
- TouchSensorDemo
- USSensorDemo
- USSensorDemo2
- ev3dev.hardware
- PlatformTest
lejos-commons:
- lejos.commons.subsumption
- BumperCar
- DriveForward
- HitWall
lejos-navigation:
- lejos.robotics.navigation
- PilotConfig
- PilotConfig2
- DifferentialPilotStopTest
- DifferentialPilotTest1
- DifferentialPilotTest9
- MoveControllerTest1
- MoveControllerTest2
- NavigatorTest1
- NavigatorTest2
- NavigatorTest3
- NavigatorTest4
- lejos.robotics.objectdetection
- FeatureAvoider
- FeatureAvoider2
- FeatureAvoider3
- https://www.youtube.com/watch?v=Gxew3aNH6ks
- https://www.youtube.com/watch?v=1d9q24aNMHQ
- https://www.youtube.com/watch?v=SIwG848ODI8
- LeJOS: http://www.lejos.org/
- LeJOS Git: http://sourceforge.net/p/lejos/ev3/code/ci/master/tree/
- EV3Dev: http://www.ev3dev.org/
- EV3Dev // Getting Started: http://www.ev3dev.org/docs/getting-started/

