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
2dce5d4c
Commit
2dce5d4c
authored
5 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Improve check()
Show where the factor's SB's where found
parent
2768132d
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
src/problem/problem.cpp
+54
-11
54 additions, 11 deletions
src/problem/problem.cpp
with
54 additions
and
11 deletions
src/problem/problem.cpp
+
54
−
11
View file @
2dce5d4c
...
...
@@ -1690,38 +1690,81 @@ bool Problem::check(int verbose_level) const
cout
<<
" (lp @ "
<<
lp
.
get
()
<<
")"
;
}
}
bool
found_here
;
std
::
vector
<
StateBlockPtr
>
sb_vec
;
// find in own Frame
found
=
found
||
(
std
::
find_if
(
F
->
getStateBlockMap
().
begin
(),
F
->
getStateBlockMap
().
end
(),
[
sb
](
const
std
::
pair
<
std
::
string
,
StateBlockPtr
>
&
t
)
->
bool
{
return
t
.
second
==
sb
;})
!=
F
->
getStateBlockMap
().
end
());
sb_vec
=
F
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" F"
<<
F
->
id
();
found
=
found
||
found_here
;
// find in own Capture
found
=
found
||
(
std
::
find
(
C
->
getStateBlockVec
().
begin
(),
C
->
getStateBlockVec
().
end
(),
sb
)
!=
C
->
getStateBlockVec
().
end
());
sb_vec
=
C
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" C"
<<
C
->
id
();
found
=
found
||
found_here
;
// find in own Sensor
if
(
S
)
{
auto
sb_vec
=
S
->
getStateBlockVec
();
found
=
found
||
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
sb_vec
=
S
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" S"
<<
S
->
id
();
found
=
found
||
found_here
;
}
// find in constrained Frame
if
(
Fo
)
found
=
found
||
(
std
::
find_if
(
Fo
->
getStateBlockMap
().
begin
(),
Fo
->
getStateBlockMap
().
end
(),
[
sb
](
const
std
::
pair
<
std
::
string
,
StateBlockPtr
>
&
t
)
->
bool
{
return
t
.
second
==
sb
;})
!=
Fo
->
getStateBlockMap
().
end
());
if
(
Fo
){
sb_vec
=
Fo
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" Fo"
<<
Fo
->
id
();
found
=
found
||
found_here
;
}
// find in constrained Capture
if
(
Co
)
found
=
found
||
(
std
::
find
(
Co
->
getStateBlockVec
().
begin
(),
Co
->
getStateBlockVec
().
end
(),
sb
)
!=
Co
->
getStateBlockVec
().
end
());
{
sb_vec
=
Co
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" Co"
<<
Co
->
id
();
found
=
found
||
found_here
;
}
// find in constrained Feature
if
(
fo
)
{
// find in constrained feature's Frame
FrameBasePtr
foF
=
fo
->
getFrame
();
found
=
found
||
(
std
::
find_if
(
foF
->
getStateBlockMap
().
begin
(),
foF
->
getStateBlockMap
().
end
(),
[
sb
](
const
std
::
pair
<
std
::
string
,
StateBlockPtr
>
&
t
)
->
bool
{
return
t
.
second
==
sb
;})
!=
foF
->
getStateBlockMap
().
end
());
sb_vec
=
foF
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" foF"
<<
foF
->
id
();
found
=
found
||
found_here
;
// find in constrained feature's Capture
CaptureBasePtr
foC
=
fo
->
getCapture
();
found
=
found
||
(
std
::
find
(
foC
->
getStateBlockVec
().
begin
(),
foC
->
getStateBlockVec
().
end
(),
sb
)
!=
foC
->
getStateBlockVec
().
end
());
sb_vec
=
foC
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" foC"
<<
foC
->
id
();
found
=
found
||
found_here
;
// find in constrained feature's Sensor
SensorBasePtr
foS
=
fo
->
getCapture
()
->
getSensor
();
found
=
found
||
(
std
::
find
(
foS
->
getStateBlockVec
().
begin
(),
foS
->
getStateBlockVec
().
end
(),
sb
)
!=
foS
->
getStateBlockVec
().
end
());
sb_vec
=
foS
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" foS"
<<
foS
->
id
();
found
=
found
||
found_here
;
}
// find in constrained landmark
if
(
Lo
)
found
=
found
||
(
std
::
find_if
(
Lo
->
getStateBlockMap
().
begin
(),
Lo
->
getStateBlockMap
().
end
(),
[
sb
](
const
std
::
pair
<
std
::
string
,
StateBlockPtr
>
&
t
)
->
bool
{
return
t
.
second
==
sb
;})
!=
Lo
->
getStateBlockMap
().
end
());
{
sb_vec
=
Lo
->
getStateBlockVec
();
found_here
=
(
std
::
find
(
sb_vec
.
begin
(),
sb_vec
.
end
(),
sb
)
!=
sb_vec
.
end
());
if
(
found_here
)
cout
<<
" Lo"
<<
Lo
->
id
();
found
=
found
||
found_here
;
}
if
(
verbose_level
>
0
)
{
if
(
found
)
...
...
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