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

Last change on this file since 15 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 2.5 KB
RevLine 
[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:    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
[15]31namespace flair {
32namespace filter {
[7]33
[15]34JoyReference::JoyReference(const LayoutPosition *position, string name)
35    : IODevice(position->getLayout(), name) {
36  pimpl_ = new JoyReference_impl(this, position, name);
37  AddDataToLog(pimpl_->output);
38  AddDataToLog(pimpl_->ahrsData);
[7]39}
40
[15]41JoyReference::~JoyReference(void) { delete pimpl_; }
[7]42
[15]43AhrsData *JoyReference::GetReferenceOrientation(void) const {
44  return pimpl_->ahrsData;
[7]45}
46
[15]47void JoyReference::SetRollAxis(float value) { pimpl_->SetRollAxis(value); }
[7]48
[15]49void JoyReference::SetPitchAxis(float value) { pimpl_->SetPitchAxis(value); }
[7]50
[15]51void JoyReference::SetYawAxis(float value) { pimpl_->SetYawAxis(value); }
[7]52
53void JoyReference::SetAltitudeAxis(float value) {
[15]54  pimpl_->SetAltitudeAxis(value);
[7]55}
56
[15]57void JoyReference::RollTrimUp(void) { pimpl_->RollTrimUp(); }
[7]58
[15]59void JoyReference::RollTrimDown(void) { pimpl_->RollTrimDown(); }
[7]60
[15]61void JoyReference::PitchTrimUp(void) { pimpl_->PitchTrimUp(); }
[7]62
[15]63void JoyReference::PitchTrimDown(void) { pimpl_->PitchTrimDown(); }
[7]64
[15]65void JoyReference::SetYawRef(float value) { pimpl_->SetYawRef(value); }
[7]66
67void JoyReference::SetYawRef(core::Quaternion const &value) {
[15]68  Euler euler;
69  value.ToEuler(euler);
70  pimpl_->SetYawRef(euler.yaw);
[7]71}
[15]72void JoyReference::SetZRef(float value) { pimpl_->SetZRef(value); }
[7]73
[15]74float JoyReference::ZRef(void) const { return pimpl_->ZRef(); }
[7]75
[15]76float JoyReference::DzRef(void) const { return pimpl_->dZRef(); }
[7]77
[15]78float JoyReference::RollTrim(void) const { return pimpl_->RollTrim(); }
[7]79
[15]80float JoyReference::PitchTrim(void) const { return pimpl_->PitchTrim(); }
[7]81
82void JoyReference::Update(Time time) {
[15]83  pimpl_->Update(time);
84  ProcessUpdate(pimpl_->output);
[7]85}
86
87void JoyReference::UpdateFrom(const io_data *data) {
[15]88  pimpl_->UpdateFrom(data);
89  ProcessUpdate(pimpl_->output);
[7]90}
91
92} // end namespace sensor
93} // end namespace flair
Note: See TracBrowser for help on using the repository browser.