Skip to content
Snippets Groups Projects
Commit 781002c6 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Rename FactorRelative2dAnalytic -> FactorRelativePose2d

parent f60905d4
No related branches found
No related tags found
1 merge request!406Resolve "Factors renaming"
This commit is part of merge request !406. Comments created here will be created in the context of that merge request.
...@@ -228,7 +228,7 @@ SET(HDRS_FACTOR ...@@ -228,7 +228,7 @@ SET(HDRS_FACTOR
include/core/factor/factor_pose_2d.h include/core/factor/factor_pose_2d.h
include/core/factor/factor_pose_3d.h include/core/factor/factor_pose_3d.h
include/core/factor/factor_quaternion_absolute.h include/core/factor/factor_quaternion_absolute.h
include/core/factor/factor_relative_2d_analytic.h include/core/factor/factor_relative_pose_2d.h
include/core/factor/factor_relative_pose_2d_with_extrinsics.h include/core/factor/factor_relative_pose_2d_with_extrinsics.h
) )
SET(HDRS_FEATURE SET(HDRS_FEATURE
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define FACTOR_ODOM_2d_H_ #define FACTOR_ODOM_2d_H_
//Wolf includes //Wolf includes
#include "core/factor/factor_relative_2d_analytic.h" #include "core/factor/factor_relative_pose_2d.h"
#include <Eigen/StdVector> #include <Eigen/StdVector>
namespace wolf { namespace wolf {
...@@ -10,7 +10,7 @@ namespace wolf { ...@@ -10,7 +10,7 @@ namespace wolf {
WOLF_PTR_TYPEDEFS(FactorOdom2d); WOLF_PTR_TYPEDEFS(FactorOdom2d);
//class //class
class FactorOdom2d : public FactorRelative2dAnalytic class FactorOdom2d : public FactorRelativePose2d
{ {
public: public:
FactorOdom2d(const FeatureBasePtr& _ftr_ptr, FactorOdom2d(const FeatureBasePtr& _ftr_ptr,
...@@ -18,7 +18,7 @@ class FactorOdom2d : public FactorRelative2dAnalytic ...@@ -18,7 +18,7 @@ class FactorOdom2d : public FactorRelative2dAnalytic
const ProcessorBasePtr& _processor_ptr, const ProcessorBasePtr& _processor_ptr,
bool _apply_loss_function, bool _apply_loss_function,
FactorStatus _status = FAC_ACTIVE) : FactorStatus _status = FAC_ACTIVE) :
FactorRelative2dAnalytic("FactorOdom2d", FactorRelativePose2d("FactorOdom2d",
_ftr_ptr, _ftr_ptr,
_frame_ptr, _frame_ptr,
_processor_ptr, _processor_ptr,
......
#ifndef FACTOR_RELATIVE_2d_ANALYTIC_H_ #ifndef FACTOR_RELATIVE_POSE_2d_H_
#define FACTOR_RELATIVE_2d_ANALYTIC_H_ #define FACTOR_RELATIVE_POSE_2d_H_
//Wolf includes //Wolf includes
#include "core/factor/factor_analytic.h" #include "core/factor/factor_analytic.h"
...@@ -9,16 +9,16 @@ ...@@ -9,16 +9,16 @@
namespace wolf { namespace wolf {
WOLF_PTR_TYPEDEFS(FactorRelative2dAnalytic); WOLF_PTR_TYPEDEFS(FactorRelativePose2d);
//class //class
class FactorRelative2dAnalytic : public FactorAnalytic class FactorRelativePose2d : public FactorAnalytic
{ {
public: public:
/** \brief Constructor of category FAC_FRAME /** \brief Constructor of category FAC_FRAME
**/ **/
FactorRelative2dAnalytic(const std::string& _tp, FactorRelativePose2d(const std::string& _tp,
const FeatureBasePtr& _ftr_ptr, const FeatureBasePtr& _ftr_ptr,
const FrameBasePtr& _frame_other_ptr, const FrameBasePtr& _frame_other_ptr,
const ProcessorBasePtr& _processor_ptr, const ProcessorBasePtr& _processor_ptr,
...@@ -43,7 +43,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic ...@@ -43,7 +43,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic
/** \brief Constructor of category FAC_FEATURE /** \brief Constructor of category FAC_FEATURE
**/ **/
FactorRelative2dAnalytic(const std::string& _tp, FactorRelativePose2d(const std::string& _tp,
const FeatureBasePtr& _ftr_ptr, const FeatureBasePtr& _ftr_ptr,
const FeatureBasePtr& _ftr_other_ptr, const FeatureBasePtr& _ftr_other_ptr,
const ProcessorBasePtr& _processor_ptr, const ProcessorBasePtr& _processor_ptr,
...@@ -68,7 +68,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic ...@@ -68,7 +68,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic
/** \brief Constructor of category FAC_LANDMARK /** \brief Constructor of category FAC_LANDMARK
**/ **/
FactorRelative2dAnalytic(const std::string& _tp, FactorRelativePose2d(const std::string& _tp,
const FeatureBasePtr& _ftr_ptr, const FeatureBasePtr& _ftr_ptr,
const LandmarkBasePtr& _landmark_other_ptr, const LandmarkBasePtr& _landmark_other_ptr,
const ProcessorBasePtr& _processor_ptr, const ProcessorBasePtr& _processor_ptr,
...@@ -96,7 +96,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic ...@@ -96,7 +96,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic
return std::string("GEOM"); return std::string("GEOM");
} }
~FactorRelative2dAnalytic() override = default; ~FactorRelativePose2d() override = default;
/** \brief Returns the factor residual size /** \brief Returns the factor residual size
**/ **/
...@@ -139,7 +139,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic ...@@ -139,7 +139,7 @@ class FactorRelative2dAnalytic : public FactorAnalytic
/// IMPLEMENTATION /// /// IMPLEMENTATION ///
inline Eigen::VectorXd FactorRelative2dAnalytic::evaluateResiduals( inline Eigen::VectorXd FactorRelativePose2d::evaluateResiduals(
const std::vector<Eigen::Map<const Eigen::VectorXd> >& _st_vector) const const std::vector<Eigen::Map<const Eigen::VectorXd> >& _st_vector) const
{ {
Eigen::VectorXd residual(3); Eigen::VectorXd residual(3);
...@@ -155,7 +155,7 @@ inline Eigen::VectorXd FactorRelative2dAnalytic::evaluateResiduals( ...@@ -155,7 +155,7 @@ inline Eigen::VectorXd FactorRelative2dAnalytic::evaluateResiduals(
return residual; return residual;
} }
inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen::Map<const Eigen::VectorXd> >& _st_vector, inline void FactorRelativePose2d::evaluateJacobians(const std::vector<Eigen::Map<const Eigen::VectorXd> >& _st_vector,
std::vector<Eigen::Map<Eigen::MatrixRowXd> >& jacobians, std::vector<Eigen::Map<Eigen::MatrixRowXd> >& jacobians,
const std::vector<bool>& _compute_jacobian) const const std::vector<bool>& _compute_jacobian) const
{ {
...@@ -191,7 +191,7 @@ inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen: ...@@ -191,7 +191,7 @@ inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen:
} }
} }
inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen::Map<const Eigen::VectorXd>>& _st_vector, inline void FactorRelativePose2d::evaluateJacobians(const std::vector<Eigen::Map<const Eigen::VectorXd>>& _st_vector,
std::vector<Eigen::MatrixXd>& jacobians, std::vector<Eigen::MatrixXd>& jacobians,
const std::vector<bool>& _compute_jacobian) const const std::vector<bool>& _compute_jacobian) const
{ {
...@@ -227,7 +227,7 @@ inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen: ...@@ -227,7 +227,7 @@ inline void FactorRelative2dAnalytic::evaluateJacobians(const std::vector<Eigen:
} }
} }
inline void FactorRelative2dAnalytic::evaluatePureJacobians(std::vector<Eigen::MatrixXd>& jacobians) const inline void FactorRelativePose2d::evaluatePureJacobians(std::vector<Eigen::MatrixXd>& jacobians) const
{ {
assert(jacobians.size() == 4); assert(jacobians.size() == 4);
......
...@@ -201,14 +201,14 @@ target_link_libraries(gtest_factor_pose_2d ${PLUGIN_NAME}) ...@@ -201,14 +201,14 @@ target_link_libraries(gtest_factor_pose_2d ${PLUGIN_NAME})
wolf_add_gtest(gtest_factor_pose_3d gtest_factor_pose_3d.cpp) wolf_add_gtest(gtest_factor_pose_3d gtest_factor_pose_3d.cpp)
target_link_libraries(gtest_factor_pose_3d ${PLUGIN_NAME}) target_link_libraries(gtest_factor_pose_3d ${PLUGIN_NAME})
# FactorRelativePose2d class test
wolf_add_gtest(gtest_factor_relative_pose_2d gtest_factor_relative_pose_2d.cpp)
target_link_libraries(gtest_factor_relative_pose_2d ${PLUGIN_NAME})
# FactorRelativePose2dWithExtrinsics class test # FactorRelativePose2dWithExtrinsics class test
wolf_add_gtest(gtest_factor_relative_pose_2d_with_extrinsics gtest_factor_relative_pose_2d_with_extrinsics.cpp) wolf_add_gtest(gtest_factor_relative_pose_2d_with_extrinsics gtest_factor_relative_pose_2d_with_extrinsics.cpp)
target_link_libraries(gtest_factor_relative_pose_2d_with_extrinsics ${PLUGIN_NAME}) target_link_libraries(gtest_factor_relative_pose_2d_with_extrinsics ${PLUGIN_NAME})
# FactorRelative2dAnalytic class test
wolf_add_gtest(gtest_factor_relative_2d_analytic gtest_factor_relative_2d_analytic.cpp)
target_link_libraries(gtest_factor_relative_2d_analytic ${PLUGIN_NAME})
# MakePosDef function test # MakePosDef function test
wolf_add_gtest(gtest_make_posdef gtest_make_posdef.cpp) wolf_add_gtest(gtest_make_posdef gtest_make_posdef.cpp)
target_link_libraries(gtest_make_posdef ${PLUGIN_NAME}) target_link_libraries(gtest_make_posdef ${PLUGIN_NAME})
......
#include "../include/core/ceres_wrapper/solver_ceres.h" #include "../include/core/ceres_wrapper/solver_ceres.h"
#include "core/utils/utils_gtest.h" #include "core/utils/utils_gtest.h"
#include "core/factor/factor_relative_2d_analytic.h" #include "core/factor/factor_relative_pose_2d.h"
#include "core/capture/capture_odom_2d.h" #include "core/capture/capture_odom_2d.h"
#include "core/math/rotations.h" #include "core/math/rotations.h"
...@@ -25,12 +25,12 @@ FrameBasePtr frm1 = problem_ptr->emplaceFrame(1.0, Vector3d::Zero()); ...@@ -25,12 +25,12 @@ FrameBasePtr frm1 = problem_ptr->emplaceFrame(1.0, Vector3d::Zero());
// Capture from frm1 to frm0 // Capture from frm1 to frm0
auto cap1 = CaptureBase::emplace<CaptureOdom2d>(frm1, 1, nullptr, Vector3d::Zero(), data_cov); auto cap1 = CaptureBase::emplace<CaptureOdom2d>(frm1, 1, nullptr, Vector3d::Zero(), data_cov);
TEST(FactorRelative2dAnalytic, check_tree) TEST(FactorRelativePose2d, check_tree)
{ {
ASSERT_TRUE(problem_ptr->check(0)); ASSERT_TRUE(problem_ptr->check(0));
} }
TEST(FactorRelative2dAnalytic, fix_0_solve) TEST(FactorRelativePose2d, fix_0_solve)
{ {
for (int i = 0; i < 1e3; i++) for (int i = 0; i < 1e3; i++)
{ {
...@@ -54,7 +54,7 @@ TEST(FactorRelative2dAnalytic, fix_0_solve) ...@@ -54,7 +54,7 @@ TEST(FactorRelative2dAnalytic, fix_0_solve)
// feature & factor with delta measurement // feature & factor with delta measurement
auto fea1 = FeatureBase::emplace<FeatureBase>(cap1, "FeatureOdom2d", delta, data_cov); auto fea1 = FeatureBase::emplace<FeatureBase>(cap1, "FeatureOdom2d", delta, data_cov);
FactorBase::emplace<FactorRelative2dAnalytic>(fea1, "odom2d", fea1, frm0, nullptr, false); FactorBase::emplace<FactorRelativePose2d>(fea1, "odom2d", fea1, frm0, nullptr, false);
// Fix frm0, perturb frm1 // Fix frm0, perturb frm1
frm0->fix(); frm0->fix();
...@@ -71,7 +71,7 @@ TEST(FactorRelative2dAnalytic, fix_0_solve) ...@@ -71,7 +71,7 @@ TEST(FactorRelative2dAnalytic, fix_0_solve)
} }
} }
TEST(FactorRelative2dAnalytic, fix_1_solve) TEST(FactorRelativePose2d, fix_1_solve)
{ {
for (int i = 0; i < 1e3; i++) for (int i = 0; i < 1e3; i++)
{ {
...@@ -95,7 +95,7 @@ TEST(FactorRelative2dAnalytic, fix_1_solve) ...@@ -95,7 +95,7 @@ TEST(FactorRelative2dAnalytic, fix_1_solve)
// feature & factor with delta measurement // feature & factor with delta measurement
auto fea1 = FeatureBase::emplace<FeatureBase>(cap1, "FeatureOdom2d", delta, data_cov); auto fea1 = FeatureBase::emplace<FeatureBase>(cap1, "FeatureOdom2d", delta, data_cov);
FactorBase::emplace<FactorRelative2dAnalytic>(fea1, "odom2d", fea1, frm0, nullptr, false); FactorBase::emplace<FactorRelativePose2d>(fea1, "odom2d", fea1, frm0, nullptr, false);
// Fix frm1, perturb frm0 // Fix frm1, perturb frm0
frm1->fix(); frm1->fix();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment