![]() |
ros2_java repositoryandroid java gradle robotics ros ros2 ament ament_cmake_export_jars ament_cmake_export_jni_libraries rcljava rcljava_common rosidl_generator_java |
Repository Summary
Description | Java and Android bindings for ROS2 |
Checkout URI | https://github.com/ros2-java/ros2_java.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2022-08-10 |
Dev Status | UNKNOWN |
Released | UNRELEASED |
Tags | android java gradle robotics ros ros2 ament |
Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
Name | Version |
---|---|
ament_cmake_export_jars | 0.0.3 |
ament_cmake_export_jni_libraries | 0.0.3 |
rcljava | 0.0.3 |
rcljava_common | 0.0.3 |
rosidl_generator_java | 0.0.3 |
README
ROS 2 Java client library
Build status
Target | Status |
---|---|
ROS Galactic - Ubuntu Focal (OpenJDK) |
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:
- https://github.com/ros2-java/ament_java, which adds support for Gradle to Ament
- https://github.com/ros2-java/ament_gradle_plugin, a Gradle plugin that makes it easier to use ROS 2 in Java and Android project. The Gradle plugin can be installed from Gradle Central https://plugins.gradle.org/plugin/org.ros2.tools.gradle
- https://github.com/ros2-java/ros2_java_examples, examples for the Java Runtime Environment
- https://github.com/ros2-java/ros2_android_examples, examples for Android
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 https://github.com/ros2-java/ros2_java/issues/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.
-
Install Java and a JDK.
On Ubuntu, you can install OpenJDK with:
sudo apt install default-jdk
-
Install Gradle. Make sure you have Gradle 3.2 (or later) installed.
Ubuntu Bionic or later
sudo apt install gradle
macOS
brew install gradle
Note: if run into compatibily issues between gradle 3.x and Java 9, try using Java 8,
brew tap caskroom/versions brew cask install java8 export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.8.0.jdk/Contents/Home
Windows
choco install gradle
-
Install build tools:
sudo apt install curl python3-colcon-common-extensions python3-pip python3-vcstool
-
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
-
Source your ROS 2 installation, for example:
source /opt/ros/galactic/setup.bash
-
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/ros2-java/ros2_java/main/ros2_java_desktop.repos | vcs import src
-
Linux only Install ROS dependencies:
rosdep install --from-paths src -y -i --skip-keys "ament_tools"
File truncated at 100 lines see the full file
CONTRIBUTING
Contributing to ROS 2 Java
This document contains rules and guidelines for contributing to the ROS 2 Java project.
How to contribute
Here are a few things you can do to contribute to the project:
- Report a bug by opening an issue on GitHub
- Even better, open a pull request fixing the bug!
If you open a ticket, be patient while waiting for a response; The ROS 2 Java team is small. While you wait, other excellent ways to contribute include:
- Leave constructive feedback on an open pull request
- Try to reproduce an existing bug report and leave a comment
Pull requests
Each pull request must satisfy the following requirements before it can be merged:
- Target the latest developement branch (
main
) - Have one approval from a maintainer
- Continuous integration (CI) is building and passing tests
- This should be automatically triggered upon opening a pull request
Note about license
Any contribution that you make to this repository will be under the Apache 2 License, as dictated by that license:
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.