LEGO + Java = ROS

85 views
Skip to first unread message

Elijah Motorny

unread,
Sep 4, 2014, 7:14:10 AM9/4/14
to ros-si...@googlegroups.com, ros-s...@googlegroups.com, ros-sig...@googlegroups.com, ros-sig-...@googlegroups.com

Hi, everybody,


I've just started  my experiments with ROS. My goal is to use widely-spread Lego Mindstorms EV3 as robot mechanics, and portable ARM devices as head device. That will newbies easly and  to join ROS development, and help robot developers easily prototype  robots with Lego sets.


The project is named ev3-javabrick(probably will rename it) and written in Java(using rosjava).


http://sourceforge.net/projects/ev3javabrick/


I'm developing two variants of ev3-javabrick - the first one for Android devices, and the second - for Android-based TV boxes(Android TV BOX) with customized firmware.


Lego EV3 brick works as usual with stock firmware


What is done:


Mechanics

My son assembled for me standard Lego example - GRIPP3R without decoration


Head Devices hardware.

Android version.

Several devices were tested. Unfortunately, most of devices do not support Android USB Host API. Some of them do not have physical USB/OTG, and some of them have the API blocked. For now, list of supported Android devices:

  • ASUS zenfone 4

  • ASUS fonetab 7

  • Samsung Galaxy S4(octa core)

I use ASUS fonetab 7, Lego brick is connected to USB/OTG plug






TV box version.

I got old, but quite popular device MK808. CPU: Rockchip RK3066, 2 core ARM up to 1.6 GHz, 1GB RAM, 1x USB host+1xUSB OTG, Wifi, microSD

  • Stock firmware was replaced with Finless 1.7

  • Linux kernel and drivers 3.0.36 from olegk0 as recovery image

  • Linaro 14.04 developer on microSd

  • ROS Indigo base installed

  • Oracle Embedded JRE 1.8 compact3 profile

Lego brick is connected to MK808 with two USB cables. One(black) just provides power to the MK808, another(white) is for communication between MK808 and the brick.


Surely, I didn’t make any custom software at this stage, and anybody could do the same with other devices, including Intel NUC, Odroid boards or reflashed Allwinner/Rockchip TV boxes etc.


Low-level library

I've partially ported MonoBrick library from .NET to Java. Also I implemented three different transports between Lego Brick and head device:

  • Win/Linux host: usb4java over libusb

  • All hosts: Wifi communication to Lego brick

  • Android host: Android USB Host API

  • Not implemented yet: Android Bluetooth Api

The library supports Lego EV3 motors, including tachometers, and about 15 different sensors, including but not limited with:

  • EV3

    • Ultrasonic

    • Infrared

    • Button

    • Color

    • Sound

  • NXT

    • Button

    • Ultrasonic

    • Color

  • HiTechnick

    • PIR

    • IRseeker2

    • Angle


ROS Node

TV box version

rosgraph-ev3.pngI developed Java program which runs:

  • ROS master node

  • LEGO control node with several publishers and subscribers, including odometry publisher

  • nanohttpd sever with single very simple page which allows control LEGO ROS node with keyboard, gamepad or joystick. Also the page displays some telemetry:

    • speed

    • battery voltage

    • IR proximity sensor value








Android version

not ready yet

Hosts the same nodes as TV box version plas periodically publishes images from camera


Some Screenshots

Odometery

rviz_screenshot_2014_09_03-10_14_02.png

Android app

Screenshot_2014-09-04-00-01-54.jpg


Future plans

  • mare full-featured ROS node with stereovision

  • migrate from Maven to Gradle

  • add Android bluetooth support

  • Add Lego NXT support

Elijah Motorny

unread,
Sep 5, 2014, 6:06:41 AM9/5/14
to ros-si...@googlegroups.com, ros-s...@googlegroups.com, ros-sig...@googlegroups.com, ros-sig-...@googlegroups.com
Project wiki updated. Any questions, corrections, feedbacks are welcome.

http://sourceforge.net/p/ev3javabrick/wiki/


Reply all
Reply to author
Forward
0 new messages