source: flair-src/branches/sanscv/lib/FlairMeta/src/MetaUsRangeFinder.cpp@ 411

Last change on this file since 411 was 324, checked in by Sanahuja Guillaume, 5 years ago

removing opencv dependency

File size: 2.1 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5// created: 2013/04/08
6// filename: MetaUsRangeFinder.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: objet integrant une dérivée
14// d'euler, un passe bas et un generateur de consigne
15// -> adapté pour un capteur d'altitude
16//
17//
18/*********************************************************************/
19
20#include "MetaUsRangeFinder.h"
21#include "UsRangeFinder.h"
22#include <LowPassFilter.h>
23#include <ButterworthLowPass.h>
24#include <Layout.h>
25#include <DataPlot1D.h>
26#include <Tab.h>
27#include <EulerDerivative.h>
28#include <GroupBox.h>
29#include <Matrix.h>
30
31using std::string;
32using namespace flair::core;
33using namespace flair::gui;
34using namespace flair::filter;
35using namespace flair::sensor;
36
37namespace flair {
38namespace meta {
39
40MetaUsRangeFinder::MetaUsRangeFinder(UsRangeFinder *us)
41 : Object(us, us->ObjectName()) {
42 this->us = us;
43 pbas_z =
44 new ButterworthLowPass(us, us->GetLayout()->NewRow(), "Passe bas", 3);
45 vz_euler = new EulerDerivative(pbas_z, us->GetLayout()->NewRow(), "Vz");
46 pbas_vz = new ButterworthLowPass(vz_euler, us->GetLayout()->NewRow(),
47 "Passe bas v", 3);
48}
49
50MetaUsRangeFinder::~MetaUsRangeFinder() {}
51
52void MetaUsRangeFinder::UseDefaultPlot(void) {
53 us->UseDefaultPlot();
54
55 us->GetPlot()->AddCurve(pbas_z->GetMatrix()->Element(0), DataPlot::Blue);
56
57 vz_plot = new DataPlot1D(us->GetPlotTab()->LastRowLastCol(), "vz", -2, 2);
58 vz_plot->AddCurve(vz_euler->GetMatrix()->Element(0));
59 vz_plot->AddCurve(pbas_vz->GetMatrix()->Element(0), DataPlot::Blue);
60}
61
62gui::DataPlot1D *MetaUsRangeFinder::GetZPlot() { return us->GetPlot(); }
63
64gui::DataPlot1D *MetaUsRangeFinder::GetVzPlot() { return vz_plot; }
65
66float MetaUsRangeFinder::z(void) const { return pbas_z->Output(); }
67
68float MetaUsRangeFinder::Vz(void) const { return pbas_vz->Output(); }
69
70} // end namespace sensor
71} // end namespace flair
Note: See TracBrowser for help on using the repository browser.