3636
3737#include < fuse_core/fuse_macros.h>
3838#include < fuse_core/serialization.h>
39- #include < fuse_variables/fixed_size_variable .h>
39+ #include < fuse_variables/point_3d_landmark .h>
4040
4141#include < boost/serialization/access.hpp>
4242#include < boost/serialization/base_object.hpp>
4343#include < boost/serialization/export.hpp>
4444
45- #include < ostream>
46-
4745namespace fuse_variables
4846{
4947/* *
5048 * @brief Variable representing a 3D point landmark that exists across time.
5149 *
52- * This is commonly used to represent locations of visual features. The UUID of this class is constant after
53- * construction and dependent on a user input database id. As such, the database id cannot be altered after
54- * construction.
50+ * This is commonly used to represent locations of visual features. This class differs from the Point3DLandmark in that
51+ * the value of the landmark is held constant during optimization. This is appropriate if the landmark positions are
52+ * known or were previously estimated to sufficient accuracy. The UUID of this class is constant after construction and
53+ * dependent on a user input database id. As such, the database id cannot be altered after construction.
5554 */
56- class Point3DFixedLandmark : public FixedSizeVariable < 3 >
55+ class Point3DFixedLandmark : public Point3DLandmark
5756{
5857public:
5958 FUSE_VARIABLE_DEFINITIONS (Point3DFixedLandmark);
6059
61- /* *
62- * @brief Can be used to directly index variables in the data array
63- */
64- enum : size_t
65- {
66- X = 0 ,
67- Y = 1 ,
68- Z = 2
69- };
70-
7160 /* *
7261 * @brief Default constructor
7362 */
@@ -80,58 +69,14 @@ class Point3DFixedLandmark : public FixedSizeVariable<3>
8069 */
8170 explicit Point3DFixedLandmark (const uint64_t & landmark_id);
8271
83- /* *
84- * @brief Read-write access to the X-axis position.
85- */
86- double & x () { return data_[X]; }
87-
88- /* *
89- * @brief Read-only access to the X-axis position.
90- */
91- const double & x () const { return data_[X]; }
92-
93- /* *
94- * @brief Read-write access to the Y-axis position.
95- */
96- double & y () { return data_[Y]; }
97-
98- /* *
99- * @brief Read-only access to the Y-axis position.
100- */
101- const double & y () const { return data_[Y]; }
102-
103- /* *
104- * @brief Read-write access to the Z-axis position.
105- */
106- double & z () { return data_[Z]; }
107-
108- /* *
109- * @brief Read-only access to the Z-axis position.
110- */
111- const double & z () const { return data_[Z]; }
112-
113- /* *
114- * @brief Read-only access to the id
115- */
116- const uint64_t & id () const { return id_; }
117-
118- /* *
119- * @brief Print a human-readable description of the variable to the provided
120- * stream.
121- *
122- * @param[out] stream The stream to write to. Defaults to stdout.
123- */
124- void print (std::ostream& stream = std::cout) const override ;
125-
12672 /* *
12773 * @brief Specifies if the value of the variable should not be changed during optimization
12874 */
129- bool holdConstant () const override ;
75+ bool holdConstant () const override { return true ; }
13076
13177private:
13278 // Allow Boost Serialization access to private methods
13379 friend class boost ::serialization::access;
134- uint64_t id_ { 0 };
13580
13681 /* *
13782 * @brief The Boost Serialize method that serializes all of the data members
@@ -145,8 +90,7 @@ class Point3DFixedLandmark : public FixedSizeVariable<3>
14590 template <class Archive >
14691 void serialize (Archive& archive, const unsigned int /* version */ )
14792 {
148- archive& boost::serialization::base_object<FixedSizeVariable<SIZE>>(*this );
149- archive& id_;
93+ archive& boost::serialization::base_object<Point3DLandmark>(*this );
15094 }
15195};
15296
0 commit comments