apm_planner icon indicating copy to clipboard operation
apm_planner copied to clipboard

Wish list for graph module :)

Open lvale opened this issue 7 years ago • 39 comments

Hi. I was talking with @billbonney about the great work that has been done on the graphing and my wish list is:

Independent automatic scaling of axes per measure. i.e. measuring Amps and Altitude on the same graph would have the scale from say 0 to 50A to Amps and Altitude from 0m to 120m

Possibility of saving graphing settings: I usually do a common graph with a series of values and I repeat those same settings for every log I analyse.

Possibility of independent adjusting scale/offset/LPF for a graphed property.

Possibility of comparing and graphing values from 2+ different logs. ie, compare flight1 altitude with flight2 altitude, etc

FFT :)

lvale avatar Apr 05 '17 14:04 lvale

@lvale nice to hear you like the changes :smiley: Cool ideas for improving the log analyzing - perhaps I can realize some of them. But first some questions:

  • Independent automatic scaling: At the moment the graph scales to min / max of the selected measurement to make sure everything is visible. So all Graphs are scaled independent. If you want them to have the same scaling you can group them in the "advanced scaling" window. So from my point of view it is already there.
  • Saving settings: Do you mean one setting that is restored if you open the window again or several selectable settings?
  • Possibility of independent adjusting: You can use the "advanced scaling" button and / or you can click on the Y-Axis on the left side. I should be selected then. If you use you mouse wheel when the mouse is directly over the selected axis it will change its scaling. This can be done for each axis independently. LPF Low Pass Filter? Selectable cut-off?
  • FFT: Select one measurement and add FFT (if enabled) to same graph as long as only one measurement is selected? Would be like the horizontal grid lines.

Arne-W avatar Apr 05 '17 15:04 Arne-W

@Arne-W about the saving of settings. Imagine that one could save a graph setting that would combine RCOUT1, RCOUT2,RCOUT3,RCOUT1 and CURR with some specific settings applied to each scale. So one would open a log and then apply a "saved setting" of the graph. A bit what MP does with that list of graphs, although here we would also have the transformations of scales, LPF's, offsets also applied to each graphed value.

lvale avatar Apr 05 '17 15:04 lvale

@lvale I made a proof of concept for the settings storage https://github.com/Arne-W/apm_planner/tree/ReapplySettings_Proof. In the middle of the LogAnalysis window you will find 2 new buttons "Store Settings" and "Apply Settings". You can set up a perfect view onto your data and press store, after that you can apply those settings to every other LogAnalysis window by pressing apply. At the moment only one setting can be stored, if you want more than one - let me know.

It would be great if you could check it and give feedback whether this is the feature you were looking for! Furthermore it would be great if you have an Idea for the UI, as the 2 buttons in the middle are a mess but for a proof of concept it was enough :smiley:

Arne-W avatar Apr 07 '17 14:04 Arne-W

Oh yeah ! - this is great ! I find myself often browsing thru, and selecting different sets of data to analyze something, like current, voltage or thrust level vs vibrations. -selecting all motors to compare for similar/equal thust at hover (indication of a bad motor/prop) and many more typical diagnostic configurations. " if you want more than one - let me know." now you know :) if you add a droplist with selections to choose from, that would be great !

I would contribute with a bunch configs myself.

I see you store colors, that's great ! , as sometime colors may be too similar. Also, unless too much work, consider storing "advanced scaling" settings - advanced scaling groups - it is useful for , for example motors: one would scale all as a group, then it's easier to spot one that is under-performing.

Finally, there's an old bug in "advanced scaling , groups" - to reproduce: plot voltage ("auto axis" checked), your graph will be between 24 and 26volts. now add voltage to a group(only item in group), refresh .. suddenly the voltage is plotted in range 0...26

BTW: while you are editing those files: "auto scale" is a better, more describing name for the function than "auto axis"

AndKe avatar Apr 07 '17 16:04 AndKe

As there was a lot of progress the branch above should not be used anymore. Here is a new one: https://github.com/Arne-W/apm_planner/tree/Analysis_Presets_WIP

There are some new features:

  • UI reorganisation of Log Analysis window. We have a menu bar now.
  • Export buttons moved to the menu bar.
  • New "Analyzing Preset" menu which allows to store the current View and its scaling.
  • Support of several different presets which can be loaded and stored to different Files.
  • File format is "ini" format which makes it editing easy.
  • New "Save View" and "Apply View" buttons making it possible to give one special setting to all othe Log Analysis windows regardless whether they are already open or not.

