Supported programming languages

337 views
Skip to first unread message

Lennart Na

unread,
Dec 3, 2015, 10:24:43 AM12/3/15
to ROS SIG NG ROS
Hi,
the OpenSplice DDS library supports C/C++/Java and C# bindings and code generation from idl.
So do you plan to support any languages beside C/C++ ?


William Woodall

unread,
Dec 3, 2015, 11:20:04 AM12/3/15
to ROS SIG NG ROS
At this point we plan to support a C++ library and a Python library as well as a C API which can be used to make bindings (as is our intention with the Python library). Beyond that we'll have to see where there is interest. There is a lot more to making a ROS client library than just having a DDS API and IDL code generation for that language, and having those only matter if you're going to make a ROS client library "from scratch".

We don't have any current plans to officially support other languages, but I imagine we'll either expand those plans in the future or other parties will wrap our C API to provide bindings in their preferred language. This is the case for ROS 1 as well (it only officially supports message passing in C++, Python, and Lisp) and yet it has many more bindings than what is provided in the core.

For Java, there are a lot of people using ROSJava (ROS 1) so I'd say there is a good chance someone will pick that up, possibly even OSRF.

For C#, it hasn't been as popular as C++ and Java in the ROS community, but it does exist. Many people who use C# do so on Windows (but not all) and since we're supporting out C/C++ API's on Windows with ROS 2 it should be easier to integrate those into the C# frameworks and tools people use on Windows. I don't think that makes it easier to support C# on Linux, but it might help to foster community interest in C# bindings.

Hope that answers your questions,

--
You received this message because you are subscribed to the Google Groups "ROS SIG NG ROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ros-sig-ng-ro...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
William Woodall
ROS Development Team

Steven

unread,
Dec 31, 2015, 6:01:39 PM12/31/15
to ROS SIG NG ROS
William,

Is anyone else pursuing Java that you are aware of at this point?

I am considering implementing ROS2 in Java for a project. I like the high level isolation in ROS2 from particular DDS vendors and sane default QoS implementations while still being able to reach down into the DDS API. Has the ROS2 team analyzed approaches to doing so -- ie with JNA bindings or with raw bindings to Java DDS implementations? Any thoughts or recommendations?

Some random thoughts...
With just a binding layer, you would still need to mirror the generated C/C++ classes from IDL into Java via JNA/JNI which sounds like a mess. The flip side, as you mentioned ,would be more like the rosjava approach and implement switching out of DDS implementations... maybe via something like Apache Camel while still providing the same ROS2 API.

Thanks!
Steve

William Woodall

unread,
Jan 11, 2016, 4:26:34 PM1/11/16
to ROS SIG NG ROS
Steven,

Sorry for the delay, I've been playing catchup since the new year. I'll try to answer you inline.

On Thu, Dec 31, 2015 at 3:01 PM, Steven <whathasno...@gmail.com> wrote:
William,
 
Is anyone else pursuing Java that you are aware of at this point?

No.
 

I am considering implementing ROS2 in Java for a project. I like the high level isolation in ROS2 from particular DDS vendors and sane default QoS implementations while still being able to reach down into the DDS API. Has the ROS2 team analyzed approaches to doing so -- ie with JNA bindings or with raw bindings to Java DDS implementations? Any thoughts or recommendations?

We're just now working on our first language bindings (C and Python) and we're still working out exactly how it should all work.

I'm not super familiar with the differences between the JNI and JNA interfaces, but I think the main difference is that JNI is more complicated, but required for C++ classes. Since we have a C API (https://github.com/ros2/rcl/tree/master/rcl/include/rcl), I'm almost certain using JNA the way to go. It would be possible to write a ROS 2 client from scratch in Java, using one the DDS implementation's Java interface under the hood, but that will be difficult until we have written our ROS 2 client library specification. Until that document is written you'd have to just look at how the C++ or C API work right now and emulate that.
 

Some random thoughts...
With just a binding layer, you would still need to mirror the generated C/C++ classes from IDL into Java via JNA/JNI which sounds like a mess. The flip side, as you mentioned ,would be more like the rosjava approach and implement switching out of DDS implementations... maybe via something like Apache Camel while still providing the same ROS2 API.

Yes that is the tricky part of all of this, code generation. So for each `.msg` file the user provides we generate some generic C code and some implementation specific C code for each middleware implementation (e.g. OpenSplice vs Connext) which also the generated code from the equivalent IDL files and converting between types. In the case of Python we'll additionally generate some Python code for each `.msg` which the user can use and pass to our Python binding of our C API, and just before passing down to the C API our Python code will convert the Python version of the message to C version.

In C++ we have specializations which allows to avoid converting the C++ messages into C messages before going to in the middleware, but this requires extra support in each of the middleware implementations (rather than reusing the basic C type support). We could do the same with Python potentially (have a specialization for PyObject's), but probably not to start off. The same options would apply for a Java binding.

I hope that gives you some more information about the subject. If you're still interested I'd suggest keeping an eye on our C API and our Python bindings over the next few months.

Cheers,

Juan Antonio Breña Moral

unread,
Jan 20, 2016, 2:56:11 PM1/20/16
to ROS SIG NG ROS
Hi Everyone, 

In my case, I would like to develop the support for Java.
I think that one of the principles of ROS and ROS2 is the language neutrality so I think that I could like to collaborate in the project.

@William in your opinion what is the best point to start to study the way to compile a problem in Python or C++ 
I would like to understand the way to see how to migrate the idea to Java.

Can you help me?

Juan Antonio

Esteve Fernandez

unread,
Jan 20, 2016, 7:18:18 PM1/20/16
to ros-sig...@googlegroups.com
Hi Juan,

that'd be awesome, however right now we are still in early stages
adding support for Python [1] and we're learning from the experience,
so the underlying layers of ROS2 may change in order to further
support more languages besides C and C++. A good starting point is to
first to experiment with ROS2 and have a look at how it's structured
in layers [2]. For Python, we're building on top of RCL, generating
Python classes that match the messages and pass them to a RCL wrapper,
but we may or may not have to revisit this depending on what the
process ends up like.

Cheers.

1 - https://github.com/ros2/rosidl/tree/master/rosidl_generator_py
2 - http://design.ros2.org/articles/ros_middleware_interface.html

William Woodall

unread,
Jan 20, 2016, 7:26:47 PM1/20/16
to ROS SIG NG ROS
Just to add to what Esteve said, we'd like to write a tutorial for adding a new language and/or message generator, but before we do that, as Esteve pointed out, we'd like to learn from making a Python client and fix some things internally based on that.

Also I think the article linked doesn't describe `rcl` specifically. This document goes into more detail, but may be a little out of date:


Feel free to contact us here or directly with questions as you come to them.

Cheers,
Reply all
Reply to author
Forward
0 new messages