diff --git a/src/problem.cpp b/src/problem.cpp index 191cffb50f474b2170ba42f80068e8088cc345ed..9305ae083559f90c991ca0436778030b543ebe88 100644 --- a/src/problem.cpp +++ b/src/problem.cpp @@ -27,7 +27,7 @@ std::string uppercase(std::string s) {for (auto & c: s) c = std::toupper(c); ret } -Problem::Problem(FrameStructure _frame_structure) : +Problem::Problem(const std::string& _frame_structure) : hardware_ptr_(std::make_shared<HardwareBase>()), trajectory_ptr_(std::make_shared<TrajectoryBase>(_frame_structure)), map_ptr_(std::make_shared<MapBase>()), @@ -44,7 +44,7 @@ void Problem::setup() map_ptr_->setProblem(shared_from_this()); } -ProblemPtr Problem::create(FrameStructure _frame_structure) +ProblemPtr Problem::create(const std::string& _frame_structure) { ProblemPtr p(new Problem(_frame_structure)); // We use `new` and not `make_shared` since the Problem constructor is private and cannot be passes to `make_shared`. p->setup(); diff --git a/src/problem.h b/src/problem.h index d12f0c33b714e9606a802b470874204ff7e81817..900c719f9a8e63e926336635a2891ea3d2ed1ce5 100644 --- a/src/problem.h +++ b/src/problem.h @@ -59,11 +59,11 @@ class Problem : public std::enable_shared_from_this<Problem> bool origin_is_set_; private: // CAUTION: THESE METHODS ARE PRIVATE, DO NOT MAKE THEM PUBLIC !! - Problem(FrameStructure _frame_structure); // USE create() below !! + Problem(const std::string& _frame_structure); // USE create() below !! void setup(); public: - static ProblemPtr create(FrameStructure _frame_structure); // USE THIS AS A CONSTRUCTOR! + static ProblemPtr create(const std::string& _frame_structure); // USE THIS AS A CONSTRUCTOR! virtual ~Problem(); // Properties ----------------------------------------- diff --git a/src/trajectory_base.cpp b/src/trajectory_base.cpp index 4f184aa881d26d6e9e9c53b803d8a77a3b0d1921..afade396af94c8e18eac6bcf329972fdd1c2bd8f 100644 --- a/src/trajectory_base.cpp +++ b/src/trajectory_base.cpp @@ -4,7 +4,7 @@ namespace wolf { -TrajectoryBase::TrajectoryBase(FrameStructure _frame_structure) : +TrajectoryBase::TrajectoryBase(const std::string& _frame_structure) : NodeBase("TRAJECTORY"), frame_structure_(_frame_structure), last_key_frame_ptr_(nullptr) diff --git a/src/trajectory_base.h b/src/trajectory_base.h index 5f7c17bb7c0d9b2db5d6537b4a41e7e7f34480bd..18c63e39e77f4f7d647dd4b03980e895ea6cc861 100644 --- a/src/trajectory_base.h +++ b/src/trajectory_base.h @@ -24,15 +24,15 @@ class TrajectoryBase : public NodeBase, public std::enable_shared_from_this<Traj std::list<FrameBasePtr> frame_list_; protected: - FrameStructure frame_structure_; // Defines the structure of the Frames in the Trajectory. + std::string frame_structure_; // Defines the structure of the Frames in the Trajectory. FrameBasePtr last_key_frame_ptr_; // keeps pointer to the last key frame public: - TrajectoryBase(FrameStructure _frame_sturcture); + TrajectoryBase(const std::string& _frame_sturcture); virtual ~TrajectoryBase(); // Properties - FrameStructure getFrameStructure() const; + std::string getFrameStructure() const; // Frames FrameBasePtr addFrame(FrameBasePtr _frame_ptr); @@ -83,7 +83,7 @@ inline void TrajectoryBase::setLastKeyFramePtr(FrameBasePtr _key_frame_ptr) } -inline FrameStructure TrajectoryBase::getFrameStructure() const +inline std::string TrajectoryBase::getFrameStructure() const { return frame_structure_; } diff --git a/src/wolf.h b/src/wolf.h index 4105c101ca6ca3691608fc7dca567cce3195eef6..490ce112f781fa678bb3af5133b8563cf74dcf61 100644 --- a/src/wolf.h +++ b/src/wolf.h @@ -189,8 +189,6 @@ typedef enum KEY_FRAME = 1 ///< key frame. It will stay in the frames window and play at optimizations. } FrameType; -typedef std::string FrameStructure; - /** \brief Enumeration of all possible constraints * * You may add items to this list as needed. Be concise with names, and document your entries.