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

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

lic

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