dartros
dartros copied to clipboard
Any plan to support ROS2?
Hi, I've worked on it occasionally, (using dart:ffi
, and package:ffigen
) but have not had much time to really invest in it. I'm just using ROS1 Melodic at work right now.
However, I've just open sourced and made visible the work that I've done at https://github.com/TimWhiting/rcldart. Please feel free to contribute. The following two issues in Dart would make the implementation and use simpler. Please upvote. https://github.com/dart-lang/sdk/issues/44768 https://github.com/dart-lang/sdk/issues/35770
The main problem right now is that you would have to remember to manually call some deallocation function, to make sure none of the c memory leaks. Since this is common in dart (dispose method of flutter widgets / etc), I'm sure we could get used to it, but it would not be very ROSy. The second github issue above is for finalizers in dart for native memory that we allocate and would be very helpful. Discussion about how the finalizers would work is in this issue: https://github.com/dart-lang/sdk/issues/45455
I've been mostly going off of the C++ implementation https://github.com/ros2/rclcpp. Starting with just the basics, any help in copying the class interfaces, and starting the dart implementation of the methods would be great. The C bindings are currently generated off of the ROS eloquent headers.
Anyways there is still a lot of work to be done. I'd also like to at one point provide a roslib layer for web compatibility implementing the same interface, but again, I don't have the time right now.
@TimWhiting Nice works !
Finalizers should be available soon, which should make ros2 bindings much easier.