ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AP_PiccoloCAN: Remove duplicated code

Open amilcarlucas opened this issue 4 years ago • 12 comments

Binary Name      Text [B]        Data [B]     BSS (B)        Total Flash Change [B] (%)      Flash Free After PR (B)
---------------  --------------  -----------  -------------  ----------------------------  -------------------------
ardurover        68 (+0.0042%)   0 (0.0000%)  4 (+0.0015%)   68 (+0.0042%)                                    336444
blimp            68 (+0.0051%)   0 (0.0000%)  -4 (-0.0015%)  68 (+0.0051%)                                    620888
arducopter       80 (+0.0045%)   0 (0.0000%)  0 (0.0000%)    80 (+0.0045%)                                    192244
arduplane        368 (+0.0209%)  0 (0.0000%)  0 (0.0000%)    368 (+0.0208%)                                   200064
ardusub          52 (+0.0033%)   0 (0.0000%)  -4 (-0.0015%)  52 (+0.0033%)                                    397832
antennatracker   48 (+0.0036%)   0 (0.0000%)  0 (0.0000%)    48 (+0.0036%)                                    643764
arducopter-heli  68 (+0.0038%)   0 (0.0000%)  -4 (-0.0015%)  68 (+0.0038%)                                    186060

amilcarlucas avatar Jul 08 '21 21:07 amilcarlucas

This one is conflicting badly now, but still seems to be relevant - the duplicate code is still present in PiccoloCAN. We've had some recent activity in that directory - maybe we can drum up some interest.

@SchrodingersGat - this PR removes some code from PiccoloCAN by leveraging the ESC Telemetry library, and there's a few advantages in doing that - chiefly "less code is good code"

peterbarker avatar Jun 16 '23 11:06 peterbarker

@peterbarker do you refer to removing the send_esc_telemetry_mavlink function? It appears it is not being used anywhere. I'm happy to submit a PR which removes that function. Anything else which needs clean-up?

SchrodingersGat avatar Jun 19 '23 02:06 SchrodingersGat

Rebased, please review again.

amilcarlucas avatar Feb 13 '24 16:02 amilcarlucas

What's with all the ! and <! stuff?

magicrub avatar Feb 13 '24 21:02 magicrub

Half the code had Doxygen comments, half did not. Now all code has doxygen comments.

amilcarlucas avatar Feb 14 '24 07:02 amilcarlucas

@SchrodingersGat can you take it from here?

amilcarlucas avatar Feb 14 '24 09:02 amilcarlucas

@SchrodingersGat is this going to bitrot again?

amilcarlucas avatar Feb 19 '24 11:02 amilcarlucas

@amilcarlucas I'll check it out

SchrodingersGat avatar Feb 19 '24 23:02 SchrodingersGat

This will probably conflict with https://github.com/ArduPilot/ardupilot/pull/26252 so you better do it before that one gets merged.

amilcarlucas avatar Feb 21 '24 14:02 amilcarlucas

@amilcarlucas we have reviewed and tested locally (after fixing compiling issues). With the changes suggested by @reilly-callaway above, we would be happy with this.

SchrodingersGat avatar Feb 21 '24 22:02 SchrodingersGat

Please approve so that this can get merged once the tests pass.

amilcarlucas avatar Feb 22 '24 12:02 amilcarlucas

@peterbarker are you OK with the current changes?

amilcarlucas avatar Feb 22 '24 13:02 amilcarlucas

Can someone re-trigger the failing sub test?

amilcarlucas avatar Feb 23 '24 11:02 amilcarlucas

Merged, thanks!

peterbarker avatar Feb 24 '24 23:02 peterbarker

@amilcarlucas thanks for the work on this

SchrodingersGat avatar Feb 25 '24 22:02 SchrodingersGat