OSVR-Core
AugmentedProcessModel.h
Go to the documentation of this file.
1 
11 // Copyright 2015 Sensics, Inc.
12 //
13 // Licensed under the Apache License, Version 2.0 (the "License");
14 // you may not use this file except in compliance with the License.
15 // You may obtain a copy of the License at
16 //
17 // http://www.apache.org/licenses/LICENSE-2.0
18 //
19 // Unless required by applicable law or agreed to in writing, software
20 // distributed under the License is distributed on an "AS IS" BASIS,
21 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 // See the License for the specific language governing permissions and
23 // limitations under the License.
24 
25 #ifndef INCLUDED_AugmentedProcessModel_h_GUID_8A98A9D0_A8E4_4094_639A_25C4285B5F56
26 #define INCLUDED_AugmentedProcessModel_h_GUID_8A98A9D0_A8E4_4094_639A_25C4285B5F56
27 
28 // Internal Includes
29 #include "AugmentedState.h"
30 
31 // Library/third-party includes
32 // - none
33 
34 // Standard includes
35 // - none
36 #include <type_traits>
37 
38 namespace osvr {
39 namespace kalman {
42  template <typename ModelA, typename ModelB> class AugmentedProcessModel {
43  public:
44  using ModelTypeA = ModelA;
45  using ModelTypeB = ModelB;
46  using StateA = typename ModelA::State;
47  using StateB = typename ModelB::State;
49 
51  AugmentedProcessModel(ModelTypeA &modA, ModelTypeB &modB)
52  : a_(modA), b_(modB) {}
53 
55  AugmentedProcessModel(AugmentedProcessModel const &other) = default;
56 
59  : a_(other.a_), b_(other.b_) {}
62  operator=(AugmentedProcessModel const &other) = delete;
65  void predictState(State &state, double dt) {
66  modelA().predictState(state.a(), dt);
67  modelB().predictState(state.b(), dt);
68  }
70 
73  ModelTypeA &modelA() { return a_; }
74  ModelTypeA const &modelA() const { return a_; }
75 
76  ModelTypeB &modelB() { return b_; }
77  ModelTypeB const &modelB() const { return b_; }
79  private:
80  ModelTypeA &a_;
81  ModelTypeB &b_;
82  };
85  template <typename ModelA, typename ModelB>
88  typename std::remove_const<ModelB>::type>;
89 
92  template <typename ModelA, typename ModelB>
94  makeAugmentedProcessModel(ModelA &a, ModelB &b) {
96  }
97 
98 } // namespace kalman
99 } // namespace osvr
100 #endif // INCLUDED_AugmentedProcessModel_h_GUID_8A98A9D0_A8E4_4094_639A_25C4285B5F56
DeducedAugmentedProcessModel< ModelA, ModelB > makeAugmentedProcessModel(ModelA &a, ModelB &b)
Factory function, akin to std::tie(), to make an augmented process model.
Definition: AugmentedProcessModel.h:94
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
AugmentedProcessModel(AugmentedProcessModel &&other)
Move constructor.
Definition: AugmentedProcessModel.h:58
AugmentedProcessModel & operator=(AugmentedProcessModel const &other)=delete
non-assignable
AugmentedProcessModel(ModelTypeA &modA, ModelTypeB &modB)
Constructor.
Definition: AugmentedProcessModel.h:51
State type that consists entirely of references to two independent sub-states.
Definition: AugmentedState.h:41
StateTypeB & b()
Access the second part of the state.
Definition: AugmentedState.h:116
Process model type that consists entirely of references to two sub-process models, for operating on an AugmentedState<>.
Definition: AugmentedProcessModel.h:42