This very basic project demonstrates how to use the ROS 2 rclnodejs client api with Electron. No bundler, e.g., Webpack, is used.
- Nodejs 12, 14-16
- npm or Yarn
- Clone this repository
git clone https://github.com/ros2jsguy/rclnodejs-electron-example
- Install JavaScript dependencies
npm install
- Rebuild rclnodejs using Electron node version
npx electron-rebuild
- Run Launch the Electron app to create a ROS 2 node, publisher and subscriber. The publisher will output a message every second. The subscriber will echo messages it receives from the publisher to stdout.
npm start
This example uses the latest Electron v16 which incorporates Node 14. We must use the rclnodejs node-16
branch to support node versions greater tha 12.x. Thus we are currently loading the rclnodejs node-16
branch directly from Github until it is published to the Npmjs repository.