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
f90dbf93
Commit
f90dbf93
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
ProcessorOdomIcp hotfix
parent
a677a084
No related branches found
Branches containing commit
No related tags found
1 merge request
!43
Devel
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/processor/processor_odom_icp.cpp
+22
-18
22 additions, 18 deletions
src/processor/processor_odom_icp.cpp
with
22 additions
and
18 deletions
src/processor/processor_odom_icp.cpp
+
22
−
18
View file @
f90dbf93
...
@@ -140,25 +140,28 @@ unsigned int ProcessorOdomIcp::processKnown()
...
@@ -140,25 +140,28 @@ unsigned int ProcessorOdomIcp::processKnown()
// update extrinsics (if necessary)
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
updateExtrinsicsIsometries
();
auto
ro_T_ri
=
computeIsometry2d
(
odom_origin_
,
odom_incoming_
);
auto
rl_T_ri
=
computeIsometry2d
(
odom_last_
,
odom_incoming_
);
auto
so_T_si
=
ro_T_so_
.
inverse
()
*
ro_T_ri
*
rl_T_sl_
;
auto
sl_T_si
=
rl_T_sl_
.
inverse
()
*
rl_T_ri
*
rl_T_sl_
;
auto
so_T_sl
=
laser
::
trf2isometry
(
trf_origin_last_
.
res_transf
);
auto
so_T_si
=
so_T_sl
*
sl_T_si
;
initial_guess
.
head
<
2
>
()
=
so_T_si
.
translation
();
initial_guess
.
head
<
2
>
()
=
so_T_si
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
so_T_si
.
rotation
()).
angle
();
initial_guess
(
2
)
=
Rotation2Dd
(
so_T_si
.
rotation
()).
angle
();
}
}
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
trf_origin_incoming_
=
icp_tools_ptr_
->
align
(
orig
in_ptr
->
getScan
(),
trf_origin_incoming_
=
icp_tools_ptr_
->
align
(
incom
in
g
_ptr
->
getScan
(),
incoming
_ptr
->
getScan
(),
origin
_ptr
->
getScan
(),
this
->
laser_scan_params_
,
this
->
laser_scan_params_
,
params_odom_icp_
->
icp_params
,
params_odom_icp_
->
icp_params
,
initial_guess
);
initial_guess
);
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown odom_origin_: "
,
odom_origin_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown:"
);
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown odom_incoming_: "
,
odom_incoming_
.
transpose
());
WOLF_DEBUG
(
"odom_origin: "
,
odom_origin_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown trf_origin_last_.res_transf: "
,
trf_origin_last_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"odom_incoming: "
,
odom_incoming_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown initial guess: "
,
initial_guess
.
transpose
());
WOLF_DEBUG
(
"trf_origin_last: "
,
trf_origin_last_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown ICP transform: "
,
trf_origin_incoming_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"initial guess: "
,
initial_guess
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processKnown ICP cov:
\n
"
,
trf_origin_incoming_
.
res_covar
);
WOLF_DEBUG
(
"ICP transform: "
,
trf_origin_incoming_
.
res_transf
.
transpose
(),
"
\n\t
valid: "
,
trf_origin_incoming_
.
valid
,
"
\n\t
error: "
,
trf_origin_incoming_
.
error
);
WOLF_DEBUG
(
"ICP cov:
\n
"
,
trf_origin_incoming_
.
res_covar
);
}
}
return
0
;
return
0
;
}
}
...
@@ -175,7 +178,7 @@ unsigned int ProcessorOdomIcp::processNew(const int& _max_features)
...
@@ -175,7 +178,7 @@ unsigned int ProcessorOdomIcp::processNew(const int& _max_features)
// update extrinsics (if necessary)
// update extrinsics (if necessary)
updateExtrinsicsIsometries
();
updateExtrinsicsIsometries
();
auto
rl_T_ri
=
computeIsometry2d
(
odom_
incoming_
,
odom_last
_
);
auto
rl_T_ri
=
computeIsometry2d
(
odom_
last_
,
odom_incoming
_
);
auto
sl_T_si
=
rl_T_sl_
.
inverse
()
*
rl_T_ri
*
rl_T_sl_
;
auto
sl_T_si
=
rl_T_sl_
.
inverse
()
*
rl_T_ri
*
rl_T_sl_
;
initial_guess
.
head
<
2
>
()
=
sl_T_si
.
translation
();
initial_guess
.
head
<
2
>
()
=
sl_T_si
.
translation
();
initial_guess
(
2
)
=
Rotation2Dd
(
sl_T_si
.
rotation
()).
angle
();
initial_guess
(
2
)
=
Rotation2Dd
(
sl_T_si
.
rotation
()).
angle
();
...
@@ -183,16 +186,17 @@ unsigned int ProcessorOdomIcp::processNew(const int& _max_features)
...
@@ -183,16 +186,17 @@ unsigned int ProcessorOdomIcp::processNew(const int& _max_features)
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
else
if
(
params_odom_icp_
->
initial_guess
!=
"zero"
)
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
throw
std
::
runtime_error
(
"unknown value for param 'initial_guess'. Should be 'odom', 'state' or 'zero'"
);
trf_last_incoming_
=
icp_tools_ptr_
->
align
(
last
_ptr
->
getScan
(),
trf_last_incoming_
=
icp_tools_ptr_
->
align
(
incoming
_ptr
->
getScan
(),
incoming
_ptr
->
getScan
(),
last
_ptr
->
getScan
(),
this
->
laser_scan_params_
,
this
->
laser_scan_params_
,
params_odom_icp_
->
icp_params
,
params_odom_icp_
->
icp_params
,
initial_guess
);
initial_guess
);
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew odom_incoming_: "
,
odom_incoming_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew:"
);
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew odom_last_: "
,
odom_last_
.
transpose
());
WOLF_DEBUG
(
"odom_incoming: "
,
odom_incoming_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew initial guess: "
,
initial_guess
.
transpose
());
WOLF_DEBUG
(
"odom_last: "
,
odom_last_
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew ICP transform: "
,
trf_origin_incoming_
.
res_transf
.
transpose
());
WOLF_DEBUG
(
"initial guess: "
,
initial_guess
.
transpose
());
WOLF_DEBUG
(
"ProcessorOdomIcp::processNew ICP cov:
\n
"
,
trf_origin_incoming_
.
res_covar
);
WOLF_DEBUG
(
"ICP transform: "
,
trf_last_incoming_
.
res_transf
.
transpose
(),
"
\n\t
valid: "
,
trf_last_incoming_
.
valid
,
"
\n\t
error: "
,
trf_last_incoming_
.
error
);
WOLF_DEBUG
(
"ICP cov:
\n
"
,
trf_last_incoming_
.
res_covar
);
//trf_last_incoming_.valid = trf_last_incoming_.valid && trf_last_incoming_.error / trf_last_incoming_.nvalid < 5e-2;
//trf_last_incoming_.valid = trf_last_incoming_.valid && trf_last_incoming_.error / trf_last_incoming_.nvalid < 5e-2;
...
...
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