source: flair-src/trunk/lib/FlairFilter/src/JoyReference.cpp@ 7

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

filter and meta

File size: 2.4 KB
Line 
1// created: 2012/08/29
2// filename: JoyReference.cpp
3//
4// author: Guillaume Sanahuja
5// Copyright Heudiasyc UMR UTC/CNRS 7253
6//
7// version: $Id: $
8//
9// purpose: generation de consignes a partir joystick
10//
11//
12/*********************************************************************/
13
14#include "JoyReference.h"
15#include "JoyReference_impl.h"
16#include <Layout.h>
17#include <LayoutPosition.h>
18#include <cvmatrix.h>
19#include <AhrsData.h>
20#include <Euler.h>
21#include <Quaternion.h>
22
23using std::string;
24using namespace flair::core;
25using namespace flair::gui;
26
27namespace flair { namespace filter {
28
29JoyReference::JoyReference(const LayoutPosition* position,string name) : IODevice(position->getLayout(),name) {
30 pimpl_=new JoyReference_impl(this,position,name);
31 AddDataToLog(pimpl_->output);
32 AddDataToLog(pimpl_->ahrsData);
33}
34
35JoyReference::~JoyReference(void) {
36 delete pimpl_;
37}
38
39AhrsData* JoyReference::GetReferenceOrientation(void) const{
40 return pimpl_->ahrsData;
41}
42
43void JoyReference::SetRollAxis(float value) {
44 pimpl_->SetRollAxis(value);
45}
46
47void JoyReference::SetPitchAxis(float value) {
48 pimpl_->SetPitchAxis(value);
49}
50
51void JoyReference::SetYawAxis(float value) {
52 pimpl_->SetYawAxis(value);
53}
54
55void JoyReference::SetAltitudeAxis(float value) {
56 pimpl_->SetAltitudeAxis(value);
57}
58
59void JoyReference::RollTrimUp(void) {
60 pimpl_->RollTrimUp();
61}
62
63void JoyReference::RollTrimDown(void) {
64 pimpl_->RollTrimDown();
65}
66
67void JoyReference::PitchTrimUp(void) {
68 pimpl_->PitchTrimUp();
69}
70
71void JoyReference::PitchTrimDown(void) {
72 pimpl_->PitchTrimDown();
73}
74
75void JoyReference::SetYawRef(float value) {
76 pimpl_->SetYawRef(value);
77}
78
79void JoyReference::SetYawRef(core::Quaternion const &value) {
80 Euler euler;
81 value.ToEuler(euler);
82 pimpl_->SetYawRef(euler.yaw);
83}
84void JoyReference::SetZRef(float value) {
85 pimpl_->SetZRef(value);
86}
87
88float JoyReference::ZRef(void) const {
89 return pimpl_->ZRef();
90}
91
92float JoyReference::DzRef(void) const {
93 return pimpl_->dZRef();
94}
95
96float JoyReference::RollTrim(void) const {
97 return pimpl_->RollTrim();
98}
99
100float JoyReference::PitchTrim(void) const {
101 return pimpl_->PitchTrim();
102}
103
104void JoyReference::Update(Time time) {
105 pimpl_->Update(time);
106 ProcessUpdate(pimpl_->output);
107}
108
109void JoyReference::UpdateFrom(const io_data *data) {
110 pimpl_->UpdateFrom(data);
111 ProcessUpdate(pimpl_->output);
112}
113
114} // end namespace sensor
115} // end namespace flair
116
Note: See TracBrowser for help on using the repository browser.