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
3fa0c9bc
Commit
3fa0c9bc
authored
8 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
fix() and unfix() are global. Add fixIntrinsics() and fixExtrinsics()
parent
c9adc3ff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/sensor_base.cpp
+53
-3
53 additions, 3 deletions
src/sensor_base.cpp
src/sensor_base.h
+4
-0
4 additions, 0 deletions
src/sensor_base.h
with
57 additions
and
3 deletions
src/sensor_base.cpp
+
53
−
3
View file @
3fa0c9bc
...
...
@@ -97,7 +97,28 @@ void SensorBase::removeStateBlocks()
void
SensorBase
::
fix
()
{
// fix only extrinsics
for
(
auto
sbp
:
state_block_vec_
)
if
(
sbp
!=
nullptr
)
{
sbp
->
fix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
void
SensorBase
::
unfix
()
{
for
(
auto
sbp
:
state_block_vec_
)
if
(
sbp
!=
nullptr
)
{
sbp
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
inline
void
SensorBase
::
fixExtrinsics
()
{
for
(
unsigned
int
i
=
0
;
i
<
2
;
i
++
)
{
auto
sbp
=
state_block_vec_
[
i
];
...
...
@@ -110,9 +131,8 @@ void SensorBase::fix()
}
}
void
SensorBase
::
unfix
()
inline
void
SensorBase
::
unfix
Extrinsics
()
{
// unfix only extrinsics
for
(
unsigned
int
i
=
0
;
i
<
2
;
i
++
)
{
auto
sbp
=
state_block_vec_
[
i
];
...
...
@@ -125,6 +145,36 @@ void SensorBase::unfix()
}
}
inline
void
SensorBase
::
fixIntrinsics
()
{
for
(
unsigned
int
i
=
2
;
i
<
state_block_vec_
.
size
();
i
++
)
{
auto
sbp
=
state_block_vec_
[
i
];
if
(
sbp
!=
nullptr
)
{
sbp
->
fix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
}
inline
void
SensorBase
::
unfixIntrinsics
()
{
for
(
unsigned
int
i
=
2
;
i
<
state_block_vec_
.
size
();
i
++
)
{
auto
sbp
=
state_block_vec_
[
i
];
if
(
sbp
!=
nullptr
)
{
sbp
->
unfix
();
if
(
getProblem
()
!=
nullptr
)
getProblem
()
->
updateStateBlockPtr
(
sbp
);
}
}
}
void
SensorBase
::
registerNewStateBlocks
()
{
if
(
getProblem
()
!=
nullptr
)
...
...
This diff is collapsed.
Click to expand it.
src/sensor_base.h
+
4
−
0
View file @
3fa0c9bc
...
...
@@ -101,6 +101,10 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
void
fix
();
void
unfix
();
void
fixExtrinsics
();
void
unfixExtrinsics
();
void
fixIntrinsics
();
void
unfixIntrinsics
();
/** \brief Adds all stateBlocks of the sensor to the wolfProblem list of new stateBlocks
**/
...
...
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