Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
9a79b4b8
Commit
9a79b4b8
authored
5 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
implemented and working
parent
0fd6a732
No related branches found
No related tags found
1 merge request
!386
Resolve "IterationUpdateCallback checking total cost decreased"
Pipeline
#5743
passed
5 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/core/ceres_wrapper/iteration_update_callback.h
+15
-2
15 additions, 2 deletions
include/core/ceres_wrapper/iteration_update_callback.h
with
15 additions
and
2 deletions
include/core/ceres_wrapper/iteration_update_callback.h
+
15
−
2
View file @
9a79b4b8
...
@@ -19,17 +19,29 @@ class IterationUpdateCallback : public ceres::IterationCallback
...
@@ -19,17 +19,29 @@ class IterationUpdateCallback : public ceres::IterationCallback
explicit
IterationUpdateCallback
(
ProblemPtr
_problem
,
bool
verbose
=
false
)
explicit
IterationUpdateCallback
(
ProblemPtr
_problem
,
bool
verbose
=
false
)
:
problem_
(
_problem
)
:
problem_
(
_problem
)
,
verbose_
(
verbose
)
,
verbose_
(
verbose
)
,
initial_cost_
(
0
)
{}
{}
~
IterationUpdateCallback
()
{}
~
IterationUpdateCallback
()
{}
ceres
::
CallbackReturnType
operator
()(
const
ceres
::
IterationSummary
&
summary
)
override
ceres
::
CallbackReturnType
operator
()(
const
ceres
::
IterationSummary
&
summary
)
override
{
{
if
(
summary
.
iteration
==
0
)
initial_cost_
=
summary
.
cost
;
if
(
problem_
->
getStateBlockNotificationMapSize
()
!=
0
or
if
(
problem_
->
getStateBlockNotificationMapSize
()
!=
0
or
problem_
->
getFactorNotificationMapSize
()
!=
0
)
problem_
->
getFactorNotificationMapSize
()
!=
0
)
{
{
WOLF_INFO_COND
(
verbose_
,
"Stopping solver to update the problem!"
);
if
(
summary
.
cost
>=
initial_cost_
)
return
ceres
::
SOLVER_TERMINATE_SUCCESSFULLY
;
{
WOLF_INFO_COND
(
verbose_
,
"Stopping solver to update the problem! ABORTING since cost didn't decrease. Iteration "
,
summary
.
iteration
);
return
ceres
::
SOLVER_ABORT
;
}
else
{
WOLF_INFO_COND
(
verbose_
,
"Stopping solver to update the problem! SUCCESS since cost decreased. Iteration "
,
summary
.
iteration
);
return
ceres
::
SOLVER_TERMINATE_SUCCESSFULLY
;
}
}
}
return
ceres
::
SOLVER_CONTINUE
;
return
ceres
::
SOLVER_CONTINUE
;
}
}
...
@@ -37,6 +49,7 @@ class IterationUpdateCallback : public ceres::IterationCallback
...
@@ -37,6 +49,7 @@ class IterationUpdateCallback : public ceres::IterationCallback
private
:
private
:
ProblemPtr
problem_
;
ProblemPtr
problem_
;
bool
verbose_
;
bool
verbose_
;
double
initial_cost_
;
};
};
}
}
...
...
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