Skip to content

Conversation

@gemenerik
Copy link
Member

@gemenerik gemenerik commented Mar 19, 2025

In ramp examples where motors are gradually ramped, the supervisor assumes the drone is flying and requires continuous updated setpoints. Previously, a single zero setpoint was sent before sleeping, which leads to supervisor intervention due to missing regular setpoints. Now, zero setpoints are continuously sent for 3 seconds (after which the drone can be safely assumed to be landed), preventing locking.

Currently, this does not directly check with the supervisor if the drone has landed. Investigating a way to do this revealed that it is not straightforward. In the client, we check the supervisor states through a bitfield check, but there is no direct and easy way to access this information from the library. I will open a new issue to propose adding supervisor state reading functionality to the library, making it easier to access this information directly.

Fixes https://github.com/orgs/bitcraze/discussions/1852

In ramp examples where motors are gradually ramped, the supervisor assumes the drone is flying and requires continuous updated setpoints. Previously, a single zero setpoint was sent before sleeping, which leads to supervisor intervention due to missing regular setpoints. Now, zero setpoints are continuously sent for 3 seconds, and the drone is considered landed, preventing locking.

Currently, this does not directly check with the supervisor if the drone has landed. Investigating a way to do this revealed that it is not straightforward. In the client, we check the supervisor states through a bitfield check, but there is no direct and easy way to access this information from the library. I will open a new issue to propose adding supervisor state reading functionality to the library, making it easier to access this information directly.
Re-added a slightly modified comment explaining that sleeping before closing the link ensures the last packet is sent, as the message queue is not flushed before closing. While it’s somewhat arbitrary that this information is only found in this example, it’s still valuable to have it documented somewhere. In practice, we don’t care as much about this delay anymore since the new method’s delay is more focused on the setpoint sending loop rather than guaranteeing message delivery, but the comment is still worth keeping.
Copy link
Member

@ArisMorgens ArisMorgens left a comment

Choose a reason for hiding this comment

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

Looks good!

@gemenerik gemenerik merged commit db51fc2 into master Mar 19, 2025
1 check passed
@gemenerik gemenerik deleted the rik/ramp_supervisor_fix branch March 19, 2025 15:36
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.

3 participants