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
18b4dedb
Commit
18b4dedb
authored
8 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Generalize covariance accessors for more than 2 state blocks
parent
42a45332
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.cpp
+34
-6
34 additions, 6 deletions
src/problem.cpp
with
34 additions
and
6 deletions
src/problem.cpp
+
34
−
6
View file @
18b4dedb
...
...
@@ -454,7 +454,7 @@ void Problem::removeConstraintPtr(ConstraintBasePtr _constraint_ptr)
}
// Remove addition notification
if
(
ctr_found_it
!=
constraint_notification_list_
.
end
())
constraint_notification_list_
.
erase
(
ctr_found_it
);
constraint_notification_list_
.
erase
(
ctr_found_it
);
// FIXME see if the shared_ptr is still active and messing up
// Add remove notification
else
constraint_notification_list_
.
push_back
(
ConstraintNotification
({
REMOVE
,
nullptr
,
_constraint_ptr
->
id
()}));
...
...
@@ -503,15 +503,43 @@ bool Problem::getCovarianceBlock(StateBlockPtr _state1, StateBlockPtr _state2, E
bool
Problem
::
getFrameCovariance
(
FrameBasePtr
_frame_ptr
,
Eigen
::
MatrixXs
&
_covariance
)
{
return
getCovarianceBlock
(
_frame_ptr
->
getPPtr
(),
_frame_ptr
->
getPPtr
(),
_covariance
,
0
,
0
)
&&
getCovarianceBlock
(
_frame_ptr
->
getPPtr
(),
_frame_ptr
->
getOPtr
(),
_covariance
,
0
,
_frame_ptr
->
getPPtr
()
->
getSize
())
&&
getCovarianceBlock
(
_frame_ptr
->
getOPtr
(),
_frame_ptr
->
getPPtr
(),
_covariance
,
_frame_ptr
->
getPPtr
()
->
getSize
(),
0
)
&&
getCovarianceBlock
(
_frame_ptr
->
getOPtr
(),
_frame_ptr
->
getOPtr
(),
_covariance
,
_frame_ptr
->
getPPtr
()
->
getSize
()
,
_frame_ptr
->
getPPtr
()
->
getSize
());
// return getCovarianceBlock(_frame_ptr->getPPtr(), _frame_ptr->getPPtr(), _covariance, 0, 0 ) &&
// getCovarianceBlock(_frame_ptr->getPPtr(), _frame_ptr->getOPtr(), _covariance, 0, _frame_ptr->getPPtr()->getSize()) &&
// getCovarianceBlock(_frame_ptr->getOPtr(), _frame_ptr->getPPtr(), _covariance, _frame_ptr->getPPtr()->getSize(), 0 ) &&
// getCovarianceBlock(_frame_ptr->getOPtr(), _frame_ptr->getOPtr(), _covariance, _frame_ptr->getPPtr()->getSize(), _frame_ptr->getPPtr()->getSize());
bool
success
(
true
);
int
i
=
0
,
j
=
0
;
for
(
auto
sb_i
:
_frame_ptr
->
getStateBlockVec
())
{
if
(
sb_i
)
{
j
=
0
;
for
(
auto
sb_j
:
_frame_ptr
->
getStateBlockVec
())
{
if
(
sb_j
)
{
success
=
success
&&
getCovarianceBlock
(
sb_i
,
sb_j
,
_covariance
,
i
,
j
);
j
+=
sb_j
->
getSize
();
}
}
i
+=
sb_i
->
getSize
();
}
}
return
success
;
}
Eigen
::
MatrixXs
Problem
::
getFrameCovariance
(
FrameBasePtr
_frame_ptr
)
{
Eigen
::
MatrixXs
covariance
=
Eigen
::
MatrixXs
::
Zero
(
_frame_ptr
->
getPPtr
()
->
getSize
()
+
_frame_ptr
->
getOPtr
()
->
getSize
(),
_frame_ptr
->
getPPtr
()
->
getSize
()
+
_frame_ptr
->
getOPtr
()
->
getSize
());
Size
sz
=
0
;
for
(
auto
sb
:
_frame_ptr
->
getStateBlockVec
())
if
(
sb
)
sz
+=
sb
->
getSize
();
Eigen
::
MatrixXs
covariance
(
sz
,
sz
);
// Eigen::MatrixXs covariance = Eigen::MatrixXs::Zero(_frame_ptr->getPPtr()->getSize()+_frame_ptr->getOPtr()->getSize(), _frame_ptr->getPPtr()->getSize()+_frame_ptr->getOPtr()->getSize());
getFrameCovariance
(
_frame_ptr
,
covariance
);
return
covariance
;
}
...
...
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