Skip to content

New science - #72

Merged
codeflight1 merged 6 commits into
mainfrom
new-science
Aug 3, 2026
Merged

New science#72
codeflight1 merged 6 commits into
mainfrom
new-science

Conversation

@codeflight1

Copy link
Copy Markdown
Contributor

No description provided.

@ConnorNeed
ConnorNeed requested a review from Copilot August 3, 2026 01:22

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

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/motor and servo commands to /science/servo, and calls /science/run_polarimeter.
  • Adds a drill/elevator status header section (height/current/percent) using /drill/status and /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 .toFixed on undefined before 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.

Comment thread src/components/panels/ScienceControlPanel.tsx Outdated
Comment thread src/components/panels/ScienceControlPanel.tsx Outdated
Comment thread src/components/panels/ScienceSensorPanel.tsx Outdated
Comment thread src/components/panels/ScienceControlPanel.tsx Outdated
@codeflight1
codeflight1 merged commit 3a9ad16 into main Aug 3, 2026
1 check passed
@codeflight1
codeflight1 deleted the new-science branch August 3, 2026 01:50
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.

4 participants