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

Rename FactorAutodiffDistance3d -> FactorDistance3d

parent 0474b075
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.
......@@ -216,12 +216,12 @@ SET(HDRS_CAPTURE
SET(HDRS_FACTOR
include/core/factor/factor_analytic.h
include/core/factor/factor_autodiff.h
include/core/factor/factor_autodiff_distance_3d.h
include/core/factor/factor_base.h
include/core/factor/factor_block_absolute.h
include/core/factor/factor_block_difference.h
include/core/factor/factor_diff_drive.h
include/core/factor/factor_odom_2d.h
include/core/factor/factor_distance_3d.h
include/core/factor/factor_odom_2d_closeloop.h
include/core/factor/factor_odom_2d_analytic.h
include/core/factor/factor_odom_3d.h
......
......@@ -5,20 +5,20 @@
* \author: jsola
*/
#ifndef FACTOR_AUTODIFF_DISTANCE_3d_H_
#define FACTOR_AUTODIFF_DISTANCE_3d_H_
#ifndef FACTOR_DISTANCE_3d_H_
#define FACTOR_DISTANCE_3d_H_
#include "core/factor/factor_autodiff.h"
namespace wolf
{
WOLF_PTR_TYPEDEFS(FactorAutodiffDistance3d);
WOLF_PTR_TYPEDEFS(FactorDistance3d);
class FactorAutodiffDistance3d : public FactorAutodiff<FactorAutodiffDistance3d, 1, 3, 3>
class FactorDistance3d : public FactorAutodiff<FactorDistance3d, 1, 3, 3>
{
public:
FactorAutodiffDistance3d(const FeatureBasePtr& _feat,
FactorDistance3d(const FeatureBasePtr& _feat,
const FrameBasePtr& _frm_other,
const ProcessorBasePtr& _processor_ptr,
bool _apply_loss_function,
......@@ -37,7 +37,7 @@ class FactorAutodiffDistance3d : public FactorAutodiff<FactorAutodiffDistance3d,
{
}
~FactorAutodiffDistance3d() override { /* nothing */ }
~FactorDistance3d() override { /* nothing */ }
std::string getTopology() const override
{
......@@ -74,4 +74,4 @@ class FactorAutodiffDistance3d : public FactorAutodiff<FactorAutodiffDistance3d,
} /* namespace wolf */
#endif /* FACTOR_AUTODIFF_DISTANCE_3d_H_ */
#endif /* FACTOR_DISTANCE_3d_H_ */
......@@ -5,8 +5,8 @@
* \author: jsola
*/
#include <core/factor/factor_distance_3d.h>
#include "../include/core/ceres_wrapper/solver_ceres.h"
#include "core/factor/factor_autodiff_distance_3d.h"
#include "core/problem/problem.h"
#include "core/math/rotations.h"
......@@ -28,7 +28,7 @@ class FactorAutodiffDistance3d_Test : public testing::Test
FrameBasePtr F1, F2;
CaptureBasePtr C2;
FeatureBasePtr f2;
FactorAutodiffDistance3dPtr c2;
FactorDistance3dPtr c2;
Vector1d dist;
Matrix1d dist_cov;
......@@ -68,7 +68,7 @@ TEST_F(FactorAutodiffDistance3d_Test, ground_truth)
double res;
f2 = FeatureBase::emplace<FeatureBase>(C2, "Dist", dist, dist_cov);
c2 = FactorBase::emplace<FactorAutodiffDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
c2 = FactorBase::emplace<FactorDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
c2->operator ()(pos1.data(), pos2.data(), &res);
ASSERT_NEAR(res, 0.0, 1e-5);
......@@ -79,7 +79,7 @@ TEST_F(FactorAutodiffDistance3d_Test, expected_residual)
double measurement = 1.400;
f2 = FeatureBase::emplace<FeatureBase>(C2, "Dist", Vector1d(measurement), dist_cov);
c2 = FactorBase::emplace<FactorAutodiffDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
c2 = FactorBase::emplace<FactorDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
double res_expected = (measurement - (pos2-pos1).norm()) * c2->getMeasurementSquareRootInformationUpper()(0,0);
......@@ -94,7 +94,7 @@ TEST_F(FactorAutodiffDistance3d_Test, solve)
double measurement = 1.400;
f2 = FeatureBase::emplace<FeatureBase>(C2, "Dist", Vector1d(measurement), dist_cov);
c2 = FactorBase::emplace<FactorAutodiffDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
c2 = FactorBase::emplace<FactorDistance3d>(f2, f2, F1, nullptr, false, FAC_ACTIVE);
std::string report = solver->solve(SolverManager::ReportVerbosity::QUIET);
......
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