ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

Plane: maximum altitude for FBWB and cruise mode

Open Supermagnum opened this issue 4 years ago • 18 comments
trafficstars

Feature request

Maximum altitude in centimeters or meters that FBWB, and CRUISE modes will allow. If you attempt to ascend above this altitude then the plane will level off. A value of zero means no limit.

Platform [ ] All [ ] AntennaTracker [ ] Copter [X] Plane [ ] Rover [ ] Submarine

Useful where the law sets limitations on how high above ground it is permitted to fly. Perhaps also useable for FBWA mode as it can be helpful for those who are learning to fly .

Supermagnum avatar Mar 26 '21 10:03 Supermagnum

We have already, ALT_HOLD_FBWCM for a min height. We do also currently support a max alt geofence. It does not stop you braking the limit but will take over and fly you home.

IamPete1 avatar Mar 26 '21 13:03 IamPete1

Copter will already stop at the top of the altitude fence so removing the copter part of this request

rmackay9 avatar Mar 26 '21 23:03 rmackay9

Can I take this task? I am a newcomer. It is enough to make it work:

  • add method Plane::check_fbwb_maximun_altitude();
  • add parametr ALT_HOLD_FBWCM_MAX ?

mmk0102 avatar Mar 28 '21 14:03 mmk0102

@mmk0102 that would be great, I would be tempted to rename the existing check_fbwb_minimum_altitude to check_fbwb_altitude and do them both in the one function. I the new param might as well be in meters, were not so constrained on param space as we were when the min param was added. Jump onto the AP discord if you need any pointers https://discord.gg/hTvezxYQ

IamPete1 avatar Mar 28 '21 15:03 IamPete1

Well, ALT_HOLD_FBWCM (min alt) will be in cm, ALT_HOLD_FBWCM_MAX (max alt) will be in meters, all right? And check_fbwb_minimum_altitude() move to general check_fbwb_altitude().

mmk0102 avatar Mar 28 '21 17:03 mmk0102

And section Fly-by-wire control is full // 120: Fly-by-wire control k_param_airspeed_min = 120, ... k_param_use_reverse_thrust = 129, I can use this (from Sensor parameters section): k_param_imu = 130, // unused k_param_altitude_mix, // deprecated or should I add it in the end ?

mmk0102 avatar Mar 28 '21 17:03 mmk0102

Yeah, you should add the new param at the end of the list. Feel free to open a draft PR of what you have, it will be easier to review changes that way.

IamPete1 avatar Mar 28 '21 18:03 IamPete1

Did it as draft PR.

mmk0102 avatar Mar 31 '21 17:03 mmk0102

Well, can we merge it? Or something still wrong?

mmk0102 avatar Apr 09 '21 20:04 mmk0102

@mmk0102 Your PR is still draft, you can convert it to a full PR once its ready

IamPete1 avatar Apr 09 '21 22:04 IamPete1

@mmk0102 Are you still working on this issue?

shiv-tyagi avatar Oct 19 '21 07:10 shiv-tyagi

Any news here? Is this resolved?

Supermagnum avatar Jan 05 '22 14:01 Supermagnum

@Supermagnum No update, PRs welcome.

IamPete1 avatar Jan 05 '22 14:01 IamPete1

@Supermagnum No update, PRs welcome.

I hope someone resolves this soon.

Supermagnum avatar Jan 08 '22 14:01 Supermagnum

@IamPete1 does the last changes done by @mmk0102 are Right. I am currently testing those.

khanasif786 avatar Jan 08 '22 14:01 khanasif786

I am a newcomer. While @mmk0102 has done most of the work on these. All credit goes to him. There was only 1 mistake, that instead of using 100 he used 1000 to change meter to cms. I have tested it in FBWB mode, it's working. @IamPete1 Sir, Please suggest changes if any.

khanasif786 avatar Jan 08 '22 17:01 khanasif786

Any progress on this? It looks like it's ready for merge.

Supermagnum avatar May 16 '22 22:05 Supermagnum

@Supermagnum, Sorry for the late reply. It is in progress currently i was busy somewhere.. We are doing this using fence max and min altitude instead of adding a new parameter for fBWB limit.

khanasif786 avatar Jul 29 '22 06:07 khanasif786