VR-Link API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
deadReckoner.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2014 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vlpi/approximator.h>
13 #include <vlpi/disEnums.h>
14 
15 #include <matrix/vlTaitBryan.h>
16 #include <matrix/vlVector.h>
17 #include <matrix/vlDcm.h>
18 
31 {
32 public:
33 
36 
38  DtDeadReckoner( const DtDeadReckoner& orig );
39 
41  virtual ~DtDeadReckoner();
42 
45 
48  virtual DtApproximator* clone() const;
49 
51  virtual void setLocation( const DtVector& loc, DtTime curTime );
52 
55  virtual const DtVector& approxLocation( DtTime curTime ) const;
56 
58  virtual const DtVector& deadReckonedLocation( DtTime curTime ) const;
59 
61  virtual void setVelocity( const DtVector& vel, DtTime curTime );
62 
65  virtual const DtVector& approxVelocity( DtTime curTime ) const;
66 
68  virtual const DtVector& deadReckonedVelocity( DtTime curTime ) const;
69 
71  virtual void setOrientation( const DtTaitBryan& ori, DtTime curTime );
72 
75  virtual const DtTaitBryan& approxEuler( DtTime curTime ) const;
76 
78  virtual const DtTaitBryan& deadReckonedEuler( DtTime curTime ) const;
79 
81  virtual const DtTime& locationUpdateTime() const;
82 
84  virtual const DtTime& velocityUpdateTime() const;
85 
87  virtual const DtTime& orientationUpdateTime() const;
88 
90  virtual void setAcceleration( const DtVector& acc, DtTime curTime );
91  virtual const DtVector& acceleration( DtTime curTime ) const;
92 
94  virtual void setRotationalVelocity( const DtVector& vel, DtTime curTime );
95  virtual const DtVector& rotationalVelocity( DtTime curTime ) const;
96 
99  virtual const DtDcm& approxBodyToGeoc( DtTime curTime ) const;
100 
102  virtual const DtDcm& deadReckonedBodyToGeoc( DtTime curTime ) const;
103 
106  virtual void setAlgorithm( DtDeadReckonTypes alg );
107  virtual DtDeadReckonTypes algorithm() const;
108 
111 
114  virtual int isRotational() const;
115 
120  virtual void deadReckonPosition( DtTime dt, const DtVector& oldPos,
121  const DtVector& oldVel, const DtVector& oldAccel,
122  DtVector& newVel, DtVector& newPos ) const;
123 
128  virtual void deadReckonOrientation( DtTime dt, const DtDcm& old_b2w,
129  const DtDirectedRotRate& drr, DtDcm& new_b2w ) const;
130 
132 
135 
138  static int isRotational( DtDeadReckonTypes algorithm );
139 
141  static void deadReckonPosition( DtTime dt, DtDeadReckonTypes algorithm,
142  const DtVector& oldPos, const DtVector& oldVel, const DtVector& oldAccel,
143  DtVector& newVel, DtVector& newPos );
144 
146  static void deadReckonOrientation( DtTime dt, DtDeadReckonTypes algorithm,
147  const DtDcm& old_b2w, const DtDirectedRotRate& drr, DtDcm& new_b2w );
148 
150 
151 protected:
152 
156  virtual void deadReckonLoc( DtTime curTime ) const;
157 
161  virtual void deadReckonBodyToGeoc( DtTime curTime ) const;
162 
166  virtual void deadReckonEuler( DtTime curTime ) const;
167 
168 protected:
169 
175 
176  mutable DtVector myDRLoc;
177  mutable DtVector myDRVel;
183 
188 
189 };
190 
192 {
193  deadReckonLoc( curTime );
194  return myDRLoc;
195 }
196 
197 inline const DtVector& DtDeadReckoner::approxLocation( DtTime curTime ) const
198 {
199  return deadReckonedLocation( curTime );
200 }
201 
203 {
204  deadReckonLoc( curTime );
205  return myDRVel;
206 }
207 
208 inline const DtVector& DtDeadReckoner::approxVelocity( DtTime curTime ) const
209 {
210  return deadReckonedVelocity( curTime );
211 }
212 
214 {
215  deadReckonBodyToGeoc( curTime );
216  return myDRBodyToGeoc;
217 }
218 
219 inline const DtDcm& DtDeadReckoner::approxBodyToGeoc( DtTime curTime ) const
220 {
221  return deadReckonedBodyToGeoc( curTime );
222 }
223 
225 {
226  deadReckonEuler( curTime );
227  return myDREuler;
228 }
229 
230 inline const DtTaitBryan& DtDeadReckoner::approxEuler( DtTime curTime ) const
231 {
232  return deadReckonedEuler( curTime );
233 }
234 
236 {
237  return mySimTimePosDataValid;
238 }
239 
241 {
242  // This is the same as Position, because velocity is recalculated
243  // jointly in this implementation of deadreckoning.
244  return mySimTimePosDataValid;
245 }
246 
248 {
250 }
251 
253 {
254  myAlgorithm = alg;
255 }
256 
258 {
259  return myAlgorithm;
260 }
261 
262 inline const DtVector& DtDeadReckoner::acceleration( DtTime curTime ) const
263 {
264  return myAccel;
265 }
266 
267 inline const DtVector& DtDeadReckoner::rotationalVelocity( DtTime curTime ) const
268 {
269  return myRotVel;
270 }

Document ID: Generated on Wed Jan 7 13:31:29 EST 2015 from SVN revision 149162
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)