Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Change time/duration deserialization to sec,nanosec by default#32

Merged
jtbandes merged 9 commits intomainfrom
jacob/ros2time
Dec 4, 2024
Merged

Change time/duration deserialization to sec,nanosec by default#32
jtbandes merged 9 commits intomainfrom
jacob/ros2time

Conversation

@jtbandes
Copy link
Copy Markdown
Member

@jtbandes jtbandes commented Dec 3, 2024

Changelog

  • [BREAKING] MessageReader now deserializes Time and Duration values as {sec,nanosec} rather than {sec,nsec}. The {sec,nsec} behavior is still available via a new timeType constructor option.

Description

Based on / supersedes / resolves #24

Bumps package version to 3.0.0 for breaking change.

Related: FG-9546, FG-9334

export type MessageReaderOptions = {
   /**
    * Select the type for deserialized `time` and `duration` values. "sec" and "nanosec" are used
    * by default in ROS 2, whereas "sec" and "nsec" originates from ROS 1 and matches
    * `@foxglove/rostime`.
    *
    * @default "sec,nanosec"
    */
   timeType?: "sec,nanosec" | "sec,nsec";
 };

const reader = new MessageReader(messageDefinition, { timeFormat: "sec,nsec" });

Copy link
Copy Markdown

@defunctzombie defunctzombie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a time to be alive.

@jtbandes jtbandes merged commit 00cfc61 into main Dec 4, 2024
@jtbandes jtbandes deleted the jacob/ros2time branch December 4, 2024 18:44
jtbandes added a commit to foxglove/rosbag2 that referenced this pull request Dec 4, 2024
### Changelog
None

### Docs

None

### Description

Based on foxglove/rosmsg2-serialization#27
In preparation for upgrading to `rosmsg2-serialization@3` for
foxglove/rosmsg2-serialization#32

- Upgrade yarn to v4
- Upgrade ESLint to v9
- Upgrade other devDependencies (will update dependencies separately)
- Add provenance attestation for npm publish
- Add dependabot
jtbandes added a commit to foxglove/rosbag2 that referenced this pull request Dec 5, 2024
### Changelog
- **[BREAKING]** Time and Duration values are now deserialized as
`{sec,nanosec}` rather than `{sec,nsec}`. The `{sec,nsec}` behavior is
still available via a new `timeType` constructor option.


### Description

- Bump rosmsg2-serialization to ^3 for
foxglove/rosmsg2-serialization#32
- Bump package version to 6.0.0
- Add MessageReaderOptions to constructor
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants