-
Notifications
You must be signed in to change notification settings - Fork 16.8k
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
Scripting: added VTOL-expo.lua for estimating MOT_THST_EXPO #23701
base: master
Are you sure you want to change the base?
Changes from all commits
489596c
6a881d2
1ec6b70
47bcba6
b86233e
e7b34a2
e2a134b
99d8fc8
bec2671
52c7927
ce3c7e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -199,8 +199,8 @@ const AP_Param::GroupInfo QuadPlane::var_info[] = { | |||||
|
||||||
// @Param: GUIDED_MODE | ||||||
// @DisplayName: Enable VTOL in GUIDED mode | ||||||
// @Description: This enables use of VTOL in guided mode. When enabled the aircraft will switch to VTOL flight when the guided destination is reached and hover at the destination. | ||||||
// @Values: 0:Disabled,1:Enabled | ||||||
// @Description: This enables use of VTOL in guided mode. When enabled the aircraft will switch to VTOL flight when the guided destination is reached and hhold position while hovering at the destination. If set to 2 then the vehicle will continue hovering if GUIDED mode is entered from a VTOL mode and is hovering. For QRTL and AUTO mode landings it will continue hovering if in the VTOL control part of the landing sequence. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
// @Values: 0:Disabled,1:Enabled,2:VTOLIfInVTOL | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe "Continue in VTOL"? |
||||||
// @User: Standard | ||||||
AP_GROUPINFO("GUIDED_MODE", 40, QuadPlane, guided_mode, 0), | ||||||
|
||||||
|
@@ -1005,6 +1005,20 @@ void QuadPlane::run_z_controller(void) | |||||
last_pidz_init_ms = now; | ||||||
} | ||||||
last_pidz_active_ms = now; | ||||||
|
||||||
#if AP_SCRIPTING_ENABLED | ||||||
if (thrust_override.start_ms != 0) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this was above the "last_pidz_active_ms" reset check then you could rely on it to do the reset. In general I'm not a fan of having this here. The method is called |
||||||
// require updates every 50ms at least for thrust control | ||||||
if (now - thrust_override.start_ms > 50) { | ||||||
thrust_override.start_ms = 0; | ||||||
pos_control->init_z_controller(); | ||||||
} else { | ||||||
attitude_control->set_throttle_out(thrust_override.thrust, true, 0); | ||||||
return; | ||||||
} | ||||||
} | ||||||
#endif // AP_SCRIPTING_ENABLED | ||||||
|
||||||
pos_control->update_z_controller(); | ||||||
} | ||||||
|
||||||
|
@@ -3735,7 +3749,11 @@ bool QuadPlane::guided_mode_enabled(void) | |||||
// loiter turns is a fixed wing only operation | ||||||
return false; | ||||||
} | ||||||
return guided_mode != 0; | ||||||
if (guided_mode == GUIDED_MODE::G_IF_Q_MODE) { | ||||||
// if previously in a Q mode then do VTOL guided | ||||||
return plane.previous_in_vtol; | ||||||
} | ||||||
return guided_mode != GUIDED_MODE::G_OFF; | ||||||
} | ||||||
|
||||||
/* | ||||||
|
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 would prefer to add a binding for this full method so it can be used for other things as well.
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.
the climb_rate_cms_or_thrust is pretty horrible - might be worth trying to come up with a better API
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 pass const argument in bindings, so we could bind with the true hardcoded and rename to something more useful without having to change copter.
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, but I also want bindings that make sense for quadplane. I think we need to think about what guided bindings we want and design a set that are really usable, not just match the current C++ ones for copter, as they are just so weird
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.
related to this is the GUID_TIMEOUT hackery, we need a way to set the timeout from scripts properly
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.
In general a set_target_attitude_and_thrust() would be more generally useful.