Arne-W avatar Apr 14 '17 16:04 Arne-W

looks good, it seems like you plan to use multiple preset files (.ini) which will be loaded by default ? - is the plan to have one with the apmplanner, and user should make a custom file ? Maybe it's better to always load a standard file and the user file, and just save any custom user views to the user file. So that the user don't need to thing about filename - and his presets are auto-saved when exiting.

AndKe avatar Apr 16 '17 06:04 AndKe

I thought the best solution to deal with different parameter names in different ArduCopter / ArduPlane... releases is to have several preset files which can be selected by the user. So my idea was to have some default preset files for different ArduXXX releases. Moreover the user should have the possibility to enhance the default ones, to create new sets and perhaps share their them with others. This is important as the user can adopt the settings files if no one has the time to adopt the presets in the repository. At the moment the last used preset file is loaded on startup - I think loading always an default preset leads the problem that you have to handle many different FW types (plane/copter/rover) and versions in one preset file - nearly impossible without grouping.

Arne-W avatar Apr 16 '17 09:04 Arne-W

i see :)

AndKe avatar Apr 16 '17 09:04 AndKe

Again an update on my WIP branch. The manual / auto scaling is now stored in the presets. If no "Y_AXIS_MAX" / "Y_AXIS_MIN" is found in the ini file the graph will be set to autoscale. Grouping is not supported by the presets at the moment.

Arne-W avatar Apr 18 '17 15:04 Arne-W

All right - I think it is done now. I added the graph grouping feature to the presets. The feature should be complete now. Anyone who wants to test - its still the same WIP branch mentioned here. @lvale As you have "suggested" this feature it would be cool if you could have a look.

Arne-W avatar Apr 19 '17 11:04 Arne-W

a few things I've noticed: 1:selected items, "add view to preset" , gave it name: close graph = preset is lost (no warning) 2:selected items, "add view to preset" , gave it name, "save presets" , close graph ; preset is lost (no warning, no question for filename)
3: - saved next preset "as" file, "test" - but the suffix ".ini" is not added automatically, so it wont be visible to user.
4: auto axis/axis range is restored just fine :) 5: please load last preset. - and somewhere show which preset file is selected. (as is, if I load AC3.2presets.ini - I can't be sure later if it's that, or another version. )

great work, BTW: what are the "Save view" and "apply view" supposed to do ?

AndKe avatar Apr 19 '17 13:04 AndKe

@Arne-W - added to my to-do list. Will compile later tonight

lvale avatar Apr 19 '17 15:04 lvale

Ahh thank you @AndKe Your first points are already solved :smiley: Third and fifth will be solved - this evening or tomorrow

The "Save View" and "Apply View" button are for convenience. You don't have to give a preset name, you don't need a filename and if you have opened several analysis windows you can press save in window A and apply in window B without selecting a preset file or a preset name. All loganalysis windows automatically share the "Save View".

Arne-W avatar Apr 19 '17 15:04 Arne-W

Got it - Third and fifth are solved too. Name of the loaded preset will be shown in the window title. Happy testing :smile:

Arne-W avatar Apr 20 '17 15:04 Arne-W

