New science - #72
Merged
Merged
Conversation
ConnorNeed
approved these changes
Aug 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Science UI panels to match a new ROS topic/message layout, splitting science sensor telemetry into separate ADC/CO₂/temperature streams and refactoring science motor/servo controls to publish to new science-specific command topics while also surfacing drill/elevator status.
Changes:
- Science sensor chart now switches between
/science/adc(multi-channel ADC) and/science/co2(UInt16) and displays DHT22 temperature/humidity from/science/temp. - Science control panel now publishes motor commands to
/science/motorand servo commands to/science/servo, and calls/science/run_polarimeter. - Adds a drill/elevator status header section (height/current/percent) using
/drill/statusand/elevator/status.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/components/panels/ScienceSensorPanel.tsx | Reworks sensor plotting and “latest value” display to use new science topics/types (ADC/CO₂/DHT22). |
| src/components/panels/ScienceControlPanel.tsx | Refactors motor/servo command publishing and adds drill/elevator status UI and subscriptions. |
Suppressed comments (3)
src/components/panels/ScienceControlPanel.tsx:234
- This will throw on initial render for the same reason as the drill current line:
elevator?.output_current.toFixed(2)can attempt to call.toFixedonundefinedbefore the first status message arrives.
<span className='right' style={{ paddingRight: '20px' }}>Elevator Current: <span className='drill-reading'>{elevator?.output_current.toFixed(2)}</span> A</span>
src/components/panels/ScienceControlPanel.tsx:235
- Same precedence issue as the drill percent line:
(elevator?.output_percent ?? 0 * 100)only scales the fallback. Coalesce first, then multiply.
<span className='right'>Elevator Percent: <span className='drill-reading'>{(elevator?.output_percent ?? 0 * 100).toFixed(0)}</span>%</span>
src/components/panels/ScienceSensorPanel.tsx:230
- Use strict equality (
===) here as well for consistency and to avoid coercion edge cases.
<LineChart
data={selectedSensor == 'co2' ? co2 : adc}
margin={{ top: 10, right: 20, bottom: 5, left: 0 }}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.