Skip to content

Return GCS waypoint in the case of waypoint 255 when GCS assist enabled#6086

Merged
digitalentity merged 8 commits intoiNavFlight:masterfrom
YuxinPan:patch-2
Nov 14, 2020
Merged

Return GCS waypoint in the case of waypoint 255 when GCS assist enabled#6086
digitalentity merged 8 commits intoiNavFlight:masterfrom
YuxinPan:patch-2

Conversation

@YuxinPan
Copy link
Contributor

@YuxinPan YuxinPan commented Sep 1, 2020

This is a pull request to fix issue #3810.

For MSP query in the case of waypoint 255, if GCS assist mode is not enabled, the current position is returned to preserve compatibility. With GCS assist mode enabled, in this commit the ground control station commanded waypoint is returned, which is consistent with waypoint 255 set behavior. This is also the desired behavior to affirm users that the correct waypoint from GCS is loaded.

For MSP query in the case of waypoint 255, in this commit the ground control station waypoint is returned, which is consistent with its waypoint set behavior. This is also the desired behavior to affirm users that the correct waypoint is loaded. If GCS assist mode is not enabled, the current position is returned to preserve compatibility.
@digitalentity digitalentity added this to the 2.7 milestone Sep 1, 2020
@digitalentity
Copy link
Member

This may break existing applications that depend on WP#255 being actual position of the aircraft. An API to get the actual aircraft position should be implemented - this is on my roadmap to allow externally controlled drones (codename "robot mode")

@YuxinPan
Copy link
Contributor Author

YuxinPan commented Sep 2, 2020

This may break existing applications that depend on WP#255 being actual position of the aircraft. An API to get the actual aircraft position should be implemented - this is on my roadmap to allow externally controlled drones (codename "robot mode")

Indeed there is great potential with robotic applications. For now, what do you think of the introduction of a new special waypoint 254 to confirm the GCS assist waypoint, leaving waypoint 255 as it is for compatibility?

@digitalentity
Copy link
Member

Makes sense. To keep things safe we should also add a build-time check that NAV_MAX_WAYPOINTS is less than 254. We can use STATIC_ASSERT for that. WDYT?

Assert that NAV_MAX_WAYPOINTS is less than 254
@YuxinPan
Copy link
Contributor Author

YuxinPan commented Sep 2, 2020

Makes sense. To keep things safe we should also add a build-time check that NAV_MAX_WAYPOINTS is less than 254. We can use STATIC_ASSERT for that. WDYT?

It is certainly an appropriate check. Once it is merged I can also edit the Wiki to mention the new special waypoint.

@YuxinPan
Copy link
Contributor Author

YuxinPan commented Sep 3, 2020

Makes sense. To keep things safe we should also add a build-time check that NAV_MAX_WAYPOINTS is less than 254. We can use STATIC_ASSERT for that. WDYT?

STATIC_ASSERT added and tested.

Access current target position in any 3D-guided mode for waypoint 254
Waypoint 254 access in any 3D-guided mode
Copy link
Member

@digitalentity digitalentity left a comment

Choose a reason for hiding this comment

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

LGTM

@digitalentity digitalentity modified the milestones: 2.7, 2.6 Sep 3, 2020
@digitalentity digitalentity merged commit 5d66d81 into iNavFlight:master Nov 14, 2020
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.

2 participants