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
7f67cee7
Commit
7f67cee7
authored
5 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
removed solver->ready() and better iterationCallback machinery
parent
90230197
No related branches found
No related tags found
No related merge requests found
Pipeline
#5762
passed
5 years ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/core/solver/solver_manager.h
+1
-5
1 addition, 5 deletions
include/core/solver/solver_manager.h
src/ceres_wrapper/solver_ceres.cpp
+18
-0
18 additions, 0 deletions
src/ceres_wrapper/solver_ceres.cpp
src/solver/solver_manager.cpp
+4
-7
4 additions, 7 deletions
src/solver/solver_manager.cpp
with
23 additions
and
12 deletions
include/core/solver/solver_manager.h
+
1
−
5
View file @
7f67cee7
...
...
@@ -73,7 +73,6 @@ class SolverManager
ProblemPtr
wolf_problem_
;
ParamsSolverPtr
params_
;
TimeStamp
last_solve_ts_
;
public
:
/**
...
...
@@ -116,10 +115,7 @@ class SolverManager
ProblemPtr
getProblem
();
/**
* \brief Returns if solve() should be called (according to period, can be derived to implement other criteria)
*/
virtual
bool
ready
()
const
;
double
getPeriod
()
const
;
ReportVerbosity
getVerbosity
()
const
;
...
...
This diff is collapsed.
Click to expand it.
src/ceres_wrapper/solver_ceres.cpp
+
18
−
0
View file @
7f67cee7
...
...
@@ -51,6 +51,24 @@ std::string SolverCeres::solveDerived(const ReportVerbosity report_level)
// run Ceres Solver
ceres
::
Solve
(
getSolverOptions
(),
ceres_problem_
.
get
(),
&
summary_
);
// if termination by user (Iteration callback, update and solve again)
// solve until max iterations reached
if
(
params_ceres_
->
update_immediately
)
{
auto
max_num_iterations
=
getSolverOptions
().
max_num_iterations
;
while
(
summary_
.
termination_type
==
ceres
::
USER_SUCCESS
)
{
// decrease wasted iterations
getSolverOptions
().
max_num_iterations
-=
summary_
.
iterations
.
size
();
if
(
getSolverOptions
().
max_num_iterations
<=
0
)
break
;
// update and solve again
update
();
ceres
::
Solve
(
getSolverOptions
(),
ceres_problem_
.
get
(),
&
summary_
);
}
getSolverOptions
().
max_num_iterations
=
max_num_iterations
;
}
std
::
string
report
;
//return report
...
...
This diff is collapsed.
Click to expand it.
src/solver/solver_manager.cpp
+
4
−
7
View file @
7f67cee7
...
...
@@ -112,8 +112,6 @@ std::string SolverManager::solve(const ReportVerbosity report_level)
// update problem
update
();
last_solve_ts_
=
TimeStamp
::
Now
();
// call derived solver
std
::
string
report
=
solveDerived
(
report_level
);
...
...
@@ -318,11 +316,6 @@ double* SolverManager::getAssociatedMemBlockPtr(const StateBlockPtr& state_ptr)
return
it
->
second
.
data
();
}
bool
SolverManager
::
ready
()
const
{
return
(
!
last_solve_ts_
.
ok
()
||
(
TimeStamp
::
Now
()
-
last_solve_ts_
)
>
params_
->
period
);
}
SolverManager
::
ReportVerbosity
SolverManager
::
getVerbosity
()
const
{
return
params_
->
verbose
;
...
...
@@ -338,6 +331,10 @@ bool SolverManager::isFactorRegistered(const FactorBasePtr& fac_ptr) const
return
isFactorRegisteredDerived
(
fac_ptr
);
}
double
SolverManager
::
getPeriod
()
const
{
return
params_
->
period
;
}
bool
SolverManager
::
check
(
std
::
string
prefix
)
const
{
...
...
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