@foxglove/rostime
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    @foxglove/rostime

    ROS (Robot Operating System) Time and Duration primitives and helper methods

    Introduction

    ROS (Robot Operating System) defines two primitive types for dealing with time, ros::Time and ros::Duration (see http://wiki.ros.org/roscpp/Overview/Time). These are both represented by the same data type, { sec: number; nsec: number } and serialized as a pair of 32-bit integers (seconds, then nanoseconds). This package provides a TypeScript type definition for these types and helper methods for working with ROS time and duration values.

    Usage

    import * as rostime from "@foxglove/rostime";
    
    const a = { sec: 1, nsec: 0 };
    const b = rostime.fixTime({ sec: 0, nsec: 1e9 });
    console.log(`${rostime.toString(a)} == ${rostime.toString(b)} (${rostime.areEqual(a, b)})`);

    License

    @foxglove/rostime is licensed under MIT License.

    Releasing

    1. Run yarn version --[major|minor|patch] to bump version
    2. Run git push && git push --tags to push new tag
    3. GitHub Actions will take care of the rest

    Install

    npm i @foxglove/rostime

    DownloadsWeekly Downloads

    58

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    114 kB

    Total Files

    23

    Last publish

    Collaborators

    • foxglovebot
    • amacneil