Skip to content

Added Field metadata #1033

Merged
gbin merged 14 commits into
masterfrom
gbin/field_metadata
Apr 15, 2026
Merged

Added Field metadata #1033
gbin merged 14 commits into
masterfrom
gbin/field_metadata

Conversation

@gbin

@gbin gbin commented Apr 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

This is to improve the rendering of values, preserve the units etc on the debug API.

Related issues

  • Closes #

Changes

Testing

  • just fmt
  • just lint
  • just test
  • optional full just std-ci (if std/runtime paths are impacted)
  • optional full just nostd-ci (if embedded/no_std paths are impacted)
  • Other (please specify):

pro-tip: just with no parameters in the root defaults to just fmt, just lint, and just test.

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

Additional context

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates Copper’s debug/introspection pipeline to preserve semantic metadata (time vs duration, quantities with units, geodetic coordinates) so the remote debug API can render values more accurately.

Changes:

  • Introduces richer debug field descriptors/semantics in cu29-traits and generates output + state schemas in the remote debug server using reflect/type registration.
  • Splits CuTime into a dedicated timestamp type (no longer an alias of CuDuration) and updates call sites accordingly.
  • Adds GeodeticPosition and migrates GNSS payloads/call sites from {latitude,longitude} to position, including logviz + example updates.

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
examples/cu_rp_balancebot/src/resim.rs Adjusts replay clock syncing for new CuTime semantics.
examples/cu_gnss_ublox_demo/src/tasks.rs Switches GNSS fix formatting to position.{lat,lon}_degrees() helpers.
examples/cu_flight_controller/src/tasks/vtx.rs Uses new GNSS position accessors for OSD display.
examples/cu_flight_controller/src/tasks/gnss.rs Logs GNSS coordinates via position and removes degree import.
examples/cu_flight_controller/src/sim_support.rs Refactors sim GNSS shared state visibility; populates fix position.
examples/cu_flight_controller/src/sim.rs Moves sim GNSS/battery setters into sim binary; re-homes GNSS tests with a lock.
examples/cu_flight_controller/python/print_gnss_from_log.py Updates Python log reader for payload.position.{latitude,longitude}.
examples/cu_flight_controller/justfile Adds resim-debug alias target.
examples/cu_flight_controller/copperconfig.ron Enables mixer task logging in the example configuration.
examples/cu_flight_controller/README.md Documents just resim-debug.
examples/cu_caterpillar/src/resim.rs Updates replay/keyframe timestamp handling to use CuTime.
examples/cu_caterpillar/src/determinism_test.rs Updates determinism test clock syncing to CuTime::as_nanos().
examples/cu_bridge_test/src/resim.rs Updates replay clock extraction/signatures to use CuTime.
core/cu29_value/src/lib.rs Hash/serde unexpected handling for Value::CuTime now uses as_nanos().
core/cu29_value/src/de.rs Deserializer visits CuTime as u64 via as_nanos().
core/cu29_units/src/lib.rs Adds debug scalar registrations for SI wrapper types (quantity + unit semantics).
core/cu29_units/Cargo.toml Adds cu29-traits dependency to support debug scalar registration types.
core/cu29_traits/src/lib.rs Adds DebugFieldDescriptor/kind/semantics and updates TaskOutputSpec to expose payload type path via fn.
core/cu29_runtime/src/remote_debug.rs Reworks schema endpoints to emit structured field catalogs + metadata descriptors and adds state field catalogs.
core/cu29_runtime/src/reflect.rs Ensures TypePath exists without reflect (incl. primitives) and adds a test.
core/cu29_runtime/src/monitoring.rs Adjusts timestamp formatting call site for new time conversion semantics.
core/cu29_runtime/src/lib.rs Adds extern crate self as cu29 for proc-macro generated paths.
core/cu29_runtime/src/debug.rs Exposes app()/app_mut() accessors on debug session wrapper.
core/cu29_runtime/src/curuntime.rs Updates loop rate limiter tests to use CuTime::from_nanos.
core/cu29_runtime/Cargo.toml Adds optional cu29-units for remote-debug schema/semantics and enables its reflect feature.
core/cu29_reflect_derive/src/lib.rs Makes the non-reflect Reflect derive emit TypePath impls (unless opted out).
core/cu29_reflect_derive/Cargo.toml Adds syn/quote/proc-macro2 dependencies for the derive implementation.
core/cu29_logviz/tests/payload_as_components.rs Adds coverage for logging GeodeticPosition as rerun components.
core/cu29_logviz/tests/auto_dispatch.rs Extends auto-dispatch tests to include GeodeticPosition.
core/cu29_logviz/src/lib.rs Adds GeodeticPosition logging + auto-dispatch support.
core/cu29_export/src/logstats.rs Updates option-time extraction to use CuTime instead of CuDuration.
core/cu29_derive/src/lib.rs Changes generated TaskOutputSpec to use TypePath::type_path instead of stringifying types.
core/cu29_clock/src/lib.rs Introduces real CuTime type (timestamp) and debug scalar registrations for time/duration kinds.
components/sources/cu_rp_encoder/src/lib.rs Switches encoder interrupt TOV storage from CuDuration to CuTime.
components/sources/cu_gnss_ublox/src/protocol.rs Populates GNSS fix position from decoded degrees and removes direct lat/lon fields.
components/payloads/cu_spatial_payloads/tests/rerun_components.rs Adds rerun component emission test for GeodeticPosition.
components/payloads/cu_spatial_payloads/src/rerun_components.rs Implements rerun AsComponents for GeodeticPosition via GeoPoints.
components/payloads/cu_spatial_payloads/src/lib.rs Adds GeodeticPosition payload type and aligns no_std/core usage.
components/payloads/cu_gnss_payloads/src/lib.rs Migrates GNSS fix to position: GeodeticPosition and reexports the type.
components/payloads/cu_gnss_payloads/Cargo.toml Adds dependency on cu-spatial-payloads for shared GeodeticPosition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

