feat: new message bindings that uses rosidl_generator_c#774
Open
koonpeng wants to merge 68 commits intoRobotWebTools:developfrom
Open
feat: new message bindings that uses rosidl_generator_c#774koonpeng wants to merge 68 commits intoRobotWebTools:developfrom
koonpeng wants to merge 68 commits intoRobotWebTools:developfrom
Conversation
added 30 commits
November 16, 2020 14:07
… to generate typesupport gypi
This reverts commit 5a29f19.
…t return 0 or false if the type cannot be converted
added 26 commits
December 16, 2020 10:17
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
Member
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This introduces is a new message binding system that uses native c code from
rosidl_generator_cthat 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
.npmrcfile 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_msgwrappers are not supported.do other house keeping.