In [1]:
import sys
sys.path.insert(0, '..')
from ulog_tools.control_opt import main
main("--url https://logs.px4.io/download?log=0467b169-aec0-44d0-bbd0-a42cce863acf  --verbose --plot out.txt".split())


preparing data...
data prepared
identifying attitude dynamics...
finding best fit window for roll
0%
45%
90%
100%
finding best fit window for pitch
0%
45%
90%
100%
finding best fit window for yaw
0%
45%
90%
100%
dynamics identified
designing controller...
controller designed, writing to file out.txt
{
  "MC_PITCHRATE_D": 0.007986111763821054,
  "MC_PITCHRATE_I": 1.4199280160960568,
  "MC_PITCHRATE_P": 0.3010445756612024,
  "MC_PITCH_P": 5.474760010163753,
  "MC_ROLLRATE_D": 0.008747392635960064,
  "MC_ROLLRATE_I": 1.1962720090900754,
  "MC_ROLLRATE_P": 0.29499919522081797,
  "MC_ROLL_P": 5.361772007628582,
  "MC_YAWRATE_D": 0.011026584612036192,
  "MC_YAWRATE_I": 1.9736695282813295,
  "MC_YAWRATE_P": 0.4805348843295458,
  "MC_YAW_P": 5.317066206669442,
  "pitch": {
    "model": {
      "delay": 0.05778450098871699,
      "f_s": 224.9738213113302,
      "fit": 0.6820218656710324,
      "gain": 108.63532791159108,
      "sample_delay": 13
    },
    "t_end": 110,
    "t_start": 105
  },
  "roll": {
    "model": {
      "delay": 0.06667442421775038,
      "f_s": 224.9738213113302,
      "fit": 0.7482813628055249,
      "gain": 100.80854701682381,
      "sample_delay": 15
    },
    "t_end": 110,
    "t_start": 105
  },
  "yaw": {
    "model": {
      "delay": 0.04889457775968361,
      "f_s": 224.9738213113302,
      "fit": 0.43330939920399325,
      "gain": 72.43734245165282,
      "sample_delay": 11
    },
    "t_end": 110,
    "t_start": 105
  }
}