source: flair-src/trunk/lib/FlairSensorActuator/src/VrpnObject.cpp @ 157

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

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File size: 2.1 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/03
6//  filename:   VrpnObject.cpp
7//
8//  author:     César Richard, Guillaume Sanahuja
9//              Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11//  version:    $Id: $
12//
13//  purpose:    Class for VRPN object
14//
15//
16/*********************************************************************/
17
18#include "VrpnObject.h"
19#include "VrpnObject_impl.h"
20#include "VrpnClient.h"
21#include <string.h>
22
23#include <cvmatrix.h>
24
25using std::string;
26using namespace flair::core;
27using namespace flair::gui;
28
29namespace flair {
30namespace sensor {
31
32VrpnObject::VrpnObject(string name,
33                       const TabWidget *tab)
34    : IODevice(GetVrpnClient(), name) {
35  pimpl_ = new VrpnObject_impl(this, name, -1, tab);
36  AddDataToLog(pimpl_->output);
37 
38  SetIsReady(true);
39}
40
41VrpnObject::VrpnObject(string name, uint8_t id,
42                       const TabWidget *tab)
43    : IODevice(GetVrpnClient(), name) {
44  Warn("Creation of object %s with id %i\n", name.c_str(), id);
45  pimpl_ = new VrpnObject_impl(this, name, id, tab);
46  AddDataToLog(pimpl_->output);
47 
48  SetIsReady(true);
49}
50
51VrpnObject::~VrpnObject(void) { 
52  delete pimpl_;
53}
54
55cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
56
57cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
58
59Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
60
61DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
62
63DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
64
65DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
66
67Time VrpnObject::GetLastPacketTime(void) const {
68  return pimpl_->output->DataTime();
69}
70
71bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
72  return pimpl_->IsTracked(timeout_ms);
73}
74
75void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
76  pimpl_->GetQuaternion(quaternion);
77}
78
79void VrpnObject::GetPosition(Vector3D &point) const {
80  pimpl_->GetPosition(point);
81}
82
83} // end namespace sensor
84} // end namespace flair
Note: See TracBrowser for help on using the repository browser.