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
Copter: surface tracking fix #18531
Copter: surface tracking fix #18531
Conversation
68a093d
to
4ba7920
Compare
I'm put some suggestions for non-functional changes but in general this is looking pretty good to me. |
a773339
to
17c281f
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.
I've tested this and it seems to be working 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.
I think we can keep most of the removed consts. Looks like making
ardupilot/libraries/AP_Math/control.cpp
Line 32 in 8462ce4
void update_vel_accel(float& vel, float accel, float dt, float limit) |
void update_vel_accel(float& vel, const float accel, const float dt, const float limit)
Would allow the consts to remain.
Looks like we can also remove RNGFND_GAIN
param as a result of this.
Thanks very much for the review. Removing RNGFND_GAIN is a bit historic I think. We don't need any of those consts. There was one outright mistake where it was using a const reference ("const float &") but never changing the value and the rest are unnecessary const-ing of pass-by-value arguments. |
17c281f
to
30f8999
Compare
@IamPete1, fixed, this resolves your comments i guess? Thanks again for the feedback on this complex PR |
Thank you for this improvement. When I use upward facing terrain following, DSAlt shows negative value. |
@tatsuy If you are using upward facing You should be below it right? So it should read negative. Can you send me this log? Maybe make it available on the discuss forums? |
TUNING_RANGEFINDER_GAIN = 41, // unused | ||
TUNING_EKF_VERTICAL_POS = 42, // unused | ||
TUNING_EKF_HORIZONTAL_POS = 43, // unused | ||
TUNING_EKF_ACCEL_NOISE = 44, // unused |
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.
TUNING_RANGEFINDER_GAIN = 41, // unused | |
TUNING_EKF_VERTICAL_POS = 42, // unused | |
TUNING_EKF_HORIZONTAL_POS = 43, // unused | |
TUNING_EKF_ACCEL_NOISE = 44, // unused |
If we just delete all of these then we can be sure nowhere in the code is trying to use them.
the param values need a update here:
ardupilot/ArduCopter/Parameters.cpp
Line 349 in 9d32e48
// @Values: 0:None,1:Stab Roll/Pitch kP,4:Rate Roll/Pitch kP,5:Rate Roll/Pitch kI,21:Rate Roll/Pitch kD,3:Stab Yaw kP,6:Rate Yaw kP,26:Rate Yaw kD,56:Rate Yaw Filter,55:Motor Yaw Headroom,14:AltHold kP,7:Throttle Rate kP,34:Throttle Accel kP,35:Throttle Accel kI,36:Throttle Accel kD,12:Loiter Pos kP,22:Velocity XY kP,28:Velocity XY kI,10:WP Speed,25:Acro RollPitch kP,40:Acro Yaw kP,45:RC Feel,13:Heli Ext Gyro,38:Declination,39:Circle Rate,41:RangeFinder Gain,46:Rate Pitch kP,47:Rate Pitch kI,48:Rate Pitch kD,49:Rate Roll kP,50:Rate Roll kI,51:Rate Roll kD,52:Rate Pitch FF,53:Rate Roll FF,54:Rate Yaw FF,58:SysID Magnitude |
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.
Good catch on the Parameter description!
I have not removed the lines in the defines.h file as that is a style change and best off left as a separate commit from people with style.
@lthall Previously, it was displayed as positive values. This branch About being intermittent, sorry, this is my mistake. |
@tatsuy, I see what you are saying. I will chat to Randy about this. Does everything work with the upwards facing lidar even though the log is backwards compared to what it was before? |
yes,it works with upward facing terrain following and proximity |
@tatsuy I have reversed the log so it should match the old behaviour now. Thanks for highlighting this. Could you take another look? |
@lthall Everything is working fine for me. Thank you! |
1adaa1e
to
b654ef8
Compare
b654ef8
to
c585123
Compare
removed the extra param so dismissin PEter's review, thanks!
@rmackay9 Can we add this to Copter-4.1? |
@tatsuy, yes, this will be included in the next beta release hopefully later this week. Txs very much for uncovering that issue! |
Great, thank you. |
This PR updates the surface tracking code to use the new terrain following algorithms in the position controller.
The existing code relies on the slower response of the target following approach and now causes overshoot as seen in this report:
https://discuss.ardupilot.org/t/altitude-overshoot-on-ascent-descent-tuning-help-please/74756