Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vision
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mobile_robotics
wolf_projects
wolf_lib
plugins
vision
Commits
91e59056
Commit
91e59056
authored
4 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Use perturb()
parent
7d14b4d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!24
After 2nd RAL submission
,
!20
Resolve "follow core:#313"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_factor_trifocal.cpp
+3
-23
3 additions, 23 deletions
test/gtest_factor_trifocal.cpp
with
3 additions
and
23 deletions
test/gtest_factor_trifocal.cpp
+
3
−
23
View file @
91e59056
...
@@ -384,12 +384,7 @@ TEST_F(FactorTrifocalTest, solve_F1)
...
@@ -384,12 +384,7 @@ TEST_F(FactorTrifocalTest, solve_F1)
ASSERT_MATRIX_APPROX
(
res
,
Vector3d
::
Zero
(),
1e-8
);
ASSERT_MATRIX_APPROX
(
res
,
Vector3d
::
Zero
(),
1e-8
);
// Residual with perturbated state
// Residual with perturbated state
// Vector7d pose_perturbated = F1->getState() + 0.1 * Vector7d::Random();
// pose_perturbated.segment(3,4).normalize();
// F1->setState(pose_perturbated);
F1
->
perturb
(
0.1
);
F1
->
perturb
(
0.1
);
// VectorXd pose_perturbated = F1->getState().vector("PO");
F1_p
=
F1
->
getP
()
->
getState
();
F1_p
=
F1
->
getP
()
->
getState
();
F1_o
=
F1
->
getO
()
->
getState
();
F1_o
=
F1
->
getO
()
->
getState
();
...
@@ -769,12 +764,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point)
...
@@ -769,12 +764,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point)
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
// Perturbate states, keep scale
// Perturbate states, keep scale
F1
->
getP
()
->
setState
(
pos1
);
problem
->
perturb
(
0.1
);
F1
->
getO
()
->
setState
(
vquat1
);
F2
->
getP
()
->
setState
(
pos2
);
// this fixes the scale
F2
->
getO
()
->
setState
((
vquat2
+
0.2
*
Vector4d
::
Random
()).
normalized
());
F3
->
getP
()
->
setState
(
pos3
+
0.2
*
Vector3d
::
Random
());
F3
->
getO
()
->
setState
((
vquat3
+
0.2
*
Vector4d
::
Random
()).
normalized
());
std
::
string
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
FULL
);
std
::
string
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
FULL
);
...
@@ -834,12 +824,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point_scale)
...
@@ -834,12 +824,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point_scale)
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
// Perturbate states, change scale
// Perturbate states, change scale
F1
->
getP
()
->
setState
(
2
*
pos1
);
problem
->
perturb
(
0.1
);
F1
->
getO
()
->
setState
(
vquat1
);
F2
->
getP
()
->
setState
(
2
*
pos2
);
F2
->
getO
()
->
setState
((
vquat2
+
0.2
*
Vector4d
::
Random
()).
normalized
());
F3
->
getP
()
->
setState
(
2
*
pos3
+
0.2
*
Vector3d
::
Random
());
F3
->
getO
()
->
setState
((
vquat3
+
0.2
*
Vector4d
::
Random
()).
normalized
());
std
::
string
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
BRIEF
);
std
::
string
report
=
solver
->
solve
(
SolverManager
::
ReportVerbosity
::
BRIEF
);
...
@@ -900,12 +885,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point_distance)
...
@@ -900,12 +885,7 @@ TEST_F(FactorTrifocalMultiPointTest, solve_multi_point_distance)
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
F3
->
getO
()
->
unfix
();
// Estimate Cam 3 ori
// Perturbate states, change scale
// Perturbate states, change scale
F1
->
getP
()
->
setState
(
pos1
);
problem
->
perturb
(
0.1
);
F1
->
getO
()
->
setState
(
vquat1
);
F2
->
getP
()
->
setState
(
pos2
+
0.2
*
Vector3d
::
Random
()
);
F2
->
getO
()
->
setState
((
vquat2
+
0.2
*
Vector4d
::
Random
()).
normalized
());
F3
->
getP
()
->
setState
(
pos3
+
0.2
*
Vector3d
::
Random
());
F3
->
getO
()
->
setState
((
vquat3
+
0.2
*
Vector4d
::
Random
()).
normalized
());
// Add a distance factor to fix the scale
// Add a distance factor to fix the scale
double
distance
=
sqrt
(
2.0
);
double
distance
=
sqrt
(
2.0
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment