Add GPS acquisition check for home position retrieval#1016
Add GPS acquisition check for home position retrieval#10161Blademaster merged 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
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_gpsboolean 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.
220ac16 to
93724d2
Compare
There was a problem hiding this comment.
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.
No description provided.