ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_Follow: stop adjusting frame of return location based on parameter

Open peterbarker opened this issue 7 months ago • 9 comments

this removes the dual-use of the _alt_type parameter.

This parameter was changing both which input we accepted from the other vehicle (eg. GLOBAL_POSITION_INT.alt vs GLOBAL_POSITION_INT.relative_alt, but it was also specifying the return frame for the Location object returned from various methods. This was somewhat confusing and unnecessary.

  • all lua scripts in-tree canonicalise this to absolute altitude
  • there are only two callers to these. One is logging, meaning we will always now log in relative-to-origin numbers. The secon is mavlink-reporting which canonicalises the altitude. Many other get_wp() methods can return absolute-altitude locations.

peterbarker avatar May 31 '25 11:05 peterbarker

Hi @peterbarker, I think there are some comments a few lines up that need updating as well..

rmackay9 avatar Jun 02 '25 00:06 rmackay9

Hi @peterbarker, I think there are some comments a few lines up that need updating as well..

I've removed those parts of the comments now, both in the cpp and header files, thanks.

peterbarker avatar Jun 02 '25 01:06 peterbarker

@rmackay9 needs your review as well I think looks good for plane

tridge avatar Jun 04 '25 08:06 tridge

Ping @timtuxworth - could I get your thoughts on this, please?

peterbarker avatar Jun 04 '25 08:06 peterbarker

Ping @timtuxworth - could I get your thoughts on this, please?

I like the change, although I don't have any use cases for it since I don't usually use home relative altitudes. I see it passes CI, I assume there must be (many?) tests for flying at home relative altitudes?

I'm going to say I think it needs testing on a real vehicle.

timtuxworth avatar Jun 05 '25 02:06 timtuxworth

I'm going to say I think it needs testing on a real vehicle.

Are you going to do that testing?

peterbarker avatar Jun 07 '25 00:06 peterbarker

I'm going to say I think it needs testing on a real vehicle.

Are you going to do that testing?

That's a reasonable question I guess, but a. I can't test for a couple of weeks and b. I'd prefer to test it on master with Leonard's kinetic extrapolation work. Will that work?

timtuxworth avatar Jun 07 '25 01:06 timtuxworth

I'm going to say I think it needs testing on a real vehicle.

Are you going to do that testing?

That's a reasonable question I guess, but a. I can't test for a couple of weeks and b. I'd prefer to test it on master with Leonard's kinetic extrapolation work. Will that work?

Have you read and understood the patches? Leonard has.

This PR does not change the maths.

peterbarker avatar Jun 13 '25 00:06 peterbarker

I'm going to say I think it needs testing on a real vehicle.

Are you going to do that testing?

That's a reasonable question I guess, but a. I can't test for a couple of weeks and b. I'd prefer to test it on master with Leonard's kinetic extrapolation work. Will that work?

Have you read and understood the patches? Leonard has.

This PR does not change the maths.

Yes it should be ok. "should be" always worries me.

timtuxworth avatar Jun 13 '25 04:06 timtuxworth

I'm going to say I think it needs testing on a real vehicle.

Are you going to do that testing?

That's a reasonable question I guess, but a. I can't test for a couple of weeks and b. I'd prefer to test it on master with Leonard's kinetic extrapolation work. Will that work?

Have you read and understood the patches? Leonard has. This PR does not change the maths.

Yes it should be ok. "should be" always worries me.

Have you tested this one yet, @timtuxworth ?

peterbarker avatar Jun 24 '25 06:06 peterbarker