type Output = CuTime;

fn mul(self, rhs: CuTime) -> Self::Output {
CuTime(self as u64 * rhs.as_nanos())
Comment thread core/cu29_runtime/src/remote_debug.rs Outdated
Comment on lines +3423 to +3454
debug_field_descriptor(
"tov",
None,
"object",
"message_metadata::Tov",
None,
false,
DebugFieldKind::Struct,
vec![
debug_field_descriptor(
"tov.kind",
None,
"string",
"alloc::string::String",
None,
false,
DebugFieldKind::Scalar,
Vec::new(),
),
debug_registered_scalar_field_descriptor::<CuTime>("tov.time_ns", None, false),
debug_registered_scalar_field_descriptor::<CuTime>("tov.start_ns", None, false),
debug_registered_scalar_field_descriptor::<CuTime>("tov.end_ns", None, false),
],
),
debug_field_descriptor(
"process_time",
None,
"object",
"message_metadata::ProcessTime",
None,
false,
DebugFieldKind::Struct,
Comment thread core/cu29_runtime/src/remote_debug.rs Outdated
Comment on lines +3442 to +3519
debug_registered_scalar_field_descriptor::<CuTime>("tov.time_ns", None, false),
debug_registered_scalar_field_descriptor::<CuTime>("tov.start_ns", None, false),
debug_registered_scalar_field_descriptor::<CuTime>("tov.end_ns", None, false),
],
),
debug_field_descriptor(
"process_time",
None,
"object",
"message_metadata::ProcessTime",
None,
false,
DebugFieldKind::Struct,
vec![
debug_registered_scalar_field_descriptor::<CuTime>(
"process_time.start_ns",
None,
true,
),
debug_registered_scalar_field_descriptor::<CuTime>(
"process_time.end_ns",
None,
true,
),
],
),
debug_field_descriptor(
"status_txt",
None,
"string",
"alloc::string::String",
None,
false,
DebugFieldKind::Scalar,
Vec::new(),
),
debug_field_descriptor(
"origin",
None,
"object",
"message_metadata::Origin",
None,
false,
DebugFieldKind::Struct,
vec![
debug_field_descriptor(
"origin.subsystem_code",
None,
"integer",
"u16",
None,
false,
DebugFieldKind::Scalar,
Vec::new(),
),
debug_field_descriptor(
"origin.instance_id",
None,
"integer",
"u32",
None,
false,
DebugFieldKind::Scalar,
Vec::new(),
),
debug_field_descriptor(
"origin.cl_id",
None,
"integer",
"u64",
None,
false,
DebugFieldKind::Scalar,
Vec::new(),
),
],
),
]
Comment on lines 103 to +136
@@ -113,7 +113,7 @@
(
id: "mixer1",
type: "tasks::QuadXMixer",
logging: (enabled: false),
logging: (enabled: true),
config: {
"motor_index": 1,
"props_out": true,
@@ -123,7 +123,7 @@
(
id: "mixer2",
type: "tasks::QuadXMixer",
logging: (enabled: false),
logging: (enabled: true),
config: {
"motor_index": 2,
"props_out": true,
@@ -133,7 +133,7 @@
(
id: "mixer3",
type: "tasks::QuadXMixer",
logging: (enabled: false),
logging: (enabled: true),
@gbin gbin force-pushed the gbin/field_metadata branch from 3ea0a68 to 21a88be Compare April 15, 2026 13:20
@gbin gbin changed the base branch from master to gbin/cutime-cuduration April 15, 2026 13:21
Base automatically changed from gbin/cutime-cuduration to master April 15, 2026 14:22
@gbin gbin merged commit fff3cf5 into master Apr 15, 2026
23 checks passed
@gbin gbin deleted the gbin/field_metadata branch April 15, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants