All Projects → RobotWebTools → Rclnodejs

RobotWebTools / Rclnodejs

Licence: apache-2.0
Node.js version of ROS 2.0 client

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Rclnodejs

Ros2learn
ROS 2 enabled Machine Learning algorithms
Stars: ✭ 119 (-5.56%)
Mutual labels:  robotics, ros
Grl
Robotics tools in C++11. Implements soft real time arm drivers for Kuka LBR iiwa plus V-REP, ROS, Constrained Optimization based planning, Hand Eye Calibration and Inverse Kinematics integration.
Stars: ✭ 105 (-16.67%)
Mutual labels:  robotics, ros
Webots
Webots Robot Simulator
Stars: ✭ 1,324 (+950.79%)
Mutual labels:  robotics, ros
Ros Openpose
CMU's OpenPose for ROS
Stars: ✭ 81 (-35.71%)
Mutual labels:  robotics, ros
Cleanit
Open-source Autonomy Software in Rust-lang with gRPC for the Roomba series robot vacuum cleaners. Under development.
Stars: ✭ 125 (-0.79%)
Mutual labels:  robotics, ros
Navigation
ROS Navigation stack. Code for finding where the robot is and how it can get somewhere else.
Stars: ✭ 1,248 (+890.48%)
Mutual labels:  robotics, ros
Flexbe behavior engine
Contains the behavior engine FlexBE.
Stars: ✭ 101 (-19.84%)
Mutual labels:  robotics, ros
Get Started Ros2
書籍「ROS2ではじめよう 次世代ロボットプログラミング」オンラインリソース
Stars: ✭ 65 (-48.41%)
Mutual labels:  robotics, ros
Awesome Robotic Tooling
Tooling for professional robotic development in C++ and Python with a touch of ROS, autonomous driving and aerospace.
Stars: ✭ 1,876 (+1388.89%)
Mutual labels:  robotics, ros
Robotics setup
Setup Ubuntu 18.04, 16.04 and 14.04 with machine learning and robotics software plus user configuration. Includes ceres tensorflow ros caffe vrep eigen cudnn and cuda plus many more.
Stars: ✭ 110 (-12.7%)
Mutual labels:  robotics, ros
Ev3dev Lang Java
A project to learn Java and create software for Mindstorms Robots using hardware supported by EV3Dev & the LeJOS way.
Stars: ✭ 79 (-37.3%)
Mutual labels:  robotics, ros
Dolly
🤖🐑 It's a sheep, it's a dolly, it's a following robot. Dolly was born to be cloned.
Stars: ✭ 113 (-10.32%)
Mutual labels:  robotics, ros
Diff drive
ROS nodes for controlling and monitoring a differential drive robot.
Stars: ✭ 77 (-38.89%)
Mutual labels:  robotics, ros
Rvd
Robot Vulnerability Database. An archive of robot vulnerabilities and bugs.
Stars: ✭ 87 (-30.95%)
Mutual labels:  robotics, ros
Icse Seip 2020 Replication Package
Replication package of the paper titled "How do you Architect your Robots? State of the Practice and Guidelines for ROS-based Systems" published at ICSE-SEIP 2020
Stars: ✭ 68 (-46.03%)
Mutual labels:  robotics, ros
Evo
Python package for the evaluation of odometry and SLAM
Stars: ✭ 1,373 (+989.68%)
Mutual labels:  robotics, ros
Ros2 java
Java and Android bindings for ROS2
Stars: ✭ 60 (-52.38%)
Mutual labels:  robotics, ros
Hrim
An information model for robot hardware. Facilitates interoperability across modules from different robot manufacturers. Built around ROS 2.0
Stars: ✭ 61 (-51.59%)
Mutual labels:  robotics, ros
Robotics Coursework
🤖 Places where you can learn robotics (and stuff like that) online 🤖
Stars: ✭ 1,810 (+1336.51%)
Mutual labels:  robotics, ros
Stereo dense reconstruction
Dense 3D reconstruction from stereo (using LIBELAS)
Stars: ✭ 113 (-10.32%)
Mutual labels:  robotics, ros

