Skip to content

rclnodejs v0.11.0

Compare
Choose a tag to compare
@minggangw minggangw released this 13 Dec 14:43
· 269 commits to develop since this release
df09ca4

This release has been verified with ROS 2 Eloquent Elusor by #539.

Feature Added

  • TypeScript support, #537
    • Type declaration files (*.d.ts), see types/ folder
    • dts generation script creates interfaces.d.ts, a collection of type aliases for all ROS msg and srv interfaces, including custom msg and srv files
    • Updated README with notes for working with TypeScript.
import * as rclnodejs from 'rclnodejs';
import {std_msgs} from 'rclnodejs';

async function main() {

  await rclnodejs.init();
  const node = rclnodejs.createNode('messager');
  const pub = node.createPublisher('std_msgs/msg/String', 'message');
  const timer = node.createTimer(1000, () => {
      const msg = 'hello world: ' + Date.now();
      //alternatively using type aliased messages
      // const msg: std_msgs.msg.String = {
      //  data: 'hello world (std_msg)'
      // }
    pub.publish(msg);
  });

  rclnodejs.spin(node); 
}

main();

Other

  • Removed message generation for deprecated actions