-
Notifications
You must be signed in to change notification settings - Fork 13.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mavlink: fix offboard velocity input #17958
Conversation
This reverts the behavior for offboard velocity setpoint. Back in v1.11, the velocity input in NED_BODY was assumed to be in the world frame but rotated by yaw to the vehicle frame. With the current state the frame is completely fixed to the body. While this might be technically correct, it doesn't seem much intuitive for multicopters and breaks the MAVSDK offboard velocity API. So as an example, with a velocity setpoint of 5 m/s forward, the drone would in - v1.11: fly forward with 5 m/s - v1.12: start to fly forward by pitching down but then descend rapidly as the forward velocity would translate to a setpoint in Z into the ground as it is pitched down. This commit restores the behavior to what we had previously.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will confuse people expecting that the velocity reference is actually in the body frame.
Doesn't this mean that we are not following the mavlink standard anymore?
It confused me but in the opposite way 😄.
I don't know what the standard exactly means but this change just reverts to what we did in the past. Users of MAVSDK will crash into the ground when upgrading from v.1.9/v1.10/v1.11 to v1.12. |
I will add the other frames back in after this PR. For now let's leave just this fix, so that we have it to cherry-pick into the point release. |
I will checkout this for now then to make my actual drone work with MAVSDK. No intention for ROS though. |
@Jaeyoung-Lim should we do the same change for the acceleration setpoint? I'm a bit confused there. I guess we don't actually support acceleration setpoints, right? We only support x,y, rates and thrust? |
@julianoes We actually do 😅 : #16498 The full list of supported offboard setpoints are documented here: http://docs.px4.io/master/en/flight_modes/offboard.html#copter-vtol |
@Jaeyoung-Lim ok nice. I'm just trying to figure out how to handle the various frames. |
Thanks for the follow up @farhangnaderi. |
This reverts the behavior for offboard velocity setpoint.
Back in v1.11, the velocity input in NED_BODY was assumed to be in the world frame but rotated by yaw to the vehicle frame. With the current state the frame is completely fixed to the body. While this might be
technically correct, it doesn't seem much intuitive for multicopters and breaks the MAVSDK offboard velocity API.
So as an example, with a velocity setpoint of 5 m/s forward, the drone
would in
This commit restores the behavior to what we had previously.
This problem was found by @farhangnaderi in https://px4.slack.com/archives/CL3LV4FUH/p1626820069036900.