From 69d307ada308009f3bcbbfbe7db09e06c3bbf2c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Thu, 11 Jun 2020 16:54:14 +0200 Subject: [PATCH] WIP: Add structure to IM::getState() API --- include/core/processor/is_motion.h | 4 ++-- include/core/processor/processor_motion.h | 4 ++-- src/processor/processor_motion.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/core/processor/is_motion.h b/include/core/processor/is_motion.h index 2f725e18d..09d7bc68d 100644 --- a/include/core/processor/is_motion.h +++ b/include/core/processor/is_motion.h @@ -26,8 +26,8 @@ class IsMotion // Queries to the processor: virtual TimeStamp getTimeStamp() const = 0; - virtual VectorComposite getState() const = 0; - virtual VectorComposite getState(const TimeStamp& _ts) const = 0; + virtual VectorComposite getState(const StateStructure& _structure = "") const = 0; + virtual VectorComposite getState(const TimeStamp& _ts, const StateStructure& _structure = "") const = 0; std::string getStateStructure(){return state_structure_;}; void setStateStructure(std::string _state_structure){state_structure_ = _state_structure;}; diff --git a/include/core/processor/processor_motion.h b/include/core/processor/processor_motion.h index 4df3a67fb..ef155cee1 100644 --- a/include/core/processor/processor_motion.h +++ b/include/core/processor/processor_motion.h @@ -166,8 +166,8 @@ class ProcessorMotion : public ProcessorBase, public IsMotion // Queries to the processor: TimeStamp getTimeStamp() const override; - VectorComposite getState() const override; - VectorComposite getState(const TimeStamp& _ts) const override; + VectorComposite getState(const StateStructure& _structure = "") const override; + VectorComposite getState(const TimeStamp& _ts, const StateStructure& _structure = "") const override; /** \brief Gets the delta preintegrated covariance from all integrations so far * \return the delta preintegrated covariance matrix diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp index 23dd66ba1..9aea50f6c 100644 --- a/src/processor/processor_motion.cpp +++ b/src/processor/processor_motion.cpp @@ -400,7 +400,7 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr) postProcess(); } -VectorComposite ProcessorMotion::getState() const +VectorComposite ProcessorMotion::getState(const StateStructure& _structure) const { if (last_ptr_ == nullptr or last_ptr_->getFrame() == nullptr) // We do not have any info of where to find a valid state @@ -474,7 +474,7 @@ VectorComposite ProcessorMotion::getState() const // _x needs to have the size of the processor state -VectorComposite ProcessorMotion::getState(const TimeStamp& _ts) const +VectorComposite ProcessorMotion::getState(const TimeStamp& _ts, const StateStructure& _structure) const { // We need to search for the capture containing a motion buffer with the queried time stamp -- GitLab