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
b5453e63
Commit
b5453e63
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Adapt tests to composite
parent
6eb9f9ae
No related branches found
No related tags found
2 merge requests
!24
After 2nd RAL submission
,
!17
Resolve "Migrate to state composites"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/gtest_factor_epipolar.cpp
+21
-9
21 additions, 9 deletions
test/gtest_factor_epipolar.cpp
test/gtest_processor_tracker_feature_trifocal.cpp
+4
-5
4 additions, 5 deletions
test/gtest_processor_tracker_feature_trifocal.cpp
with
25 additions
and
14 deletions
test/gtest_factor_epipolar.cpp
+
21
−
9
View file @
b5453e63
...
@@ -60,12 +60,11 @@ TEST(FactorEpipolar, exemple)
...
@@ -60,12 +60,11 @@ TEST(FactorEpipolar, exemple)
camera
->
getO
()
->
getState
().
data
(),
camera
->
getO
()
->
getState
().
data
(),
&
residual_0
);
&
residual_0
);
WOLF_TRACE
(
"residual @ 0 pix: "
,
residual_0
);
WOLF_TRACE
(
"residual @ 0 pix
: "
,
residual_0
);
ASSERT_NEAR
(
residual_0
,
0.0
,
1e-6
);
//
lines 1 pix difference
//
Move F0 up a lil
f1
->
s
et
Measurement
(
Vector
2
d
(
3
00
,
241
));
F0
->
g
et
P
()
->
setState
(
Vector
3
d
(
0
,
-
0.
00
1
,
0
));
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
...
@@ -76,8 +75,9 @@ TEST(FactorEpipolar, exemple)
...
@@ -76,8 +75,9 @@ TEST(FactorEpipolar, exemple)
WOLF_TRACE
(
"residual @ 1 pix : "
,
residual_1
);
WOLF_TRACE
(
"residual @ 1 pix : "
,
residual_1
);
// lines 2 pixels difference
f1
->
setMeasurement
(
Vector2d
(
300
,
242
));
// move F0 up double than before
F0
->
getP
()
->
setState
(
Vector3d
(
0
,
-
0.002
,
0
));
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
...
@@ -88,10 +88,9 @@ TEST(FactorEpipolar, exemple)
...
@@ -88,10 +88,9 @@ TEST(FactorEpipolar, exemple)
WOLF_TRACE
(
"residual @ 2 pix : "
,
residual_2
);
WOLF_TRACE
(
"residual @ 2 pix : "
,
residual_2
);
ASSERT_NEAR
(
residual_2
,
2.0
*
residual_1
,
1e-6
);
//
lines 1 pix difference in the other direction
//
Move F0 down a lil
f1
->
s
et
Measurement
(
Vector
2
d
(
3
00
,
239
));
F0
->
g
et
P
()
->
setState
(
Vector
3
d
(
0
,
+
0.
00
1
,
0
));
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
c
->
operator
()(
F0
->
getP
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F0
->
getO
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
F1
->
getP
()
->
getState
().
data
(),
...
@@ -102,6 +101,19 @@ TEST(FactorEpipolar, exemple)
...
@@ -102,6 +101,19 @@ TEST(FactorEpipolar, exemple)
WOLF_TRACE
(
"residual @ -1 pix : "
,
residual_n1
);
WOLF_TRACE
(
"residual @ -1 pix : "
,
residual_n1
);
// all asserts down here:
// residual zero when nominal
ASSERT_NEAR
(
residual_0
,
0.0
,
1e-6
);
// residual positive when camera up
ASSERT_GT
(
residual_1
,
0.0
);
// residual double when camera doubly up
ASSERT_NEAR
(
residual_2
,
2.0
*
residual_1
,
1e-6
);
// residual opposite when cam down
ASSERT_NEAR
(
residual_1
,
-
residual_n1
,
1e-6
);
ASSERT_NEAR
(
residual_1
,
-
residual_n1
,
1e-6
);
}
}
...
...
This diff is collapsed.
Click to expand it.
test/gtest_processor_tracker_feature_trifocal.cpp
+
4
−
5
View file @
b5453e63
...
@@ -78,8 +78,6 @@ TEST(ProcessorTrackerFeatureTrifocal, KeyFrameCallback)
...
@@ -78,8 +78,6 @@ TEST(ProcessorTrackerFeatureTrifocal, KeyFrameCallback)
ParamsSensorCameraPtr
intr
=
make_shared
<
ParamsSensorCamera
>
();
// TODO init params or read from YAML
ParamsSensorCameraPtr
intr
=
make_shared
<
ParamsSensorCamera
>
();
// TODO init params or read from YAML
intr
->
width
=
640
;
intr
->
width
=
640
;
intr
->
height
=
480
;
intr
->
height
=
480
;
// SensorCameraPtr sens_trk = make_shared<SensorCamera>((Eigen::Vector7d()<<0,0,0, 0,0,0,1).finished(),
// intr);
auto
sens_trk
=
SensorBase
::
emplace
<
SensorCamera
>
(
problem
->
getHardware
(),
(
Eigen
::
Vector7d
()
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
).
finished
(),
auto
sens_trk
=
SensorBase
::
emplace
<
SensorCamera
>
(
problem
->
getHardware
(),
(
Eigen
::
Vector7d
()
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
).
finished
(),
intr
);
intr
);
...
@@ -120,11 +118,12 @@ TEST(ProcessorTrackerFeatureTrifocal, KeyFrameCallback)
...
@@ -120,11 +118,12 @@ TEST(ProcessorTrackerFeatureTrifocal, KeyFrameCallback)
// initialize
// initialize
TimeStamp
t
(
0.0
);
TimeStamp
t
(
0.0
);
Vector
7d
x
;
x
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
;
Vector
Composite
x
(
"PO"
,
{
Vector3d
::
Zero
(),
Quaterniond
::
Identity
().
coeffs
()})
;
Matrix6d
P
=
Matrix6d
::
Identity
()
*
0.000001
;
VectorComposite
s
(
"PO"
,
{
1e-3
*
Vector3d
::
Ones
(),
1e-3
*
Vector3d
::
Ones
()})
;
auto
KF1
=
problem
->
setPriorFactor
(
x
,
P
,
t
,
dt
/
2
);
// KF1
auto
KF1
=
problem
->
setPriorFactor
(
x
,
s
,
t
,
dt
/
2
);
// KF1
std
::
static_pointer_cast
<
ProcessorOdom3d
>
(
proc_odo
)
->
setOrigin
(
KF1
);
std
::
static_pointer_cast
<
ProcessorOdom3d
>
(
proc_odo
)
->
setOrigin
(
KF1
);
MatrixXd
P
=
(
s
.
vector
(
"PO"
).
array
()
*
s
.
vector
(
"PO"
).
array
()).
matrix
().
asDiagonal
();
CaptureOdom3dPtr
capt_odo
=
make_shared
<
CaptureOdom3d
>
(
t
,
sens_odo
,
Vector6d
::
Zero
(),
P
);
CaptureOdom3dPtr
capt_odo
=
make_shared
<
CaptureOdom3d
>
(
t
,
sens_odo
,
Vector6d
::
Zero
(),
P
);
// Track
// Track
...
...
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