rclnodejs - ROS2 Client Library for JavaScript npmCoverage StatusnpmGitHub licensenodedependencies Statusnpm type definitionscode style: prettier

Branch Linux Build macOS Build Windows Build
develop Build Status macOS Build Status Build status
master Build Status macOS Build Status Build status

rclnodejs is a Node.js client library for the Robot Operating System (ROS 2). It provides a JavaScript API and tooling for ROS 2 programming. TypeScript declarations, i.e., (*.d.ts), are included to support use in TypeScript projects.

Here's an example for how to create a ROS 2 node that publishes a string message in a few lines of JavaScript.

const rclnodejs = require('rclnodejs');
rclnodejs.init().then(() => {
  const node = new rclnodejs.Node('publisher_example_node');
  const publisher = node.createPublisher('std_msgs/msg/String', 'topic');
  publisher.publish(`Hello ROS 2 from rclnodejs`);
  node.spin();
});

Documentation

Installation

Prerequisites

Before installing rclnodejs please ensure the following softare is installed and configured on your systemd:

Installing rclnodejs

Install the rclnodejs version that is compatible with your version of ROS 2 (see table below).

For the most current version of rclnodejs run:

npm i rclnodejs

To install a specific version of rclnodejs use:

npm i [email protected]
RCLNODEJS Version Compatible ROS 2 Release
0.18.1 (current) (API) Foxy Fitzroy / Eloquent Elusor
0.10.3 Dashing Diademata - Patch 4
  • Note: to install rclnodejs from GitHub: add "rclnodejs":"RobotWebTools/rclnodejs#<branch>" to your package.json depdendency section.

API Documentation

API documentation is generated by jsdoc and can be viewed in the docs/ folder or on-line. To create a local copy of the documentation run npm run docs.

Using rclnodejs with TypeScript

rclnodejs API can be used in TypeScript projects. You can find the TypeScript declaration files (*.d.ts) in the types/ folder.

Your tsconfig.json file should include the following compiler options:

{
  "compilerOptions": {
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es6"
    // your additional options here
  }
}

Here's a short rclnodejs TypeScript example:

import * as rclnodejs from 'rclnodejs';
rclnodejs.init().then(() => {
  const node = new rclnodejs.Node('publisher_example_node');
  const publisher = node.createPublisher('std_msgs/msg/String', 'topic');
  publisher.publish(`Hello ROS 2 from rclnodejs`);
  node.spin();
});

The benefits of using TypeScript become evident when working with more complex use-cases. ROS messages are defined in the types/interfaces.d.ts module. This module is updated as part of the generate-ros-messages process described in the next section.

ROS2 Interface Message Generation (important)

ROS components communicate by sending and receiving messages described by the interface definition language (IDL). ROS client libraries such as rclnodejs are responsible for converting these IDL message descriptions into source code of their target language. For this, rclnodejs provides the npm binarygenerate-ros-messages script that reads the IDL message files of a ROS environment and generates corresponding JavaScript message interface files. Additionally, the tool generates the TypeScript interface.d.ts file containing declarations for each IDL message file.

Learn more about ROS interfaces and IDL here.

In the following example rclnodejs loads a generated JavaScript message file corresponding to the ROS `std_msgs/msg/String' definition.

import * as rclnodejs from 'rclnodejs';
let stringMsgObject = rclnodejs.createMessageObject('std_msgs/msg/String');
stringMsgObject.data = 'hello world';

Maintaining Generated JavaScript Message Files

Message files are generated as a post-install step of the rclnodejs installation process. Thereafter, you will need to manually run the rclnodejs message generation script when new ROS message packages are installed for which your ROS2-nodejs project has a dependency.

Running generate-ros-messages Utility

To run the generate-ros-messages script from your Nodejs package, use the npx utility included in your Nodejs installation.

npx generate-ros-messages

The newly generated JavaScript files can be found at <yourproject>/node_modules/rclnodejs/generated/.

Contributing

Please read the Contributing Guide before making a pull request.

Thank you to all the people who already contributed to rclnodejs!

License

This project abides by the Apache License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].