Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
laser
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
laser
Commits
092d658b
Commit
092d658b
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
New gtest for processor odom ICP
parent
64b91189
No related branches found
No related tags found
3 merge requests
!30
Release after RAL
,
!29
After 2nd RAL submission
,
!3
Resolve "new processor: pc matching for demo"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/processor/processor_odom_icp.cpp
+15
-14
15 additions, 14 deletions
src/processor/processor_odom_icp.cpp
test/CMakeLists.txt
+3
-0
3 additions, 0 deletions
test/CMakeLists.txt
test/gtest_processor_odom_icp.cpp
+42
-0
42 additions, 0 deletions
test/gtest_processor_odom_icp.cpp
with
60 additions
and
14 deletions
src/processor/processor_odom_icp.cpp
+
15
−
14
View file @
092d658b
...
@@ -50,10 +50,10 @@ unsigned int ProcessorOdomICP::processNew(const int& _max_features)
...
@@ -50,10 +50,10 @@ unsigned int ProcessorOdomICP::processNew(const int& _max_features)
Eigen
::
Vector3s
t_identity
;
Eigen
::
Vector3s
t_identity
;
t_identity
<<
0
,
0
,
0
;
t_identity
<<
0
,
0
,
0
;
// XXX: Dynamic or static?
// XXX: Dynamic or static?
JS: static is OK.
CaptureLaser2DPtr
incoming_ptr
=
std
::
static_pointer_cast
<
CaptureLaser2D
>
(
incoming_ptr_
);
CaptureLaser2DPtr
incoming_ptr
=
std
::
static_pointer_cast
<
CaptureLaser2D
>
(
incoming_ptr_
);
CaptureLaser2DPtr
last_ptr
=
std
::
static_pointer_cast
<
CaptureLaser2D
>
(
last_ptr_
);
CaptureLaser2DPtr
last_ptr
=
std
::
static_pointer_cast
<
CaptureLaser2D
>
(
last_ptr_
);
SensorLaser2DPtr
laser_sen
=
std
::
static_pointer_cast
<
SensorLaser2D
>
(
this
->
getSensor
());
SensorLaser2DPtr
laser_sen
=
std
::
static_pointer_cast
<
SensorLaser2D
>
(
this
->
getSensor
());
laserscanutils
::
LaserScanParams
scan_params
=
laser_sen
->
getScanParams
();
laserscanutils
::
LaserScanParams
scan_params
=
laser_sen
->
getScanParams
();
...
@@ -133,26 +133,27 @@ void ProcessorOdomICP::resetDerived()
...
@@ -133,26 +133,27 @@ void ProcessorOdomICP::resetDerived()
// x1_p_y1_y2: translation vector from y1 to y2 expressed in frame x1
// x1_p_y1_y2: translation vector from y1 to y2 expressed in frame x1
// Rotation composition
// Rotation composition
Eigen
::
Rotation2D
<
Scalar
>
w_R_ro
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_ptr_
->
getFrame
()
->
getState
()(
2
));
Eigen
::
Rotation2D
<
Scalar
>
w_R_ro
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_ptr_
->
getFrame
()
->
getState
()(
2
));
Eigen
::
Rotation2D
<
Scalar
>
r_R_s
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_ptr_
->
getSensorO
()
->
getState
()(
0
));
Eigen
::
Rotation2D
<
Scalar
>
r_R_s
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_ptr_
->
getSensorO
()
->
getState
()(
0
));
Eigen
::
Rotation2D
<
Scalar
>
so_R_sl
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_last_
.
res_transf
(
2
));
Eigen
::
Rotation2D
<
Scalar
>&
ro_R_so
=
r_R_s
;
Eigen
::
Rotation2D
<
Scalar
>
so_R_sl
=
Eigen
::
Rotation2D
<
Scalar
>
(
origin_last_
.
res_transf
(
2
));
// Eigen::Rotation2D<Scalar> w_R_rl = w_R_ro*r_R_s*so_R_sl*r_R_s.inverse();
// Eigen::Rotation2D<Scalar> w_R_rl = w_R_ro*r_R_s*so_R_sl*r_R_s.inverse();
// ro_R_so = rl_R_sl = r_R_s
// ro_R_so = rl_R_sl = r_R_s
// Planar rotations are commutative
// Planar rotations are commutative
Eigen
::
Rotation2D
<
Scalar
>
w_R_rl
=
w_R_ro
*
so_R_sl
;
Eigen
::
Rotation2D
<
Scalar
>
w_R_rl
=
w_R_ro
*
so_R_sl
;
// Translation composition
// Translation composition
Eigen
::
Vector2s
w_p_w_ro
=
origin_ptr_
->
getFrame
()
->
getState
().
head
(
2
);
Eigen
::
Vector2s
w_p_w_ro
=
origin_ptr_
->
getFrame
()
->
getState
().
head
(
2
);
Eigen
::
Vector2s
w_p_ro_so
=
w_R_ro
*
origin_ptr_
->
getSensorP
()
->
getState
();
Eigen
::
Vector2s
w_p_ro_so
=
w_R_ro
*
origin_ptr_
->
getSensorP
()
->
getState
();
Eigen
::
Vector2s
w_p_so_sl
=
w_R_ro
*
r_R_s
*
origin_last_
.
res_transf
.
head
(
2
);
Eigen
::
Vector2s
w_p_so_sl
=
w_R_ro
*
ro_R_so
*
origin_last_
.
res_transf
.
head
(
2
);
Eigen
::
Vector2s
w_p_sl_rl
=
w_R_rl
*
(
-
last_ptr_
->
getSensorP
()
->
getState
());
Eigen
::
Vector2s
w_p_sl_rl
=
w_R_rl
*
(
-
last_ptr_
->
getSensorP
()
->
getState
());
Eigen
::
Vector2s
w_p_w_rl
=
w_p_w_ro
+
w_p_ro_so
+
w_p_so_sl
+
w_p_sl_rl
;
Eigen
::
Vector2s
w_p_w_rl
=
w_p_w_ro
+
w_p_ro_so
+
w_p_so_sl
+
w_p_sl_rl
;
Eigen
::
Vector3s
curr_state
;
Eigen
::
Vector3s
curr_state
;
curr_state
.
head
(
2
)
=
w_p_w_rl
;
curr_state
.
head
(
2
)
=
w_p_w_rl
;
curr_state
(
2
)
=
origin_ptr_
->
getFrame
()
->
getState
()(
2
)
+
origin_last_
.
res_transf
(
2
);
curr_state
(
2
)
=
origin_ptr_
->
getFrame
()
->
getState
()(
2
)
+
origin_last_
.
res_transf
(
2
);
last_ptr_
->
getFrame
()
->
setState
(
curr_state
);
last_ptr_
->
getFrame
()
->
setState
(
curr_state
);
std
::
cout
<<
"[KEY FRAME DONE: ]"
<<
'\n'
;
std
::
cout
<<
"[KEY FRAME DONE: ]"
<<
'\n'
;
...
...
This diff is collapsed.
Click to expand it.
test/CMakeLists.txt
+
3
−
0
View file @
092d658b
...
@@ -16,6 +16,9 @@ target_link_libraries(gtest_example ${PLUGIN_NAME}) #
...
@@ -16,6 +16,9 @@ target_link_libraries(gtest_example ${PLUGIN_NAME}) #
wolf_add_gtest
(
gtest_landmark_polyline gtest_landmark_polyline.cpp
)
wolf_add_gtest
(
gtest_landmark_polyline gtest_landmark_polyline.cpp
)
target_link_libraries
(
gtest_landmark_polyline
${
PLUGIN_NAME
}
${
wolf_LIBRARY
}
)
target_link_libraries
(
gtest_landmark_polyline
${
PLUGIN_NAME
}
${
wolf_LIBRARY
}
)
wolf_add_gtest
(
gtest_processor_odom_icp gtest_processor_odom_icp.cpp
)
target_link_libraries
(
gtest_processor_odom_icp
${
PLUGIN_NAME
}
${
wolf_LIBRARY
}
)
wolf_add_gtest
(
gtest_polyline_2D gtest_polyline_2D.cpp
)
wolf_add_gtest
(
gtest_polyline_2D gtest_polyline_2D.cpp
)
target_link_libraries
(
gtest_polyline_2D
${
PLUGIN_NAME
}
${
wolf_LIBRARY
}
)
target_link_libraries
(
gtest_polyline_2D
${
PLUGIN_NAME
}
${
wolf_LIBRARY
}
)
...
...
This diff is collapsed.
Click to expand it.
test/gtest_processor_odom_icp.cpp
0 → 100644
+
42
−
0
View file @
092d658b
/**
* \file gtest_processor_odom_icp.cpp
*
* Created on: Aug 6, 2019
* \author: jsola
*/
#include
"laser/processor/processor_odom_icp.h"
#include
"core/utils/utils_gtest.h"
using
namespace
wolf
;
TEST
(
ProcessorParamsOdomICP
,
print
)
{
auto
params
=
std
::
make_shared
<
ProcessorParamsOdomICP
>
();
ASSERT_TRUE
(
params
);
// not nullptr
params
->
use_corr_tricks
=
15
;
ASSERT_EQ
(
params
->
use_corr_tricks
,
15
);
WOLF_INFO
(
"params: "
,
params
->
print
());
}
TEST
(
ProcessorOdomIcp
,
Constructor
)
{
auto
params
=
std
::
make_shared
<
ProcessorParamsOdomICP
>
();
auto
prc
=
std
::
make_shared
<
ProcessorOdomICP
>
(
params
);
ASSERT_TRUE
(
prc
);
// not nullptr
ASSERT_EQ
(
prc
->
getType
(),
"ODOM ICP"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
//::testing::GTEST_FLAG(filter) = "TestGroup.DummyTestExample";
return
RUN_ALL_TESTS
();
}
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