Skip to content

minecraft-ros2/ros2_java

 
 

Repository files navigation

ROS 2 Java client library

build docker image

Introduction

This is a set of projects (bindings, code generator, examples and more) that enables developers to write ROS 2 applications for the JVM and Android.

Besides this repository itself, there's also:

Is this Java only?

No, any language that targets the JVM can be used to write ROS 2 applications.

Including Android?

Yep! Make sure to use Fast-RTPS as your DDS vendor and at least this revision.

Features

The current set of features include:

  • Generation of all builtin and complex ROS types, including arrays, strings, nested types, constants, etc.
  • Support for publishers and subscriptions
  • Tunable Quality of Service (e.g. lossy networks, reliable delivery, etc.)
  • Clients and services
  • Timers
  • Composition (i.e. more than one node per process)
  • Time handling (system and steady, ROS time not yet supported ros2-java#122)
  • Support for Android
  • Parameters services and clients (both asynchronous and synchronous)

Sounds great, how can I try this out?

Install dependencies

Note: While the following instructions use a Linux shell the same can be done on other platforms like Windows with slightly adjusted commands.

  1. Install ROS 2.

  2. Install Java and a JDK.

    On Ubuntu, you can install OpenJDK with:

     sudo apt install default-jdk
    
  3. Install Gradle. Make sure you have Gradle 3.2 (or later) installed.

    Ubuntu Bionic or later

     sudo apt install gradle
    
  4. Install build tools:

     sudo apt install curl python3-colcon-common-extensions python3-pip python3-vcstool
    
  5. Install Gradle extensions for colcon:

     python3 -m pip install -U git+https://github.com/colcon/colcon-gradle
     python3 -m pip install --no-deps -U git+https://github.com/colcon/colcon-ros-gradle
    

Download and Build ROS 2 Java for Desktop

  1. Source your ROS 2 installation, for example:

     source /opt/ros/humble/setup.bash
    
  2. Download the ROS 2 Java repositories into a workspace:

     mkdir -p ros2_java_ws/src
     cd ros2_java_ws
     curl -skL https://raw.githubusercontent.com/minecraft-ros2/ros2_java/main/ros2_java_desktop.repos | vcs import src
    
  3. Linux only Install ROS dependencies:

     rosdep install --from-paths src -y -i --skip-keys "ament_tools"
    
  4. Build desktop packages:

     colcon build
    

    Note, Do not use symlink-install

Contributing

Contributions are more than welcome! If you'd like to contribute to the project, please read CONTRIBUTING for contributing guidelines.

About

Java and Android bindings for ROS2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Java 58.8%
  • C++ 16.7%
  • CMake 8.8%
  • EmberScript 7.0%
  • C 6.3%
  • Python 1.3%
  • Other 1.1%