Skip to content

Add GPS acquisition check for home position retrieval#1016

Merged
1Blademaster merged 2 commits intomainfrom
1015-check-gps-status-before-fetching-home-location
Feb 27, 2026
Merged

Add GPS acquisition check for home position retrieval#1016
1Blademaster merged 2 commits intomainfrom
1015-check-gps-status-before-fetching-home-location

Conversation

@1Blademaster
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 26, 2026 19:46
@1Blademaster 1Blademaster linked an issue Feb 26, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds a GPS acquisition check to prevent attempting to retrieve the home position when the drone has not yet acquired a GPS fix. The implementation tracks whether GPS has ever been available using a flag set when GPS_RAW_INT messages indicate a fix, and returns an early error from getHomePosition when GPS has not been acquired.

Changes:

  • Added has_had_gps boolean flag to Drone class to track GPS acquisition status
  • Modified GPS_RAW_INT message handler to set flag when GPS fix is detected
  • Added early return in getHomePosition() when GPS has not been acquired
  • Updated JavaScript error handling to silently ignore GPS-not-acquired errors using sentinel value -1

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
radio/app/drone.py Added has_had_gps flag initialization and GPS_RAW_INT message handler to track GPS acquisition
radio/app/controllers/navController.py Added GPS check with early return in getHomePosition before attempting to retrieve home position
gcs/src/redux/middleware/socketMiddleware.js Added special handling to suppress error notifications when home position fails due to missing GPS

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

Comment thread gcs/src/redux/middleware/socketMiddleware.js Outdated
Comment thread radio/app/controllers/navController.py Outdated
Comment thread radio/app/drone.py Outdated
Comment thread radio/app/drone.py Outdated
Comment thread radio/app/controllers/navController.py Outdated
Comment thread radio/app/controllers/navController.py Outdated
@1Blademaster 1Blademaster force-pushed the 1015-check-gps-status-before-fetching-home-location branch from 220ac16 to 93724d2 Compare February 26, 2026 20:32
@1Blademaster 1Blademaster requested a review from Copilot February 26, 2026 20:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread gcs/src/components/layout.jsx
@1Blademaster 1Blademaster requested a review from a team February 26, 2026 20:59
@1Blademaster 1Blademaster merged commit e4a8a64 into main Feb 27, 2026
8 checks passed
@1Blademaster 1Blademaster deleted the 1015-check-gps-status-before-fetching-home-location branch February 27, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check GPS status before fetching home location

3 participants