npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gov.nasa.jpl.honeycomb/ros-transform-tracker

v0.0.6

Published

Helper class for tracking updates to ROS node transforms over time.

Readme

ros-transform-tracker

Package for tracking the state of ros transform data from the /tf and /tf_static ros topics over time, extracting transform information in different frames, and looking back to find transform positions at different points in time.

Use

import { RosTransformTracker } from '@gov.nasa.jpl.honeycomb/ros-transform-tracker';

const tracker = new RosTransformTracker();
ws.subscribe('/tf', msg => tracker.applyMessage(msg, '/tf'));
ws.subscribe('/tf_static', msg => tracker.applyMessage(msg, '/tf_static'));

// get the local transform of "base_link" in "world"
const localTransform = new Matrix4().identity();
tracker.getTransformInFrame('base_link', 'world', localTransform);

// Apply the transform message to the given object in world space
const pointCloud;
const pcMessage;
tracker.applyMessageInFixedFrame(pointCloud, pcMessage.header, pcMessage.transform);

API

Functions

compareTimeStamps

compareTimeStamps( a : RosTimeStamp, b : RosTimeStamp ) : void

Returns a number > 0 if a is larger than b, 0 if they're equal, a negative number if a is less than b.

getInFrame

getInFrame(
	toTransform : RosFrame, 
	rosFrame : RosFrame, 
	posOut : Vector3, 
	rotOut : Vector4
) : void

Gets the position and orientation of frame rosFrame in toTransform.

RosTransformTrackerBase

An abstract base class for tracking and extracting ros transforms over time.

reset

reset( resetStatic : Boolean = true ) : void

Reset all the transform information to start from scratch. If resetStatic is true then static frames are also reset.

applyMessage

applyMessage( msg : RosTfMessage, topic : '/tf' | '/tf_static' ) : void

Apply a tf message to the tracked transforms. If the message timestamp is earlier than the last applied message to a certain transform then it is skipped.

getTransformInRootFrame

getTransformInRootFrame(
	name : string, 
	matrix : Matrix4, 
	time : RosTimeStamp | null = null
) : Boolean

Set "matrix" to the transform of the given frame relative to the root at the requested time. Returns true if the frame can be derived, false otherwise.

getTransformInFrame

getTransformInFrame(
	fromFrame : string, 
	toFrame : string, 
	matrix : Matrix4, 
	time : RosTimeStamp | null = null
) : Boolean

Matrix is a transform matrix relative to the frame called fromFrame. matrix is modified to be relative to the frame called toFrame. If time is provided then it is relative to those frames at that given time which is derived by looking back through the available frames.

Returns false if the requested frames could not be located in the available lookback transform messages.

getWorldPoseAtTime

getWorldPoseAtTime(
	name : String, 
	time : RosTimeStamp, 
	outPos : Vector3, 
	outRot : Vector4
) : Boolean

Outputs the position and rotation of the frame with the given name at the given ROS time. The position data is put on the outPos object and rotation on outRot. The x, y, z, and w (for rotation) fields will be added if they're not available.

Returns false if the time frame could not be found. True if it was found successfully.

getParentName

getParentName( name : String ) : String | null

Returns the name of te parent of the provided frame. Returns null if the frame does not exist or it has no parent.

seekBack

seekBack( cb : Function ) : void

Overrideable function that should iterate over the frames back in time starting at the last applied message passing an object that looks like so into the callback function cb:

{
    '/tf' : RosTfMessage,
    '/tf_static : RosTfMessage
}

If cb returns true the iteration should stop.

RosTransformTracker

Transform tracker that retains a buffer of tf and tf_static ros messages over time so they can be used to derive the latest position of a ros frame.

extends RosTransformTrackerBase

constructor

constructor( bufferMs : Number = 10000 ) : void

As well as the name of the root fixed frame to provide transforms relative to a buffer in milliseconds is provided so we know how long to keep data around.

applyMessage

applyMessage( msg : RosTfMessage, topic : '/tf' | '/tf_static' ) : void

Override of RosTransformTrackerBase.applyMessage that

seekBack

seekBack( cb : Function ) : void

Override of RosTransformTrackerBase.seekBack that iterates over the the stored messages from latest to earliest.

reset

reset( resetStatic : null, cb : Function ) : void

Override of RosTransformTrackerBase.reset that clears the saved messages as well as the transforms.

RosTimeStamp

secs

secs : Number

nsecs

nsecs : Number

sec

sec : Number

nsec

nsec : Number

RosFrame

position

position : Array<Number>

orientation

orientation : Array<Number>

translation

translation : Array<Number>

rotation

rotation : Array<Number>