Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDynamically generate message class in JS #9
Merged
Conversation
|
With this dynamic-message-generating mechanism, when developers add or modify a message, s/he won't need to re-install (or compile) this rclnodejs module/addon. |
|
LGTM, and some small problems, thanks! |
example/publisher-example.js
Outdated
| 'use strict'; | ||
|
|
||
| const StructType = require('ref-struct'); | ||
| const ref = require('ref'); | ||
| const ffi = require('ffi'); |
This comment has been minimized.
This comment has been minimized.
rosidl_gen/message.js
Outdated
| const requireFromString = require('require-from-string'); | ||
|
|
||
| const primitiveTypes = require('../rosidl_gen/generator_primitive.js'); | ||
| const Parser = require('../rosidl_parser/rosidl_parser.js'); |
This comment has been minimized.
This comment has been minimized.
rosidl_gen/message.js
Outdated
| messageType.pkgName + '/' + messageType.msgSubfolder + '/' + messageType.msgName + '.msg'; | ||
|
|
||
| return new Promise(function(resolve, reject) { | ||
| Parser.parseMessageFile(messageType.pkgName, packagePath).then((spec) => { |
This comment has been minimized.
This comment has been minimized.
cfe8b3a
into
RobotWebTools:develop
1 check was pending
1 check was pending
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.
kenny-y commentedJun 15, 2017
Use the spec from parser to dynamically generate ROS message class in JS, assemble it with exactly the same memory layout with C++. Now it works with the first message: std_msgs/msg/String.msg
P.S. please use [squash & merge] button when merging...