source: flair-src/tags/latest/lib/FlairFilter/src/NestedSat.cpp

Last change on this file was 214, checked in by Sanahuja Guillaume, 4 years ago

matrix

File size: 1.4 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/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 <Matrix.h>
21#include <Layout.h>
22#include <LayoutPosition.h>
23#include <Euler.h>
24
25using std::string;
26using namespace flair::core;
27using namespace flair::gui;
28
29namespace flair {
30namespace filter {
31
32NestedSat::NestedSat(const LayoutPosition *position, string name)
33    : ControlLaw(position->getLayout(), name) {
34  pimpl_ = new NestedSat_impl(this, position, name);
35 
36  SetIsReady(true);
37}
38
39NestedSat::~NestedSat(void) { delete pimpl_; }
40
41void NestedSat::UpdateFrom(const io_data *data) {
42  pimpl_->UpdateFrom(data);
43  ProcessUpdate(output);
44}
45
46void NestedSat::SetValues(float p_ref, float p, float d) {
47  input->SetValue(0, 0, p_ref);
48  input->SetValue(1, 0, p);
49  input->SetValue(2, 0, d);
50}
51// TODO: add a combobox to choose between rad and deg
52void NestedSat::ConvertSatFromDegToRad(void) { pimpl_->k = Euler::ToRadian(1); }
53
54} // end namespace filter
55} // end namespace flair
Note: See TracBrowser for help on using the repository browser.