-
Notifications
You must be signed in to change notification settings - Fork 87
Consider a rclnodejs tools package #756
After working with rclnodejs for the past 12 months I believe the project should consider creating a companion tools project. Two candidate tools for this package are message-generation and a ros2 package creation/configuration similar to https://github.com/ros2jsguy/ros2pkg_configure_nodejs.
I mention message-generation as a separate tool, as I can see benefit of message-generation as a global cli tool, e.g.,
generate-ros-messages <users-nodejs-package>
While rclnodejs includes a message generation script it is not simple to use for users that lack a deep knowledge of the rclnodejs architecture. With a tools package installed globally the user could quickly access the message-generation script when needed (e.g., user uses rcl.createMessageObject('myfoomsg') which has not yet been installed from a ros2 pkg). Presently issue #750 recommends improving message-generation documentation and proposes a node package-script. But for the package-script to be simple to use it is best installed as a global binary which is counter to how rclnodejs will typically be installed (i.e., installed as a package dependency).
The 2nd tool mentioned scaffolds a node package on top of a ROS2 package. I'm not advocating directly integrating such a tool but rather to consider a similar tool that will simplify the creation of proper ROS2 nodejs packages that can participate in the ROS2 ecosystem. The benefits would include the ability to include a ROS2 nodejs package in a general ROS2 workspace, traditional ROS2 package distribution and installation, and the ability to be executed from single and multi-node launch descriptions.
Thoughts?
All reactions
-
👍 1
Replies: 3 comments 9 replies
Some comments:
-
For the generation of messages: normally, the ROS2 client has a stand-alone project that could generate the messages based on its language, e.g. rosidl_python for Python and rosidl_generator_ada for Ada, meanwhile, some projects choose to integrate it into its client as part of its functionalities, e.g. rclnodejs and ros2_java. To facilitate the developers that they could choose which kind of message to generate, one case is when a new message is added, so we'd better enhance the capabilities, like the aim of Improve message generation experience #750 . Unlike C++, JavaScript is sort of dynamic language, so we could generate the messages during run time, which I think it's simpler than having two stand alone projects and developers have to manually create a project to generate the message bindings.
Edit: I may misunderstand, a global binary is fine I think. -
The tool you mentioned is definitely needed and it will power the rclnodejs to permeate into the ROS2 ecosystem. ada4ros2 has already have some initial integrations, please check out https://github.com/ada-ros/ada4ros2#testing-your-installation
All reactions
re. #2 when I started participating on rclnodejs about 12 months I felt it would not be too big a leap to extend rclnodejs with additional tools for JS developers to achieve parity with the C++ and Python ROS dev environments. In previous comments I referenced the experimental project, ros2pkg_configure_nodejs package, a ros2cli extension that overlays and configures a nodejs-rclnodejs resources onto an existing ROS2 package directory. What I believe future ros-nodejs developers would appreciate is tooling that will create a full ROS package preconfigured with nodejs-rclnodejs. Such a tool could be accessed from either the ros2 commandline, e.g., ros2 pkg create-nodejs <pkg-name>, and also from a custom nodejs cli tool, e.g., create-rosjs-package <package-name>. And when the ros2cli team opens up the app to support additional build-types it will be a small work to adapt our tools to fit in. But for the near future it would not be too much additional work to implement such a tool based on the ros2pkg_configure_nodejs. Based on your insight and feedback, I can implement an initial version on ros2jsguy account for evaluation. And once we have decided how we want to organize tools then move the project over.
All reactions
If we own an organization, I think ros2_nodejs is a proper name for the org, but considering we are under RWT, I prefer we follow the naming convention of ROS2 upstream, which is rcl + <language name> for the clients. What's your opinion about the name of your ros2pkg_configure_nodejs if we create a new repo for it under RWT.
All reactions
-
👍 1
I prefer we follow the naming convention of ROS2 upstream, which is rcl + for the clients. What's your opinion
+1
All reactions
Status: I have working version of a cli tool (unix only atm) that will create a ROS2-nodejs package. The tool can be run from either the ros2 cli or from a shell commandline.
example from ros2 cli:
> ros2 pkg -h
> ros2 pkg create_nodejs MyJSRobot --typescript
Question: As an alternative to running this tool from the ros2 cli, a developer can run it from a shell commandline. What would you think of a top-level command with subcommands such as:
> rclnodejs -h
> rclnodejs create-package myJSRobot
> rclnodejs generate-messages
> rclnodejs generate-example
One way this can work is we create a new node pkg, e.g., rclnodejs-tools, that a user will install globally, e.g., npm i -g rclnodejs-tools. From there the user can run rclnodejs -h to view available commands and options. We can then extend this package with commandline utilities as needed over time.
This weekend I'll commit a working example that we can test drive and assess.
Thoughts?
All reactions
+1 An independent node package seems more suitable for this scenario and about the name
- For the npm package:
rclnodejs-cli - For the command, I think
rclnodejsis good
All reactions
Hi @minggangw and @wayneparrott,
I have got @minggangw's email and let him have the full authority of organization to expand RWT ros2 projects. So feel free to move on as you discussed. Sorry for noticing the situation late. ;)
And
Hello @mvollrath!
Sorry for staying in silence for a long time and thank you for keeping RWT active. I have been dragged away from the robotics projects due to the life of working in non-robotics company. 😢 I just wanted to let you know that @minggangw is now promoted as another owner to expand rclnodejs project. As you have been seeing the organization, he has been developing and maintaining the project more than 2 years already and it seems like he needs more access to the organization.
Thanks you all and let me know if you need me. Recently, it became really hard to follow up the all issues. So, it would be great if you can reach me via e-mail.
Best,
Jihoon
All reactions
-
👍 3
We have created the rclnodejs-cli project. Please direct future discussions there.