Repository navigation
Closed
Description
This is a meta-ticket with a list of tasks for ROS 2 Java support targeting Foxy. These are tasks that I'm scheduling for myself, posting here for visibility. I'm not imposing a specific timeline on anything, but it would be nice to get things in for the release date.
If anyone would like to help out on any of the items (implementation or review), please comment on this ticket!
Roadmap
Will be updated as work progresses and tickets are opened
- Dashing / Foxy support 👷♂️
- rosidl_generator_java (Update rosidl_generator_java for Dashing compatibility #66) (Update rosidl_generator_java tests #68) (Fix service and action interface generation #76) 🔍
- rcljava (Update rcljava for Dashing #75) 🔍
- Get CI running (Rename rcljava_common cpp headers to have .hpp suffix #93) (Shutdown default context after tests #95) (Add GitHub workflow for Dashing #96) 🔍
- Windows CI 👷♂️
- macOS CI 👷♂️
- Android CI 👷♂️
- Support simulation time 👷♂️
- Actions (ROS Actions #138) 👷♂️
- Action server
- Action client
- Figure out how to package Gradle packages
- In particular, AMENT_PACKAGE_PREFIX and CLASSPATH are not being set (see Future of ament_build_type_gradle ament_java#9)
- Retroactive interface generation
- It would be good to have a mechanism to invoke the rosidl_generator_java pipeline for packages already installed. This would enable rcljava to be installed without having to build all of ROS 2 from source. On a somewhat related note, it sounds like rclnodejs accomplishes this, perhaps with some manual steps required.
- Refactor as necessary to support many nodes per ROS context
- Depends on Reconsider Node to Participant mapping ros2/design#250 and Modify implementations to use one Participant per Context ros2/rmw#183 for more info. We may not need to make any changes in rcljava.
- Architecture / API review
- High level documentation
- Document design (e.g. how it integrates with rcl)
- Some tutorials on how to use
Nice to haves
These items are lower on my priority list
- Intra-process communication
- Lifecycle nodes
- Parameter improvements
- Declared parameters
- "on set" parameter callbacks
- Parameter constraints
- E.g. numerical range constraints
- Incompatible QoS setting callbacks
Metadata
Metadata
Assignees
Labels
No labels
Activity
nielstiben commentedon May 7, 2020
Hello @jacobperron ,
My name is Niels, a fourth-year Software Engineering bachelor student. I’m the person who offered to contribute to action support for rcljava (see "Official” Java Client Library).
I’m new to ROS 2. Also, I’ve never worked with real C++ projects before, which means that the development can take longer. But I’m willing to learn!
I was wondering if you could recommend a particular IDE for rcljava development.
Today, I tried to configure my IDE (IntelliJ) for rcljava development. The Java files and its dependencies were recognised, I was even able to run the examples from the example project. Rcljava’s testing package is the only package that gives problems now; it does not seem to find “rcljava.msg.” classes. It appears that they (I followed the official ros2-java instructions).
In the end, IntelliJ does not seem to be great for C++ development; so I tried CLion too. CLion seems to lack proper Java development support, so I’m curious what tooling/IDE you are using for rcljava-development.
Also, I would like to hear if you already started on certain functionality I can build upon too.
Due to my ROS2 experience, it would help if you can steer me in any direction.
Thank you in advance for your help and time. In the meantime, I'll be trying to get more familiar with rcljava.
Niels Tiben
esteve commentedon May 7, 2020
@nielstiben nice to see you contributing to
ros2-java, thanks! 🙂This is tricky, because
rcljavauses four languages C, C++, Java and Python, so you'd need a really complete IDE if you expect to have the same features for all the languages.Personally, I use VSCode, but mostly because it's fast and has an adequate set of features for all these languages (e.g. its support for Java is not as good as IntelliJ nor it's as good for C++ as CLion, but it's good enough for me overall).
For developing application that use
rcljava, you may use any IDE that supports Java,rcljavahas support for the more traditional Java toolchain, such as integration with Gradle.What would you like to work on? I recall your advisor mentioned you're using actions in your project, would you like to give it a shot?
Thanks!
nielstiben commentedon May 7, 2020
@esteve
Thank you for sharing your experiences with IDEs.
You are right about the note of my advisor. I'm indeed planning to work on rcljava action support. Due to my experience, it might be good to start with action client support. I assume that action-client implementation is easier than action-server implementation.
Although it is (probably) going to be difficult, I'm really willing to give it a shot.
jacobperron commentedon May 7, 2020
@nielstiben
I don't typically use an IDE, but when I do I reach for VSCode as well.
Regarding a starting point, starting with the client sounds good to me. My suggestion is to first familiarize yourself with the design doc about actions, and then maybe take a look at the Python and C++ examples. From there, it would be nice to propose some Java examples. Having a draft PR open gives us a place to discuss what we'd like the API to look like (they don't have to compile).
nielstiben commentedon May 20, 2020
@jacobperron @esteve
I forked the ros2_java and its corresponding examples project. The feature branch that I created contains the initial version of rcljava's action client support on which I'm working on.
I implemented boilerplate code for the action client implementation and I managed to get a simple action started via an example. I tried it together with the cpp action server of the ROS2 rclcpp example. So from rcljava, an action is started that is effectively picked up by an rclcpp action server, which is good. For this I use the Fibonacci example.
However, I have a problem sending the action goal message. It seems that the action goal message loses its payload when it is sent from the java implementation (via JNI) to the cpp implementation. In the (java) example I set the fibonacci 'order' to 8. However, in cpp 'order' always returns 0.
When I hard-code a Fibonacci goal message in the action client cpp implementation with a specified order, it does actually work. So it really seems that something goes wrong when the action goal message gets passed from java to cpp.
Would you mind having a look at my feature branch to determine what's wrong?
wilcobonestroo commentedon May 25, 2020
Dear @jacobperron or @esteve, Would it be possible to have a short telco (skype / teams / etc.) to get us on track on this topic? We are trying to get our head around it, but we are still not sure if we are thinking in the right direction. We would really appreciate it.
esteve commentedon May 25, 2020
@nielstiben @wilcobonestroo
Sure thing, send us email to esteve.fernandez (at) gmail.com and jacob (at) openrobotics.org and we can schedule a time. Jacob is based in the west coast of the US, but I'm here in Europe, so it may be easier for you guys.
esteve commentedon May 25, 2020
@nielstiben
It sounds weird indeed, especially because passing objects between C++ and Java is well tested elsewhere in the codebase, let me have a look at it and get back to you.
esteve commentedon May 25, 2020
@nielstiben
You shouldn't be using a
reinterpret_casthere https://github.com/nielstiben/ros2_java/blob/e6ec40e946dd64ed5f99b30175747b4fb6339d9b/rcljava/src/main/cpp/org_ros2_rcljava_action_client_ActionClientImpl.cpp#L62-L63Have you tried with a
static_castinstead?nielstiben commentedon May 27, 2020
Yes, I have tried that. It returns the same result, as in always returns value
0.I just tried the exact same approach of printing an object's value in the (already finished) client implementation, and printing the request object values is working perfectly fine there.
When I run the Client Example (AddTwoInts), I am able to print
aandbvalues from theAddTwoInts_Request objectin the C++ implementation. The C++ code is showing returning the request object's actual value.For some reason, the ActionClient implementation does not recognise the actual value of the request object and always returns value
0.jacobperron commentedon May 27, 2020
Sorry, I haven't had a chance to take a look (I've been busy with Foxy releases tasks). I'm happy to join a teleconference. I should have more time to invest in rcljava after the initial release of Foxy.
nielstiben commentedon May 29, 2020
Yesterday, @wilcobonestroo and I had an online conversation with @esteve to get more familiar with the source code and to walk through an issue I am currently facing (see my comment above).
The issue seemed related to a bug in generating code for action requests because:
<action_name>_SendGoal_Request__convert_from_javaand other functions where not generated.<action_name>_FeedbackMessagewas not only placed inserted into the_FeedbackMessage-files, but also into the_SendGoal-files.I created an MR, and these issues should be fixed.
However, this MR does not seem to fix my initial issue. Luckily, I have figured some way to get it functional.
In the C++ implementation, I'm am receiving an
test_msgs__action__Fibonacci_Goalfrom the JNI.The
rcl_action_send_goal_requestexpectstest_msgs__action__Fibonacci_SendGoal_Requestinstead. AFAIK,_SendGoal_Requestis a container that holds the_Goalobject.It is not difficult to generate a
_SendGoal_Requestobject that holds a_Goal, as I did in my feature branch. I got it working for the Fibonacci-example, but my implementation is very static and not working with any other type at the moment.Is it possible to generate an 'uknown'
_SendGoal_Requestthat works with can hold any goal type? I tried do something like this (rclcpp), but that doesn't seem to work in my case.jacobperron commentedon Nov 13, 2021
I've let this metaticket go stale, so I'm going to close it out.
To wrap up the current state: we've done a lot of work on the osrf fork and have started migrating changes upstream. Due to resource limitations, the focus will be on supporting the latest ROS distro (currently Galactic).
Add method to prune pending requests in client (#82)