fw_px4_plottools icon indicating copy to clipboard operation
fw_px4_plottools copied to clipboard

Remove topic-logged checks in DisplayPX4LogData

Open philipoe opened this issue 6 years ago • 2 comments

@acfloria

Can we simply remove the if(topics.XXX.logged) checks for every check that contains/checks more than one topic?

I currently have the problem that (due to a logger failure) only the topics.tecs_status.logged=false, and therefore, the whole control plots are not plotted (see https://github.com/ethz-asl/fw_px4_plottools/blob/master/01_draw_functions/DisplayPX4LogData.m#L151) ! If we remove that check, then Matlab would of course throw an error here, but this is then super easy to correct by simply uncommenting that line and then the rest of the data can still be plotted!

Above i said "checks for every single check that contains more than one topic" because if a draw-sub-function uses only a single topic, and that topic was not logged, then of course it does make sense to plot nothing...

philipoe avatar Jun 11 '18 12:06 philipoe

^blast from the past :P

Though I have been dealing with this issue in the following way recently:

Use OR statements in the DisplayPX4LogData function for multi-topic plots: https://github.com/ethz-asl/fw_px4_plottools/blob/0509bcbe48c695c2ce9d9b5a9d97c793af0e5b2c/01_draw_functions/DisplayPX4LogData.m#L115-L120 Then in the subfunction plotter itself -- check if the topic is logged before plotting it, e.g. https://github.com/ethz-asl/fw_px4_plottools/blob/0509bcbe48c695c2ce9d9b5a9d97c793af0e5b2c/01_draw_functions/01_subfunctions/AirflowAnglePlots.m#L20-L36

Perhaps a way to do this from now on and avoid what @philipoe metions :)

tstastny avatar Apr 07 '19 19:04 tstastny

I like your suggestion, I will generalize it that way

acfloria avatar Apr 15 '19 10:04 acfloria