43 const Eigen::MatrixXd& process_noise_covariance,
44 const std::vector<double>& filter_args)
102 bool previous_state_found =
false;
103 bool next_state_found =
false;
105 for (boost::circular_buffer<EstimatorState>::const_reverse_iterator it =
state_buffer_.rbegin();
113 if ( it->time_stamp == time )
118 else if ( it->time_stamp <= time )
120 last_state_before_time = *it;
121 previous_state_found =
true;
126 next_state_after_time = *it;
127 next_state_found =
true;
132 if ( previous_state_found && next_state_found )
134 interpolate(last_state_before_time, next_state_after_time, time, state);
139 else if ( previous_state_found )
146 else if ( next_state_found )
179 const double requested_time,
187 double delta = requested_time - boundary_state.
time_stamp;
192 state_at_req_time.
time_stamp = requested_time;
201 const double requested_time,
208 extrapolate(given_state_1, requested_time, state_at_req_time);
void setProcessNoiseCovariance(const Eigen::MatrixXd &processNoiseCovariance)
Sets the process noise covariance for the filter.
Extended Kalman filter class.
Unscented Kalman filter class.
const Eigen::VectorXd & getState()
Gets the filter state.
void clearBuffer()
Clears the internal state buffer.
void setEstimateErrorCovariance(const Eigen::MatrixXd &estimateErrorCovariance)
Manually sets the filter's estimate error covariance.
void setBufferCapacity(const int capacity)
Sets the buffer capacity.
virtual ~RobotLocalizationEstimator()
Destructor for the RobotLocalizationListener class.
void interpolate(const EstimatorState &given_state_1, const EstimatorState &given_state_2, const double requested_time, EstimatorState &state_at_req_time) const
Interpolates the given state to a requested time stamp.
double time_stamp
Time at which this state is/was achieved.
void setState(const EstimatorState &state)
Sets the current internal state of the listener.
boost::circular_buffer< EstimatorState > state_buffer_
The buffer holding the system states that have come in. Interpolation and extrapolation is done start...
EstimatorResult getState(const double time, EstimatorState &state) const
Returns the state at a given time.
Eigen::VectorXd state
System state at time = time_stamp.
virtual void predict(const double referenceTime, const double delta)=0
Carries out the predict step in the predict/update cycle. Projects the state and error matrices forwa...
Eigen::MatrixXd covariance
System state covariance at time = time_stamp.
FilterBase * filter_
A pointer to the filter instance that is used for extrapolation.
void extrapolate(const EstimatorState &boundary_state, const double requested_time, EstimatorState &state_at_req_time) const
Extrapolates the given state to a requested time stamp.
unsigned int getSize() const
Returns the current buffer size.
Robot Localization Estimator State.
const Eigen::MatrixXd & getEstimateErrorCovariance()
Gets the estimate error covariance.
void setState(const Eigen::VectorXd &state)
Manually sets the filter's state.
RobotLocalizationEstimator(unsigned int buffer_capacity, FilterType filter_type, const Eigen::MatrixXd &process_noise_covariance, const std::vector< double > &filter_args=std::vector< double >())
Constructor for the RobotLocalizationListener class.
unsigned int getBufferCapacity() const
Returns the buffer capacity.