Adds Reflection & Schema capability to Copper with a small debug session demo #793
Conversation
| }; | ||
| Ok(Self { | ||
| board, | ||
| board: spin::Mutex::new(board), |
There was a problem hiding this comment.
I am not worried about that we need to totally nuke it away with resources instead of this horror.
| #[reflect(ignore)] | ||
| last_lq: Option<LinkStatistics>, | ||
| #[reflect(ignore)] | ||
| last_rc: Option<RcChannels>, |
There was a problem hiding this comment.
this is HW so we won't have any state in replay anyway, only a few key frames, we can improve that if necessary when needed
| Tx::Id: Send + Sync + 'static, | ||
| Rx::Id: Send + Sync + 'static, | ||
| { | ||
| #[reflect(ignore)] |
There was a problem hiding this comment.
let's go one level deeper if necessary in the future. it is ok that we cut introspection here.
| Tx: BridgeChannelSet + 'static, | ||
| Rx: BridgeChannelSet + 'static, | ||
| Tx::Id: core::fmt::Debug + Send + Sync + 'static, | ||
| Rx::Id: core::fmt::Debug + Send + Sync + 'static, |
There was a problem hiding this comment.
introspection comes with multithreading cost
| #[reflect(ignore)] | ||
| pending_requests: MspRequestBatch, | ||
| #[reflect(ignore)] | ||
| tx_buffer: HeaplessVec<u8, TX_BUFFER_CAPACITY>, |
There was a problem hiding this comment.
same as previously. let's cut here the invasiveness and go deeper as needed
| pub struct Lewansoul { | ||
| port: Box<dyn SerialPort>, | ||
| #[reflect(ignore)] | ||
| port: Mutex<Box<dyn SerialPort>>, |
There was a problem hiding this comment.
will never lock but got dragged in by the introspection. If this becomes an issue we can do a pass on it later.
| _marker: PhantomData<P>, | ||
| #[reflect(ignore)] | ||
| _marker: PhantomData<fn() -> P>, | ||
| #[reflect(ignore)] |
| pub struct CuGStreamer<const N: usize> { | ||
| #[reflect(ignore)] | ||
| pipeline: Pipeline, | ||
| #[reflect(ignore)] |
| task: Arc<Mutex<T>>, | ||
| #[reflect(ignore)] | ||
| output: Arc<Mutex<CuMsg<O>>>, | ||
| #[reflect(ignore)] |
There was a problem hiding this comment.
we will see later to improve the introspectability
| /* move .text to start /after/ the boot info */ | ||
| _stext = ADDR(.start_block) + SIZEOF(.start_block); | ||
|
|
||
| SECTIONS { |
There was a problem hiding this comment.
This is needed because this is the first time we use this section and it was initialized on top of the init one Oo
| critical_section::set_impl!(BaremetalCriticalSection); | ||
|
|
||
| #[cfg(not(feature = "std"))] | ||
| unsafe impl critical_section::Impl for BaremetalCriticalSection { |
There was a problem hiding this comment.
Something unrelated regressed here, I don't get it TBH.
| derive_more = { version = "2.0", features = ["full"] } | ||
| paste = { version = "1.0.15", default-features = false } | ||
| bevy_reflect = { version = "0.18.0", default-features = false, features = [ | ||
| "auto_register_inventory", |
There was a problem hiding this comment.
this is suspect, I am checking this flag out
|
I'll make a documentation pass on another PR as it will be linked to the feature flag etc. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b165b50f0d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| family: String, | ||
| bits_corrected: usize, | ||
| tagsize: f64, | ||
| fx: f64, | ||
| fy: f64, |
There was a problem hiding this comment.
Avoid duplicating AprilTag tunables outside
tag_params
These reflected fields introduce a second source of truth for camera/tag parameters, but detection still consumes the hidden tag_params struct in process, so edits made through reflected_task_mut will not affect pose estimation and can leave introspection output inconsistent with runtime behavior. This is user-visible in debug sessions that attempt live tuning, because the reflected values appear updated while the detector continues using stale calibration values.
Useful? React with 👍 / 👎.
| fn type_path() -> &'static str { | ||
| "cu29_runtime::simulation::CuSimSrcTask" | ||
| } |
There was a problem hiding this comment.
Include generic parameter in
CuSimSrcTask type path
This TypePath implementation erases T, so different concrete simulation source tasks (for different payload types) all register under the same reflected path even though register_reflect_types registers each concrete task type. In missions with multiple simulated source payloads, schema dumps and any type-path based lookup become ambiguous because multiple distinct registrations share cu29_runtime::simulation::CuSimSrcTask.
Useful? React with 👍 / 👎.
Summary
Related issues
Changes
Testing
just std-cijust lintcargo +stable nextest run --workspace --all-targetsChecklist
Breaking changes (if any)
Additional context