How to use the rosbag.TimeUtil.areSame function in rosbag

To help you get started, we’ve selected a few rosbag examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cruise-automation / webviz / packages / webviz-core / src / components / MessageHistory / synchronizeMessages.js View on Github external
function itemsMatchingStamp(
  stamp: Time,
  itemsByPath: MessageHistoryItemsByPath,
  getHeaderStamp?: (itemMessage: Message) => ?Time
): ?MessageHistoryItemsByPath {
  const synchronizedItemsByPath = {};
  for (const path in itemsByPath) {
    let found = false;
    for (const item of itemsByPath[path]) {
      const thisStamp = getHeaderStamp
        ? getHeaderStamp(item.message)
        : get(item.message, ["message", "header", "stamp"]);
      if (thisStamp && TimeUtil.areSame(stamp, thisStamp)) {
        found = true;
        synchronizedItemsByPath[path] = [item];
        break;
      }
    }
    if (!found) {
      return null;
    }
  }
  return synchronizedItemsByPath;
}
github cruise-automation / webviz / packages / webviz-core / src / components / MessageHistory / synchronizeMessages.js View on Github external
const matchingMessage = messages[topic].find(({ message }) => {
      const thisStamp = get(message, ["header", "stamp"]);
      return thisStamp && TimeUtil.areSame(stamp, thisStamp);
    });
    if (!matchingMessage) {

rosbag

`rosbag` is a node.js & browser compatible module for reading [rosbag](http://wiki.ros.org/rosbag) binary data files.

Apache-2.0
Latest version published 1 year ago

Package Health Score

63 / 100
Full package analysis

Similar packages