Commandline tools for the ROS2 rclnodejs client library
npm install rclnodejs-cliros2 cli extension for use with the ROS2 [rclnodejs]() client library.rclnodejs-cli package globally or alternatively use npx to run rclnodejs-cli directly from a shell.Note: Your shell environment should include ROS2.
To install rclnodejs-cli globally run the following command from a shell:
```
npm install -g rclnodejs-cli
cli with additional commands and options from this package by sourcing the install/setup.[bat,bash,ps1,sh] file.On Linux run:
```
source `
On Windows run:`
or
For more information on using an rclnodejs-cli tool from the ros2 cli see the references to tool/command user-guides below.
If rclnodejs-cli is installed globally run:
``
rclnodejs-cli -hnpx
Alternatively use as shown:``
npx rclnodejs-cli -h
The default commandline output follows:
` |/ _ \| / __|
_ _ _
_ __ ___| |_ __ ___ __| | ___ (_)___
| '__/ __| | '_ \ / _ \ / _
| | | (__| | | | | (_) | (_| | __/| \__ \
|_| \___|_|_| |_|\___/ \__,_|\___|/ |___/
|__/
Usage: rclnodejs [command] [options]
Options:
-h, --help display help for command
Commands:
create-package
generate-ros-messages Generate JavaScript code from ROS2 IDL interfaces
help [command] display help for command
``
rclnodejs-cli -h
or
npx rclnodejs-cli -h
`Example
`
rclnodejs-cli create-package -h
or
npx rclnodejs-cli create-package -h
`Commands #
create-package command ##
The rclnodejs-cli create-package command creates a hybrid ROS2-Nodejs package that can coexist and participate with other ROS2 packages in a ROS2 workspace and be run using the ROS2 launch facility. A ROS2-Nodejs package consist of a ROS2 package, specifically an ament-cmake ROS2 package, overlaid with a Nodejs package.Learn more about the create-package tool.
generate-ros-messages command ##
Generate JavaScript messages corresponding to the interfaces (.IDL)
in your ROS2 environment. Run this command from the root folder of a Nodejs package that includes rlcnodejs as a dependency. The JavaScript message files are created in the node_modules/rclnodejs/generated/` folder of the current Nodejs package.Learn more about the generate-ros-messages tool.