From c210f37d7a57333d14849d1cd2fd8f798d2223a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu> Date: Wed, 23 Dec 2020 18:08:07 +0100 Subject: [PATCH] Raplace string --> StateStructure --- include/core/frame/frame_base.h | 4 ++-- include/core/state_block/has_state_blocks.h | 2 +- include/core/trajectory/trajectory_base.h | 3 ++- src/frame/frame_base.cpp | 4 ++-- src/processor/processor_motion.cpp | 4 ++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/core/frame/frame_base.h b/include/core/frame/frame_base.h index c4e423947..4c3e24fcd 100644 --- a/include/core/frame/frame_base.h +++ b/include/core/frame/frame_base.h @@ -54,11 +54,11 @@ class FrameBase : public NodeBase, public HasStateBlocks, public std::enable_sha StateBlockPtr _v_ptr = nullptr); FrameBase(const TimeStamp& _ts, - const std::string _frame_structure, + const StateStructure& _frame_structure, const VectorComposite& _state); FrameBase(const TimeStamp& _ts, - const std::string _frame_structure, + const StateStructure& _frame_structure, const std::list<VectorXd>& _vectors); ~FrameBase() override; diff --git a/include/core/state_block/has_state_blocks.h b/include/core/state_block/has_state_blocks.h index cc4764a4d..418e0909f 100644 --- a/include/core/state_block/has_state_blocks.h +++ b/include/core/state_block/has_state_blocks.h @@ -21,7 +21,7 @@ class HasStateBlocks { public: HasStateBlocks(); - HasStateBlocks(const std::string& _structure) : structure_(_structure), state_block_map_() {} + HasStateBlocks(const StateStructure& _structure) : structure_(_structure), state_block_map_() {} virtual ~HasStateBlocks(); const StateStructure& getStructure() const { return structure_; } diff --git a/include/core/trajectory/trajectory_base.h b/include/core/trajectory/trajectory_base.h index 23939e2e8..6029815eb 100644 --- a/include/core/trajectory/trajectory_base.h +++ b/include/core/trajectory/trajectory_base.h @@ -12,6 +12,7 @@ class FrameBase; #include "core/common/wolf.h" #include "core/common/node_base.h" #include "core/common/time_stamp.h" +#include "core/state_block/state_composite.h" //std includes @@ -56,7 +57,7 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj FrameMap frame_map_; protected: - std::string frame_structure_; // Defines the structure of the Frames in the Trajectory. + StateStructure frame_structure_; // Defines the structure of the Frames in the Trajectory. // FrameBasePtr last_key_frame_ptr_; // keeps pointer to the last key frame // FrameBasePtr last_key_or_aux_frame_ptr_; // keeps pointer to the last estimated frame diff --git a/src/frame/frame_base.cpp b/src/frame/frame_base.cpp index 515de7b3d..1ae177c0f 100644 --- a/src/frame/frame_base.cpp +++ b/src/frame/frame_base.cpp @@ -13,7 +13,7 @@ namespace wolf { unsigned int FrameBase::frame_id_count_ = 0; FrameBase::FrameBase(const TimeStamp& _ts, - const std::string _frame_structure, + const StateStructure& _frame_structure, const VectorComposite& _state) : NodeBase("FRAME", "FrameBase"), HasStateBlocks(_frame_structure), @@ -34,7 +34,7 @@ FrameBase::FrameBase(const TimeStamp& _ts, FrameBase::FrameBase(const TimeStamp& _ts, - const std::string _frame_structure, + const StateStructure& _frame_structure, const std::list<VectorXd>& _vectors) : NodeBase("FRAME", "FrameBase"), HasStateBlocks(_frame_structure), diff --git a/src/processor/processor_motion.cpp b/src/processor/processor_motion.cpp index 64536a919..ba21e4ccc 100644 --- a/src/processor/processor_motion.cpp +++ b/src/processor/processor_motion.cpp @@ -251,7 +251,7 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr) for (auto pair_ckey_vec : proc_state) if (!keyframe_from_callback->isInStructure(pair_ckey_vec.first)) keyframe_from_callback->addStateBlock(pair_ckey_vec.first, - FactoryStateBlock::create(pair_ckey_vec.first, + FactoryStateBlock::create(string(1, pair_ckey_vec.first), pair_ckey_vec.second, false)); keyframe_from_callback->setState(proc_state); @@ -352,7 +352,7 @@ void ProcessorMotion::processCapture(CaptureBasePtr _incoming_ptr) for (auto pair_ckey_vec : proc_state) if (!keyframe_from_callback->isInStructure(pair_ckey_vec.first)) keyframe_from_callback->addStateBlock(pair_ckey_vec.first, - FactoryStateBlock::create(pair_ckey_vec.first, + FactoryStateBlock::create(string(1, pair_ckey_vec.first), pair_ckey_vec.second, false)); keyframe_from_callback->setState(proc_state); -- GitLab