-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ArduPlane: add climb before turn to AUTOLAND #29142
ArduPlane: add climb before turn to AUTOLAND #29142
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.
I think that's it just _m on values in meters.
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.
Could we reuse RTL_CLIMB_MIN
?
388f4c8
to
f29f06d
Compare
f29f06d
to
f700e1d
Compare
@tridge need help in getting glide_slope from point of climb to alt -> base loiter point to follow terrain...it always just use above home alt as it proceeds to the loiter-to-alt point....help would be appreciated |
f700e1d
to
be5d6b1
Compare
@tridge got it all working now.....full terrain support |
be5d6b1
to
1d43cc0
Compare
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.
It seems to me that just because TERRAIN_ENABLE is true might not mean you want to use it for AUTOLAND. I guess it could be added to the TERRAIN_FOLLOW bitmask in a follow up PR.
4fd568b
to
428090e
Compare
ArduPlane/mode_autoland.cpp
Outdated
|
||
#if AP_TERRAIN_AVAILABLE | ||
if (plane.terrain_enabled_in_current_mode()) { | ||
cmd_loiter.content.location.terrain_alt = 1; // this allows terrain following to it as a glide slop destination |
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'm surprised you didn't need to subtract home alt here, I will need to look at this under gdb
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.
set_target_altitude_location takes care of all that...the relative_alt bit is cleared when we convert the land alt to ABSOLUTE for later use...
since only the terrain alt flag is set when terrain following is enabled,
ardupilot/ArduPlane/altitude.cpp
Line 236 in bac78b5
if (!loc.relative_alt) { |
ArduPlane/mode_autoland.cpp
Outdated
plane.target_altitude.amsl_cm = plane.current_loc.alt + climb_before_turn_alt * 100.0f; | ||
#if AP_TERRAIN_AVAILABLE | ||
plane.target_altitude.terrain_alt_cm = plane.target_altitude.amsl_cm; |
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 suspect this is key to how why works. It sets the TECS target to a huge altitude which is enough to get the vehicle to do a max rate climb. That is the only purpose of the target altitude. The key thing is that this target is not used for the comparison of when the climb is done.
The problem is that without terrain, or if your at sea level then the target altitude may be lower than the threshold alt and the climb will never complete.
We could just set INT32_MAX
here and the result would be the same. Although I would not recommend that.
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.
without terrain it climbs to current amsl + climb alt in cm....so that's correct, right?
how do you suggest I set the max climb , terrain based?
7937624
to
437b2c9
Compare
Co-authored-by: IamPete1 <[email protected]>
7e13216
to
346bcdb
Compare
624b9ae
to
ee70a67
Compare
Alternate to #29135
After test flying using a TX GCS to change climb to altitudes, I agree with Tim that this is easier to use then options in #29135...and it actually uses less flash so I am closing #29135
Now fully terrain following capable
Thanks to Pete Hall for help
Updated autotest for terrain based mission out behind mountain with terrain following autoland return