source: flair-src/trunk/lib/FlairMeta/src/MetaUsRangeFinder.cpp@ 7

Last change on this file since 7 was 7, checked in by Sanahuja Guillaume, 6 years ago

filter and meta

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