Skip to content

WIP NodeJS package for keeping track of coordinate transforms (tf2's).

License

Notifications You must be signed in to change notification settings

RethinkRobotics-opensource/tf2_nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tf2_nodejs

Work In Progress

Work with rosnodejs

const rosnodejs = require('rosnodejs');
const TransformStamped = rosnodejs.require('geometry_msgs').msg.TransformStamped;

rosnodejs.initNode('/tfListener', { anonymous: true })
.then(() => {

  tf2Nodejs.configure({
    ros: rosnodejs
  });

  const buffer = new tf2Nodejs.Buffer(10);
  const listener = new tf2Nodejs.TransformListener(buffer);
  const staticTfBroadcaster = new tf2Nodejs.StaticTransformBroadcaster();
  const tfBroadcaster = new tf2Nodejs.TransformBroadcaster();
  
  const msg = new TransformStamped();
  msg.header.frame_id = 'base';
  msg.child_frame_id = 'moving_child';
  msg.transform.translation = { x: 0.5, y: 0.2, z: 0.1 };
  msg.transform.rotation = { x: 1, y: 0, z: 0, w: 0 };
  tfBroadcaster.sendTransform(msg);
  
  buffer.lookupTransform('base', 'right_hand', {secs: 0, nsecs: 0});

About

WIP NodeJS package for keeping track of coordinate transforms (tf2's).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published