Skip to content

Latest commit

 

History

History
34 lines (27 loc) · 1.03 KB

README.md

File metadata and controls

34 lines (27 loc) · 1.03 KB

rclnodejs-electron-example

This very basic project demonstrates how to use the ROS 2 rclnodejs client api with Electron. No bundler, e.g., Webpack, is used.

Prerequisites:

  • Nodejs 12, 14-16
  • npm or Yarn

Getting Started

  1. Clone this repository
git clone https://github.com/ros2jsguy/rclnodejs-electron-example
  1. Install JavaScript dependencies
npm install
  1. Rebuild rclnodejs using Electron node version
npx electron-rebuild
  1. 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

Special note

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.