RecursiveEstimatorFilterInterface.h
Go to the documentation of this file.
1 /*
2  * RecursiveEstimatorFilterInterface.h
3  *
4  * Author: roberto
5  *
6  * This is a modified implementation of the method for online estimation of kinematic structures described in our paper
7  * "Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors"
8  * (Martín-Martín and Brock, 2014).
9  * This implementation can be used to reproduce the results of the paper and to be applied to new research.
10  * The implementation allows also to be extended to perceive different information/models or to use additional sources of information.
11  * A detail explanation of the method and the system can be found in our paper.
12  *
13  * If you are using this implementation in your research, please consider citing our work:
14  *
15 @inproceedings{martinmartin_ip_iros_2014,
16 Title = {Online Interactive Perception of Articulated Objects with Multi-Level Recursive Estimation Based on Task-Specific Priors},
17 Author = {Roberto {Mart\'in-Mart\'in} and Oliver Brock},
18 Booktitle = {Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems},
19 Pages = {2494-2501},
20 Year = {2014},
21 Location = {Chicago, Illinois, USA},
22 Note = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
23 Url = {http://www.robotics.tu-berlin.de/fileadmin/fg170/Publikationen_pdf/martinmartin_ip_iros_2014.pdf},
24 Projectname = {Interactive Perception}
25 }
26  * If you have questions or suggestions, contact us:
27  * roberto.martinmartin@tu-berlin.de
28  *
29  * Enjoy!
30  */
31 
32 #ifndef RECURSIVE_ESTIMATOR_INTERFACE_H_
33 #define RECURSIVE_ESTIMATOR_INTERFACE_H_
34 
35 #include <vector>
36 #include <string>
37 #include <iostream>
38 
39 namespace omip
40 {
41 
49 template <class StateType, class MeasurementType>
51 {
52 public:
53 
58  RecursiveEstimatorFilterInterface(double loop_period_ns) :
59  _loop_period_ns(loop_period_ns),
60  _state(),
62  _measurement(),
66  {
67 
68  }
69 
75  {
76 
77  }
78 
83  virtual void predictState(double time_interval_ns) = 0;
84 
89  virtual void predictMeasurement() = 0;
90 
96  virtual void correctState() = 0;
97 
103  virtual void setMeasurement(const MeasurementType& acquired_measurement, const double& measurement_timestamp)
104  {
105  this->_measurement = acquired_measurement;
107  this->_measurement_timestamp_ns = measurement_timestamp;
108  }
109 
116  virtual void addPredictedState(const StateType& predicted_state, const double& predicted_state_timestamp_ns) = 0;
117 
123  virtual MeasurementType getPredictedMeasurement() const
124  {
125  return this->_predicted_measurement;
126  }
127 
133  virtual StateType getState() const
134  {
135  return this->_state;
136  }
137 
138 protected:
139 
140  StateType _state;
141  MeasurementType _measurement;
142 
143  // Period of the recursive loop. It is also the period of the measurements. This time is used to predict the next state (and then the next measurement)
144  // at the end of one processing loop, so that the prediction can:
145  // 1> be passed to the lower level as alternative predicted next state
146  // 2> as predicted measurement for this level, which we compare to the acquired measurement to correct the state
147  // If we lose some ticks (computing time is longer than the loop period) we will have to predict again using the real interval between measurements
149 
150  // Timestamp of the last measurement in nano seconds
152 
153  // Timestamp of the previous acquired (and processed) measurement in nano seconds
154  // We use the difference between timestamps of last and previous measurements to compute the "real" loop period in the last iteration and decide if it is
155  // close enough to our expected loop period (valid predictions) or if we have lost some ticks (recompute predictions)
157 
158  std::string _filter_name;
159 
160  //We use a vector because we can have more than one predicted state. Usually we will have two: the predicted state using the internal model
161  //and the predicted state coming from the higher level (is the predicted next measurement of the next level)
162  //The normal procedure is to test both and use the most likely one
163  std::vector<StateType> _predicted_states;
164 
165  //We find the most likely predicted state and store it here
167 
168  MeasurementType _predicted_measurement;
169 
170 };
171 }
172 
173 #endif /* RECURSIVE_ESTIMATOR_INTERFACE_H_ */
virtual void setMeasurement(const MeasurementType &acquired_measurement, const double &measurement_timestamp)
Set the latest acquired measurement.
virtual void predictState(double time_interval_ns)=0
First step when updating the filter. The next state is predicted from current state and system model...
virtual StateType getState() const
Get the currently belief state.
virtual void predictMeasurement()=0
Second step when updating the filter. The next measurement is predicted from the predicted next state...
virtual void addPredictedState(const StateType &predicted_state, const double &predicted_state_timestamp_ns)=0
Add a new prediction about the state generated in the higher level (as prediction about the next meas...
Definition: Feature.h:40
RecursiveEstimatorFilterInterface(double loop_period_ns)
Constructor.
This class defines an INTERFACE that all recursive estimator filters need to implement It is ROS free...
virtual MeasurementType getPredictedMeasurement() const
Get the predicted next measurement.
virtual void correctState()=0
Third and final step when updating the filter. The predicted next state is corrected based on the dif...


omip_common
Author(s): Roberto Martín-Martín
autogenerated on Mon Jun 10 2019 14:06:05