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/15
|
---|
6 | // filename: NestedSat.cpp
|
---|
7 | //
|
---|
8 | // author: Guillaume Sanahuja
|
---|
9 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
10 | //
|
---|
11 | // version: $Id: $
|
---|
12 | //
|
---|
13 | // purpose: Class defining a PID with saturations
|
---|
14 | //
|
---|
15 | //
|
---|
16 | /*********************************************************************/
|
---|
17 |
|
---|
18 | #include "NestedSat.h"
|
---|
19 | #include "NestedSat_impl.h"
|
---|
20 | #include <cvmatrix.h>
|
---|
21 | #include <Layout.h>
|
---|
22 | #include <LayoutPosition.h>
|
---|
23 | #include <Euler.h>
|
---|
24 |
|
---|
25 | using std::string;
|
---|
26 | using namespace flair::core;
|
---|
27 | using namespace flair::gui;
|
---|
28 |
|
---|
29 | namespace flair
|
---|
30 | {
|
---|
31 | namespace filter
|
---|
32 | {
|
---|
33 |
|
---|
34 | NestedSat::NestedSat(const LayoutPosition* position,string name) : ControlLaw(position->getLayout(),name)
|
---|
35 | {
|
---|
36 | pimpl_=new NestedSat_impl(this,position,name);
|
---|
37 | }
|
---|
38 |
|
---|
39 | NestedSat::~NestedSat(void)
|
---|
40 | {
|
---|
41 | delete pimpl_;
|
---|
42 | }
|
---|
43 |
|
---|
44 | void NestedSat::UpdateFrom(const io_data *data)
|
---|
45 | {
|
---|
46 | pimpl_->UpdateFrom(data);
|
---|
47 | ProcessUpdate(output);
|
---|
48 | }
|
---|
49 |
|
---|
50 | void NestedSat::SetValues(float p_ref,float p,float d)
|
---|
51 | {
|
---|
52 | input->SetValue(0,0,p_ref);
|
---|
53 | input->SetValue(1,0,p);
|
---|
54 | input->SetValue(2,0,d);
|
---|
55 | }
|
---|
56 | //TODO: add a combobox to choose between rad and deg
|
---|
57 | void NestedSat::ConvertSatFromDegToRad(void)
|
---|
58 | {
|
---|
59 | pimpl_->k=Euler::ToRadian(1);
|
---|
60 | }
|
---|
61 |
|
---|
62 | } // end namespace filter
|
---|
63 | } // end namespace flair
|
---|