VR-Link API Documentation for DIS
Home
Namespaces
Classes
Files
Examples
Libraries
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vlpi
smoothUtil.h
Go to the documentation of this file.
1
/*********************************************************************
2
** Copyright (c) 1992-2010 VT MAK
3
** All rights reserved.
4
*********************************************************************/
5
6
9
10
#ifndef DtSmoothPos_H_
11
#define DtSmoothPos_H_
12
13
#include <
matrix/vlMath.h
>
14
#include <
matrix/vlDcm.h
>
15
#include <
matrix/vlVector.h
>
16
#include <
vlutil/vlTime.h
>
17
#include <
vlutil/vlPrint.h
>
18
20
class
DT_DLL_VLPROTIND
DtSmoothPos
21
{
22
public
:
23
26
DtSmoothPos
(
void
*usr,
DtTime
smoothT,
27
const
DtVector
& pos,
const
DtVector32
& vel,
const
DtVector32
& acc);
29
DtSmoothPos
(
void
*usr,
DtTime
smoothT);
30
31
virtual
~DtSmoothPos
() {}
32
34
DtSmoothPos
(
const
DtSmoothPos
&);
35
37
DtSmoothPos
& operator=(
const
DtSmoothPos
&);
38
39
public
:
40
41
void
input(
const
DtVector
& pos,
const
DtVector32
& vel,
const
DtVector32
& acc,
42
DtTime
simTime,
int
freeze=0);
43
void
tick
(
DtTime
simTime);
44
45
const
DtVector
&
position
()
const
{
return
ps; }
46
const
DtVector32
&
velocity
()
const
{
return
vs; }
47
52
virtual
void
setSmoothEnable(
int
on);
53
virtual
int
smoothEnable()
const
;
54
57
virtual
void
setSmoothPeriod(
DtTime
t);
58
virtual
DtTime
smoothPeriod()
const
;
59
62
virtual
void
reset();
63
64
public
:
65
67
static
void
setDfltSmoothPeriod(
DtTime
t);
68
static
DtTime
dfltSmoothPeriod();
69
71
static
void
setMasterSmoothEnable(
bool
onOff);
72
static
bool
masterSmoothEnable();
73
74
protected
:
75
76
77
virtual
void
dfltAction(
DtTime
simTime,
void
*usr,
78
DtVector32
& vs,
DtVector
& ps) = 0;
79
void
init(
void
*u,
DtTime
t);
80
void
setT1data();
81
82
protected
:
83
84
int
myFrozen
;
85
86
DtTime
myT0
;
87
DtTime
myT1
;
88
DtTime
myT2
;
89
DtTime
myLastT
;
90
91
DtTime
myLocalTau
;
92
DtTime
myLocalHtau
;
93
DtTime
myLocalTauInv
;
94
DtTime
*
myTau
;
95
DtTime
*
myHtau
;
96
DtTime
*
myTauInv
;
97
98
DtVector
ps
, p0, dp, p1;
99
DtVector32
vs
, v0, v1, dv;
100
DtVector32
a1, a2,
ap
;
101
int
myEnable
;
102
int
myNeedT1Data
;
103
int
myNeedT2Data
;
104
void
*
myUsr
;
105
106
protected
:
107
108
static
DtTime
theDfltTau
;
109
static
DtTime
theDfltHtau
;
110
static
DtTime
theDfltTauInv
;
111
static
bool
theMasterSmoothEnable
;
112
};
113
114
117
class
DT_DLL_VLPROTIND
DtSmoothOrient
118
{
119
public
:
120
123
DtSmoothOrient
(
void
*usr,
DtTime
smoothT,
124
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr);
126
DtSmoothOrient
(
void
*usr,
DtTime
smoothT);
127
128
virtual
~DtSmoothOrient
() {}
129
131
DtSmoothOrient
(
const
DtSmoothOrient
&);
132
134
DtSmoothOrient
& operator=(
const
DtSmoothOrient
&);
135
136
void
input(
const
DtDcm
& orient,
const
DtDirectedRotRate
&drr,
137
DtTime
simTime,
int
freeze=0);
138
void
tick
(
DtTime
simTime);
139
140
const
DtDcm
&
orientation
()
const
{
return
myOs; }
141
146
virtual
void
setSmoothEnable(
int
on);
147
virtual
int
smoothEnable()
const
;
148
151
virtual
void
setSmoothPeriod(
DtTime
t);
152
virtual
DtTime
smoothPeriod()
const
;
153
156
virtual
void
reset();
157
158
public
:
159
161
static
void
setDfltSmoothPeriod(
DtTime
t);
162
static
DtTime
dfltSmoothPeriod();
163
165
static
void
setMasterSmoothEnable(
bool
onOff);
166
static
bool
masterSmoothEnable();
167
169
static
void
setDfltSmoothPrecision(
double
t);
170
static
double
dfltSmoothPrecision();
171
172
protected
:
173
174
virtual
void
dfltAction(
DtTime
simTime,
void
*usr,
DtDcm
& os) = 0;
175
void
init(
void
*u,
DtTime
t);
176
void
setT1data();
177
178
protected
:
179
180
int
myFrozen
;
181
DtTime
myT0,
myT2
, myLastT;
182
DtTime
*
myTau
;
183
DtTime
myLocalTau
;
184
DtDcm
myOs
, myO0;
185
DtVector
myWs
;
186
int
myEnable
;
187
void
*
myUsr
;
188
double
myPrecision
;
189
190
protected
:
191
192
static
DtTime
theDfltTau
;
193
static
bool
theMasterSmoothEnable
;
194
static
double
theDfltPrecision
;
195
};
196
197
198
inline
DtTime
DtSmoothPos::smoothPeriod
()
const
199
{
200
return
*
myTau
;
201
}
202
203
inline
DtTime
DtSmoothOrient::smoothPeriod
()
const
204
{
205
return
*
myTau
;
206
}
207
208
#endif
/* _SMOOTHUTIL_H_ */
209
Document ID: Generated on Mon Jun 22 21:18:40 EDT 2020 from SVN revision 213785
Copyright © 2005-2018 MAK Technologies. All Rights Reserved (
www.mak.com
)