-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new message bindings that uses rosidl_generator_c #774
base: develop
Are you sure you want to change the base?
feat: new message bindings that uses rosidl_generator_c #774
Conversation
… to generate typesupport gypi
This reverts commit 5a29f19.
…t return 0 or false if the type cannot be converted
now back to uses predefined pattern of `<pkg_name>__rosidl_generator_c`. The problem that using cmake fixes looks to be a non-issue as those messages never work with ros2 anyway, see https://github.com/koonpeng/ros_msg_with_diff_pkg_name
Wow, that's really a BIG progress and optimization. We can gain a lot if we can use c library directly, the performance improvement you mentioned is signification! I will read the code carefully in the following days, thanks! |
This introduces is a new message binding system that uses native c code from
rosidl_generator_c
that I have been experimenting with. As this is a pretty big change to the core systems, it is turned off by default. Right now it's working for our use cases which most consist of pub/sub and service clients, I also managed to get it working on node v14 as it does not use ref.Below description copied from the README gives a more detailed explaination on the new bindings.
In order to use the new bindings, you must either:
set RCLNODEJS_USE_ROSIDL=1 environment variable.
or
add a
.npmrc
file in your project directory withrclnodejs_use_rosidl=true
.The new experimental message bindings uses ros interfaces to perform serialization. The main advantage of the new bindings is better performance, it is ~25% faster for large messages (1mb) and ~800% faster for small messages (1kb). It is also safer as memory is managed by v8, you will no longer get undefined behaviors when you try to reference a message outside the subscription callbacks. Also as a result of moving to v8 managed memory, it fixes some memory leaks observed in the current bindings.
The downside is that the new bindings is not API compatible, it does a number of things differently.
std_msg
wrappers are not supported.do other house keeping.