[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 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 |
|
---|
[15] | 29 | namespace flair {
|
---|
| 30 | namespace filter {
|
---|
[7] | 31 |
|
---|
[15] | 32 | NestedSat::NestedSat(const LayoutPosition *position, string name)
|
---|
| 33 | : ControlLaw(position->getLayout(), name) {
|
---|
| 34 | pimpl_ = new NestedSat_impl(this, position, name);
|
---|
[7] | 35 | }
|
---|
| 36 |
|
---|
[15] | 37 | NestedSat::~NestedSat(void) { delete pimpl_; }
|
---|
[7] | 38 |
|
---|
[15] | 39 | void NestedSat::UpdateFrom(const io_data *data) {
|
---|
| 40 | pimpl_->UpdateFrom(data);
|
---|
| 41 | ProcessUpdate(output);
|
---|
[7] | 42 | }
|
---|
| 43 |
|
---|
[15] | 44 | void NestedSat::SetValues(float p_ref, float p, float d) {
|
---|
| 45 | input->SetValue(0, 0, p_ref);
|
---|
| 46 | input->SetValue(1, 0, p);
|
---|
| 47 | input->SetValue(2, 0, d);
|
---|
[7] | 48 | }
|
---|
[15] | 49 | // TODO: add a combobox to choose between rad and deg
|
---|
| 50 | void NestedSat::ConvertSatFromDegToRad(void) { pimpl_->k = Euler::ToRadian(1); }
|
---|
[7] | 51 |
|
---|
| 52 | } // end namespace filter
|
---|
| 53 | } // end namespace flair
|
---|