From 3b0f0774e5f5b0ed4f296cc55b5b8eecc50029e2 Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Sat, 18 Mar 2017 15:14:06 -0500 Subject: Add State class The State class contains the body and feature classes. It is responsible for composing matrices, and performing Kalman updates. --- src/state.cpp | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/state.cpp (limited to 'src/state.cpp') diff --git a/src/state.cpp b/src/state.cpp new file mode 100644 index 0000000..8aadb64 --- /dev/null +++ b/src/state.cpp @@ -0,0 +1,37 @@ +/* + * ===================================================================================== + * + * Filename: state.cpp + * + * Description: A Class for managing body and features. + * + * Version: 1.0 + * Created: 03/17/2017 07:55:56 PM + * Revision: none + * Compiler: gcc + * + * Author: Martin Miller (MHM), miller7@illinois.edu + * Organization: Aerospace Robotics and Controls Lab (ARC) + * + * ===================================================================================== + */ +#include "state.h" + + +/* + *-------------------------------------------------------------------------------------- + * Class: State + * Method: State :: Pkk1 + * Description: Updates P_k|k-1 + *-------------------------------------------------------------------------------------- + */ + void +State::Pkk1 ( Matrix &P, const Matrix &F, + const Matrix &Q ) +{ + P = F*P*F.transpose()+Q; + // Enforce symmetry + P = 0.5*(P+P.transpose()); + return ; +} /* ----- end of method State::Pkk1 ----- */ + -- cgit v1.1