I’m a maintainer of IHMC Robotics’ ROS 2 support and just wanted to add a few things.
Our biggest requirement is allocation free communication in order for our realtime robot controller to accept commands and publish configuration status. We run a normal JDK on top of a patched Linux kernel allowing us to create realtime threads in Java. If our Java software allocates memory over time, it will trigger a garbage collect, causing missed realtime deadlines.
Our approach to supporting ROS 2 was as a bonus feature. We are basically using SWIG on FastRTPS with some modifications to ensure zero Java allocations. We periodically upgrade FastRTPS to a version matching a ROS 2 release, but it has been rarely necessary. The only incompatibility between releases so far has been between Ardent and Bouncy when they changed how the topics were partitioned. That change didn’t even require upgrading FastRTPS. I’m only saying this as an argument that it might not require that much maintenance for any custom solution.
Also, we aren’t using very many ROS 2 features. We hardly even use any of the standard messages, but we would like to change that. We are using basic publish and subscribe with some FastRTPS performance settings. Our intraprocess mode is currently 100% Java. We don’t support ROS services or parameters, for example.
Our message type support is currently a forked and modified version of the official python msg -> IDL generator (.em template), which we then convert to a Java type using ANTLR. We add several convenience features to the Java types like deep copy, Javadoc sourced from the .msg file, and some others. This is actually the nicest part of our library. We do lack .msg dependency management because we aren’t in a ROS 2 workspace, so we have a hacked together system for that.
I am still somewhat unfamiliar with how ros2-java works. If someone could explain the ideas and tech behind it, that would be enormously helpful.
Java is a very difficult step for ROS to support because its build system is completely different. We have a similar setup to a ROS workspace for Java achieved with a complicated Gradle plugin. We too have the ability to clone several repositories to a folder which automatically get assembled into a single build. When dependencies aren’t present via source code, they are resolved via Maven.
I am a big fan of ROS in general. They have solved a lot of the same problems as us. I would be extremely excited to see the integration of these two projects.