Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
csm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
labrobotica
algorithms
csm
Commits
ea3c59b7
Commit
ea3c59b7
authored
16 years ago
by
Andrea Censi
Browse files
Options
Downloads
Patches
Plain Diff
recovering from error
parent
8579de63
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sm/apps/sm2.c
+33
-16
33 additions, 16 deletions
sm/apps/sm2.c
with
33 additions
and
16 deletions
sm/apps/sm2.c
+
33
−
16
View file @
ea3c59b7
...
...
@@ -15,6 +15,8 @@ struct {
/* which algorithm to run */
int
algo
;
int
recover_from_error
;
int
debug
;
}
p
;
...
...
@@ -37,6 +39,7 @@ int main(int argc, const char*argv[]) {
options_int
(
ops
,
"algo"
,
&
p
.
algo
,
0
,
"Which algorithm to use (0:(pl)ICP 1:gpm-stripped 2:HSM) "
);
options_int
(
ops
,
"debug"
,
&
p
.
debug
,
0
,
"Shows debug information"
);
options_int
(
ops
,
"recover_from_error"
,
&
p
.
recover_from_error
,
0
,
"If true, tries to recover from an ICP matching error"
);
p
.
format
=
0
;
...
...
@@ -122,26 +125,40 @@ int main(int argc, const char*argv[]) {
}
if
(
!
result
.
valid
){
sm_error
(
"One ICP matching failed. Because I process recursively, I will stop here.
\n
"
);
ld_free
(
laser_ref
);
return
2
;
}
if
(
p
.
recover_from_error
)
{
sm_info
(
"One ICP matching failed. Because you passed -recover_from_error, I will try to recover."
" Note, however, that this might not be good in some cases.
\n
"
);
sm_info
(
"The recover is that the displacement is set to 0. No result stats is output.
\n
"
);
/* For the first scan, set estimate = odometry */
copy_d
(
laser_ref
->
estimate
,
3
,
laser_sens
->
estimate
);
ld_free
(
laser_ref
);
laser_ref
=
laser_sens
;
}
else
{
sm_error
(
"One ICP matching failed. Because I process recursively, I will stop here.
\n
"
);
sm_error
(
"Use the option -recover_from_error if you want to try to recover.
\n
"
);
ld_free
(
laser_ref
);
return
2
;
}
}
else
{
/* Add the result to the previous estimate */
oplus_d
(
laser_ref
->
estimate
,
result
.
x
,
laser_sens
->
estimate
);
/* Add the result to the previous estimate */
oplus_d
(
laser_ref
->
estimate
,
result
.
x
,
laser_sens
->
estimate
);
/* Write the corrected log */
spit
(
laser_sens
,
file_out
);
/* Write the corrected log */
spit
(
laser_sens
,
file_out
);
/* Write the statistics (if required) */
if
(
file_out_stats
)
{
JO
jo
=
result_to_json
(
&
params
,
&
result
);
fputs
(
jo_to_string
(
jo
),
file_out_stats
);
fputs
(
"
\n
"
,
file_out_stats
);
jo_free
(
jo
);
}
/* Write the statistics (if required) */
if
(
file_out_stats
)
{
JO
jo
=
result_to_json
(
&
params
,
&
result
);
fputs
(
jo_to_string
(
jo
),
file_out_stats
);
fputs
(
"
\n
"
,
file_out_stats
);
jo_free
(
jo
);
}
ld_free
(
laser_ref
);
laser_ref
=
laser_sens
;
ld_free
(
laser_ref
);
laser_ref
=
laser_sens
;
}
}
ld_free
(
laser_ref
);
...
...
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