vrecko
virtual reality framework
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
PosNoiseRemover.h
Go to the documentation of this file.
1
#include <
vrecko/Ability.h
>
2
#include <
vrecko/IOPins.h
>
3
#include <
helpers/DynamicArray.h
>
4
5
namespace
Filter {
6
7
class
PosNoiseRemover
:
public
vrecko::Ability
{
8
public
:
9
PosNoiseRemover
();
10
~PosNoiseRemover
() {};
11
12
void
preInitialize
(
void
);
13
void
processEvent
(
const
std::string &input_name,
void
*value);
14
15
bool
loadXMLParameters
(XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode
*pParametersNode);
16
XERCES_CPP_NAMESPACE_QUALIFIER
DOMNode
*
saveXMLParameters
(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *);
17
18
protected
:
19
20
// std::string out3String;
21
22
struct
SAMPLE
{
23
osg::Vec3
vec
;
24
osg::Timer_t
time
;
25
};
26
27
DynamicArray<SAMPLE>
pastSamples
;
28
29
bool
bOn
;
// is filtering on or off?
30
31
osg::Vec3
lastInput
,
lastResult
;
32
33
int
iCorrectedSamplesCounter
;
34
// Number of corrected samples IN ROW
35
36
float
fTolerance
;
37
// Maximum distance between two samples. The value is time-normalized,
38
// so it stores the distance per second.
39
int
iMaxPastSamples
;
40
// Currently, only the values 1 or 2 are supported.
41
// 1: If the new sample is too far from the last one, the system will always output the last value
42
// 2: If too far, the system will output value according to the [bExtrapolateCorrectValue] variable
43
int
iMaxCorrectedSamplesInRow
;
44
// Maximum of corrected samples IN ROW. If exceeded, we will clear the internal data
45
// and expect that samples are correct (and there was a mistake to correct them)
46
bool
bCompareExtrapolatedValue
;
47
// True: Will compare the new value with the extrapolated one from the last two samples.
48
bool
bExtrapolateCorrectValue
;
49
// True: If error, extrapolate the correct value.
50
// False: If error, use the last sample.
51
52
53
DECLARE_INPUT
(In3,
vrecko::MessageVec3
);
54
DECLARE_OUTPUT
(Out3,
vrecko::MessageVec3
);
55
};
56
57
}
include
vreckoAP
Filter
PosNoiseRemover.h
Generated on Tue Feb 19 2013 10:23:43 for vrecko by
1.8.3.1