0.1.8 • Published 4 years ago

@wayneparrott/rclnodejs-types v0.1.8

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

TypeScript declarations for rclnodejs

This project provides type declaration files (*.d.ts) for use when coding your ROS2 rclnodejs nodes, interfaces, publishers, subscribers and clients using TypeScript.

Installation

npm install @wayneparrott/rclnodejs-types --save-dev

Configuration

In your project tsconfig.json file, update the "typeRoots" property to include @wayneparrott/rclnodejs-types as shown below:

"typeRoots": [
    "node_modules/@wayneparrott/rclnodejs-types",
    "node_modules/@types"
]

You will also need to install the rclnodejs package separately from this project as well as the ROS2 environment:

npm i rclnodejs

See ROS2 for installation options.

Example

import * as rclnodejs from 'rclnodejs';

const node: rclnodejs.Node;
const publisher: rclnodejs.Publisher;
const logger: rclnodejs.Logger;

async function init() {
  await rclnodejs.init();

  node = rclnodejs.createNode('ExampleNode');
  logger = rclnodejs.Logging.getLogger('exampleLogger')
  logger.info('node created');

  publisher = node.createPublisher('std_msgs/msg/String', 'topic');

  node.spin();
}


init();
publisher.publish('hello world');
logger.info('published msg');
node.destroy();
rclnodejs.shutdown();
  

Recognition

  • Thanks to the rclnodejs team for their hard work in enabling JavaScript coders to be part of the Robot Operating System community.

  • Thanks to Genuitec for the CodeMix plugin for Eclipse which provides great TypeScript coding tools among its many other supported languages.

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago