Last change
on this file since 7 was 7, checked in by Sanahuja Guillaume, 8 years ago |
filter and meta
|
File size:
1.1 KB
|
Rev | Line | |
---|
| 1 | // created: 2011/05/01
|
---|
| 2 | // filename: Pid.cpp
|
---|
| 3 | //
|
---|
| 4 | // author: Guillaume Sanahuja
|
---|
| 5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: $
|
---|
| 8 | //
|
---|
| 9 | // purpose: Class defining a PID
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | /*********************************************************************/
|
---|
| 13 |
|
---|
| 14 | #include "Pid.h"
|
---|
| 15 | #include "Pid_impl.h"
|
---|
| 16 | #include <cvmatrix.h>
|
---|
| 17 | #include <Layout.h>
|
---|
| 18 | #include <LayoutPosition.h>
|
---|
| 19 |
|
---|
| 20 | using std::string;
|
---|
| 21 | using namespace flair::core;
|
---|
| 22 | using namespace flair::gui;
|
---|
| 23 |
|
---|
| 24 | namespace flair { namespace filter {
|
---|
| 25 |
|
---|
| 26 | Pid::Pid(const LayoutPosition* position,string name) : ControlLaw(position->getLayout(),name) {
|
---|
| 27 | pimpl_=new Pid_impl(this,position,name);
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | Pid::~Pid(void) {
|
---|
| 31 | delete pimpl_;
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | void Pid::UseDefaultPlot(const gui::LayoutPosition* position) {
|
---|
| 35 | pimpl_->UseDefaultPlot(position);
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | void Pid::Reset(void) {
|
---|
| 39 | pimpl_->i=0;
|
---|
| 40 | pimpl_->first_update=true;
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | void Pid::UpdateFrom(const io_data *data) {
|
---|
| 44 | pimpl_->UpdateFrom(data);
|
---|
| 45 | ProcessUpdate(output);
|
---|
| 46 | }
|
---|
| 47 |
|
---|
| 48 | void Pid::SetValues(float p,float d) {
|
---|
| 49 | input->SetValue(0,0,p);
|
---|
| 50 | input->SetValue(1,0,d);
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | } // end namespace filter
|
---|
| 55 | } // end namespace flair
|
---|
Note:
See
TracBrowser
for help on using the repository browser.