Skip to content

feat(pj_base): add absolute time spine (Timepoint/Duration + fromRaw/toRaw)#123

Merged
facontidavide merged 2 commits into
mainfrom
feat/time-in-pj-base
Jun 13, 2026
Merged

feat(pj_base): add absolute time spine (Timepoint/Duration + fromRaw/toRaw)#123
facontidavide merged 2 commits into
mainfrom
feat/time-in-pj-base

Conversation

@facontidavide

Copy link
Copy Markdown
Contributor

What

Adds pj_base/include/pj_base/time.hpp — the absolute time vocabulary one lossless step above the int64-ns PJ::Timestamp:

  • Timepoint (sys_time<nanoseconds>, Unix epoch) and Duration (nanoseconds)
  • fromRaw / toRaw / fromRawRange — the only sanctioned crossing between the int64 spine and the chrono world

Covered by a new time_spine_test (registered in PJ_BASE_TESTS).

Why

These types previously lived in the PlotJuggler application (pj_runtime/Time.h), above pj_base, so lower layers couldn't name absolute time without depending on the app:

  • pj_scene3d_core re-declared structurally-identical shadow TimePoint / Duration typedefs just to stay app-free
  • pj_datastore (Level 0) couldn't reach the fromRaw/toRaw seams at all

Hosting the spine in the Level-0 SDK lets every layer share one vocabulary. Display-relative time (the Qwt-axis / PlaybackEngine coordinate) is an app-presentation policy and stays in the application.

Compatibility

  • Header-only (constexpr / using), depends only on pj_base/types.hpp.
  • Additive, no ABI changeabidiff baseline unaffected (no symbols emitted into the canary).
  • Version intentionally not bumped in this PR — left for the maintainer to set at release.

License

Header content originates from the application's MPL-2.0 pj_runtime/Time.h; relicensed Apache-2.0 here by the copyright holder to match the SDK.

🤖 Generated with Claude Code

…toRaw)

Introduce pj_base/time.hpp: the absolute time vocabulary one lossless step above the int64-ns PJ::Timestamp — Timepoint (sys_time<ns>), Duration, and the fromRaw/toRaw/fromRawRange seams between the int64 spine and the chrono world.

These types previously lived in the application (pj_runtime/Time.h), above pj_base, so lower layers could not name absolute time without depending on the app: pj_scene3d_core re-declared structurally-identical shadow typedefs and pj_datastore could not reach the seams at all. Hosting the spine in the Level-0 SDK lets every layer share one vocabulary. Display-relative time (the Qwt-axis / playback coordinate) is an app-presentation policy and stays in the application.

Header content originates from the app's MPL-2.0 pj_runtime/Time.h and is relicensed Apache-2.0 here by the copyright holder to match the SDK. Header-only (constexpr/using), depends only on pj_base/types.hpp; additive with no ABI change (abidiff baseline unaffected). Covered by time_spine_test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@facontidavide

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	pj_base/CLAUDE.md
#	pj_base/CMakeLists.txt

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in commit 2610610. There were two conflicting files:

  • pj_base/CLAUDE.md: kept the time.hpp entry from this branch while adopting the updated builtin object counts (16 structs / 17 enum values / 15 codecs) from main's PosesInFrame addition.
  • pj_base/CMakeLists.txt: kept both tests/time_spine_test.cpp (this branch) and tests/poses_in_frame_codec_test.cpp (from main).

@facontidavide facontidavide merged commit 8f485e5 into main Jun 13, 2026
4 checks passed
@facontidavide facontidavide deleted the feat/time-in-pj-base branch June 13, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants