-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
move hover_thrust_estimator to new module (mc_hover_thrust_estimator) #14182
Conversation
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.
Thanks a lot! I'll make the required modifications and it should be good to go.
_armed = (vehicle_status.arming_state == vehicle_status_s::ARMING_STATE_ARMED); | ||
} | ||
|
||
if (_armed && !_landed) { |
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.
We can add a check here to start the estimator only when the the drone is above 1m AGL or x seconds after !_landed.
|
||
_hover_thrust_ekf.predict(dt); | ||
|
||
if (PX4_ISFINITE(local_pos.az) && PX4_ISFINITE(local_pos_sp.thrust[2])) { |
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.
We could even take the body thrust from the controller outputs and rotate it in local frame so the estimator will be able to run in all modes.
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 was tempted to do that immediately, but thought it might be safer to first reproduce things as closely as possible outside of mc_pos_control.
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.
Note: be aware of the optional battery thrust scaling (MC_BAT_SCALE_EN).
60eb339
to
d240d34
Compare
d240d34
to
7dc98a3
Compare
7dc98a3
to
b03ba4d
Compare
* (EXPERIMENTAL) Set true to use the value computed by the hover thrust estimator | ||
* | ||
* @boolean | ||
* @max 0 |
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.
@dagar Does that work? Since this is experimental, I would like to have to click on "force save" to enable it.
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.
Let's change the category.
@PX4/testflights Could you please test this PR on a multicopter in altitude/position and auto mode please?
|
tested on pixhawk4 v5 f-450 Position Mode: Good. - Procedure Notes: Log: https://review.px4.io/plot_app?log=38b3ef8f-1e04-4464-8220-c867c850645c |
Tested on PixRacer V4Tested Modes Process Logs: https://review.px4.io/plot_app?log=f484d2ef-2e59-442e-aa05-c0ecff3fdf36 Tested on CUAV nano V5Tested Modes Process Log: https://review.px4.io/plot_app?log=1cf3a958-3618-4a06-9ab5-51fd66f00f38 |
Tested on NXP FMUK66 v3Modes Tested
Procedure Notes Logs Tested on Pixhawk 3 v4ProModes Tested
Procedure Notes Logs |
@dagar yes, and the failures are real. I'm currently fixing that |
Always publish an estimate even when not fusing measurements. This is required as the land detector and the position controller need to receive a hover thrust value.
local_position.z is relative to the origin of the EKF while dist_bottom is above ground
@dagar Good to be merged now, I'll update the default tuning in a separate PR. |
This is a quick PR that moves the hover_thrust_estimator (#13981) lib and mc_pos_control integration into a new standalone module (now called mc_hover_thrust_estimator for MC grouping).
Pros
Cons
To be honest after having done this I could go either way on this one.