Try Pangolin (5) - SimplePlot

来源:互联网 发布:音效下载软件 编辑:程序博客网 时间:2024/06/05 17:46

Structure DataLog is defined in plotter.h:

  // Data logger object  pangolin::DataLog <span style="color:#3366FF;">log</span>;



To name labels:
  // Optionally add named labels  std::vector<std::string> labels;  labels.push_back(std::string("sin(t)"));  labels.push_back(std::string("cos(t)"));  labels.push_back(std::string("sin(t)+cos(t)"));  <span style="color:#3366FF;">log</span>.<span style="color:#CC0000;">SetLabels</span>(labels);


About pangolin::Plotter:

  // OpenGL 'view' of data. We might have many views of the same data.  <span style="color:#3333FF;">pangolin::Plotter</span> plotter(&log,0,4*M_PI/tinc,-2,2,M_PI/(4*tinc),0.5);  plotter.SetBounds(0.0, 1.0, 0.0, 1.0);  plotter.<span style="color:#FF0000;">Track</span>("$i");


And nothing changed after commenting out log.Track("$i");


Let's compare the result and the values:

Result:

As shown in this plot:

The "top", "bottom", "left" and "right" are in accordance with the given values.

"tickx" and "ticky" are the smallest units of x and y axis.


Compare the difference between Display and DisplayBase:

  pangolin::<span style="color:#009900;">DisplayBase</span>().AddDisplay(plotter);

pangolin::Plotter plotter(&log,0,4*M_PI/tinc,-2,2,M_PI/(4*tinc),0.5) is the base of the whole display,

while:

    pangolin::DataLog log;    ...    log<strong><span style="color:#CC0000;">.Log</span></strong>(sin(t),cos(t),sin(t)+cos(t));    t += tinc;
    (.Log) defines the curve.

0 0
原创粉丝点击