All I would like to know if you think the preset ini format is frozen now, or if there will be changes that make my mess up presets I make. (to me, it seems so good, I don't really want to "just test" it more, just do useful things as test)

AndKe avatar Apr 21 '17 06:04 AndKe

Had some time to explore last night's build.

Some comments:

Changing scaling from auto to manual isn't "respected", ie changing the scale of the RCOUT's then the check box gets checked again. Assigning colors to values isn't working:

screen shot 2017-04-21 at 16 10 57 screen shot 2017-04-21 at 16 11 10 screen shot 2017-04-21 at 16 12 18

The filtering of data would be a nice to have to "smooth" the data, if we want to check the general tendency of the analysed value and the "spiking" makes it harder..

screen shot 2017-04-21 at 16 15 18 screen shot 2017-04-21 at 16 17 15

The loading of the parameters is a very nice feature

lvale avatar Apr 21 '17 15:04 lvale

@lvale as for "smoothing" - you have better than that already(Thanks to Arne-W): Use the range cursors, and enable values under mouse - you'll see average for selected time period.
I don't know even one occasion where I would like so hide "spikes" in a log - quite opposite, I would consider such feature "dangerous" to my understanding of the data. Just a few days ago, I helped somebody and accidentally discovered bad airspeed sensor that peaked to ~50m/s at random intervals.

good catch on the other issues.

AndKe avatar Apr 21 '17 15:04 AndKe

@AndKe it depends on how "aggressive" you go. The range values are great for single log, but it doesn't make sense to "save" it on the settings but imho a LPF filter can be used as a setting, so that you can quickly get differences between different logs, until we can get more than one log at the same time :) Same log file with different LPF settings

screen shot 2017-04-21 at 17 03 25 screen shot 2017-04-21 at 17 03 07 screen shot 2017-04-21 at 17 02 52

lvale avatar Apr 21 '17 16:04 lvale

Comparing logs I get, but please give me one scenario where you actually are using LPF, because you need it - I get the picture above, it is kind of easier to the eye, but then hides some sudden output. I mean as a workflow, how/when exactly is that nice to get away with it - maybe it's something I will learn to appreciate :)

AndKe avatar Apr 21 '17 16:04 AndKe

I use the LPF in FlightPlot to look at raw accelerometer data, since a complementary filter (like DCM) responds only to relatively long-term trends.

kd0aij avatar Apr 21 '17 16:04 kd0aij

The RC_OUT+CURR+ALT is a usual setting, because I have to evaluate the "general" output of the motors given some other variables. Example: the evolution of each motor as the drone "climbs" vertically, and is affected by turbulence. As we fly close to obstacles is a great way to access the behaviour of the drone vs the obstacle shape and distance to the object, and so optimize "safe" distances to target :)

lvale avatar Apr 21 '17 16:04 lvale

All right - thanks for the feedback :+1: .

  • @AndKe format of actual branch is frozen now.
  • Colors - don't work - I will fix that
  • Auto / Manual Scaling - As long as a plotted value is in a group you can not switch it to manual. It is a bit tricky to select the min / max value of 5 graphs in a group - which of the group members determines the values?
  • You can open as much logs at the same time as you want, if you want to compare them. That is was the "save view" and "apply view" buttons are for. Open first log, find good scaling, press save, open second log, press apply - tadaaa
  • Filtering seems to be nice feature but is one of the next steps :smiley:

Arne-W avatar Apr 21 '17 18:04 Arne-W

Ta-Daa !! indeed, I would suggest some tooltip description of the buttons, otherwise only a few hardcore users will ever know what they are for, and the average user will never think of them as a comparison tool.

AndKe avatar Apr 21 '17 21:04 AndKe

Again an update on the WIP branch.

  • fixed the colour bug
  • fixed a bug where saved groups defaults to group A
  • added some tool tips - would be great if someone could review them.

Arne-W avatar Apr 23 '17 12:04 Arne-W

The tool tips made sense to me, and I found it useful to be able to apply the same view to a second analysis window.

Saving/loading views to a presets file seems to work OK, except I couldn't find a way to save an edited view without first deleting it from the presets.

Also, when you put two graphs in the same group, both show as "Auto Axis", but it seems that the Min/Max range for the first graph actually sets the scaling for both.

Question: Is there a way to "pan" the Y-axis of a graph? (perhaps by dragging the Y axis) That would be much easier than opening the scaling menu and typing min/max values.

kd0aij avatar Apr 23 '17 13:04 kd0aij

Thanks for the feedback - it should be possible to click the y-axis and scale it by mouse wheel.

Arne-W avatar Apr 23 '17 13:04 Arne-W

I just noticed that the mouse wheel Y-axis scaling "zooms" about the Y-axis value under the mouse cursor. So it's possible to achieve a translation with two successive scale operations.

kd0aij avatar Apr 23 '17 13:04 kd0aij

Graph colours change when you choose the "use time on x axis" option screen shot 2017-04-29 at 13 47 34 screen shot 2017-04-29 at 13 47 45

The y axis scale take different space (on the x) according to the values of the axis. Also would be better that each y axis could take less space horizontally because at times the room the axis scale take is more than the graphs :) screen shot 2017-04-29 at 13 48 41

lvale avatar Apr 29 '17 12:04 lvale

updated screenshots from test build screen shot 2017-04-29 at 13 55 25 screen shot 2017-04-29 at 13 55 14

if a user creates a group to graph (imagine RC_OUTS) it should only display one y axis for that group

screen shot 2017-04-29 at 13 56 10

lvale avatar Apr 29 '17 12:04 lvale

To correlate the graph with the KML display in Google Earth, we need the option to display GPS time on the x axis.

kd0aij avatar Apr 30 '17 23:04 kd0aij