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

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

VrpnObject no longer outputs Euler (ony Quaternion): warning, output matrix has changed!

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
39VrpnObject::VrpnObject(string name, uint8_t id,
40 const TabWidget *tab)
41 : IODevice(GetVrpnClient(), name) {
42 Warn("Creation of object %s with id %i\n", name.c_str(), id);
43 pimpl_ = new VrpnObject_impl(this, name, id, tab);
44 AddDataToLog(pimpl_->output);
45}
46
47VrpnObject::~VrpnObject(void) { delete pimpl_; }
48
49cvmatrix *VrpnObject::Output(void) const { return pimpl_->output; }
50
51cvmatrix *VrpnObject::State(void) const { return pimpl_->state; }
52
53Tab *VrpnObject::GetPlotTab(void) const { return pimpl_->plot_tab; }
54
55DataPlot1D *VrpnObject::xPlot(void) const { return pimpl_->x_plot; }
56
57DataPlot1D *VrpnObject::yPlot(void) const { return pimpl_->y_plot; }
58
59DataPlot1D *VrpnObject::zPlot(void) const { return pimpl_->z_plot; }
60
61Time VrpnObject::GetLastPacketTime(void) const {
62 return pimpl_->output->DataTime();
63}
64
65bool VrpnObject::IsTracked(unsigned int timeout_ms) const {
66 return pimpl_->IsTracked(timeout_ms);
67}
68
69void VrpnObject::GetQuaternion(Quaternion &quaternion) const {
70 pimpl_->GetQuaternion(quaternion);
71}
72
73void VrpnObject::GetPosition(Vector3D &point) const {
74 pimpl_->GetPosition(point);
75}
76
77void VrpnObject::mainloop(void) { pimpl_->mainloop(); }
78
79} // end namespace sensor
80} // end namespace flair
Note: See TracBrowser for help on using the repository browser.