Skip to content
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

FW pos C: fix altitude control for VTOL/FW by also publishing attitud… #12920

Merged
merged 3 commits into from
Sep 10, 2019

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Sep 6, 2019

Fixes #12910.

The VTOL altitude control in FW mode was broken with #12532. Before the attitude sp was always published if not on offboard control or in position/velocity control. This PR adds Altitude control support there (thus not relying on the "not offboard" flag as before.

Probably also applies for FW flown in ALT control.

…e sp if in altitude, not only if position or velocity controlled

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
Copy link
Member

@bresch bresch left a comment

Choose a reason for hiding this comment

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

lgtm, better than relying on not being offboard :)
It's already the 2nd time I see that something works because the vehicle is not offboard, might be useful to double check all those if !offboard at some point.

@@ -1746,7 +1746,8 @@ FixedwingPositionControl::Run()
if (_control_mode.flag_control_offboard_enabled ||
_control_mode.flag_control_position_enabled ||
_control_mode.flag_control_velocity_enabled ||
_control_mode.flag_control_acceleration_enabled) {
_control_mode.flag_control_acceleration_enabled ||
_control_mode.flag_control_altitude_enabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@sfuhrer Nitpick, but maybe you can use flag_control_climb_rate_enabled. I think that's how it's used in other locations and in theory could run TECS in climb rate mode. What do you think? Otherwise good to go.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think it matters right now, but we should do a pass to make sure these are handled consistently and to even know where the holes are in offboard.

@dagar dagar merged commit 702c6f6 into master Sep 10, 2019
@dagar dagar deleted the pr-fix_FW_altitude_control branch September 10, 2019 17:20
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.

VTOL: no control in FW after transition in ALT control
4 participants