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
9f3e5396
There was a problem fetching the pipeline mini graph.
Commit
9f3e5396
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Plain Diff
Merge branch 'kfpackmanager_alt' into kfpackmanager
parents
e5ed7915
e3168a0e
No related branches found
No related tags found
1 merge request
!157
Kfpackmanager
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/problem.cpp
+1
-1
1 addition, 1 deletion
src/problem.cpp
src/sensor_base.cpp
+37
-45
37 additions, 45 deletions
src/sensor_base.cpp
src/sensor_base.h
+2
-1
2 additions, 1 deletion
src/sensor_base.h
with
40 additions
and
47 deletions
src/problem.cpp
+
1
−
1
View file @
9f3e5396
...
@@ -704,7 +704,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks)
...
@@ -704,7 +704,7 @@ void Problem::print(int depth, bool constr_by, bool metric, bool state_blocks)
{
{
if
(
i
==
0
)
cout
<<
" Extr "
<<
(
S
->
isExtrinsicDynamic
()
?
"[Dyn]"
:
"[Sta]"
)
<<
" = ["
;
if
(
i
==
0
)
cout
<<
" Extr "
<<
(
S
->
isExtrinsicDynamic
()
?
"[Dyn]"
:
"[Sta]"
)
<<
" = ["
;
if
(
i
==
2
)
cout
<<
" Intr "
<<
(
S
->
isIntrinsicDynamic
()
?
"[Dyn]"
:
"[Sta]"
)
<<
" = ["
;
if
(
i
==
2
)
cout
<<
" Intr "
<<
(
S
->
isIntrinsicDynamic
()
?
"[Dyn]"
:
"[Sta]"
)
<<
" = ["
;
auto
sb
=
S
->
getStateBlockPtr
Auto
(
i
);
auto
sb
=
S
->
getStateBlockPtr
Dynamic
(
i
);
if
(
sb
)
if
(
sb
)
{
{
cout
<<
(
sb
->
isFixed
()
?
" Fix( "
:
" Est( "
)
<<
sb
->
getState
().
transpose
()
<<
" )"
;
cout
<<
(
sb
->
isFixed
()
?
" Fix( "
:
" Est( "
)
<<
sb
->
getState
().
transpose
()
<<
" )"
;
...
...
This diff is collapsed.
Click to expand it.
src/sensor_base.cpp
+
37
−
45
View file @
9f3e5396
...
@@ -218,6 +218,23 @@ void SensorBase::setNoiseCov(const Eigen::MatrixXs& _noise_cov) {
...
@@ -218,6 +218,23 @@ void SensorBase::setNoiseCov(const Eigen::MatrixXs& _noise_cov) {
noise_cov_
=
_noise_cov
;
noise_cov_
=
_noise_cov
;
}
}
CaptureBasePtr
SensorBase
::
lastCapture
(
void
)
{
// we search for the most recent Capture of this sensor
CaptureBasePtr
capture
=
nullptr
;
FrameBaseList
frame_list
=
getProblem
()
->
getTrajectoryPtr
()
->
getFrameList
();
FrameBaseRevIter
frame_rev_it
=
frame_list
.
rbegin
();
while
(
frame_rev_it
!=
frame_list
.
rend
())
{
CaptureBasePtr
capture
=
(
*
frame_rev_it
)
->
getCaptureOf
(
shared_from_this
());
if
(
capture
)
// found the most recent Capture made by this sensor !
break
;
frame_rev_it
++
;
}
return
capture
;
}
CaptureBasePtr
SensorBase
::
lastCapture
(
const
TimeStamp
&
_ts
)
CaptureBasePtr
SensorBase
::
lastCapture
(
const
TimeStamp
&
_ts
)
{
{
// we search for the most recent Capture of this sensor before _ts
// we search for the most recent Capture of this sensor before _ts
...
@@ -255,44 +272,17 @@ StateBlockPtr SensorBase::getIntrinsicPtr(const TimeStamp _ts)
...
@@ -255,44 +272,17 @@ StateBlockPtr SensorBase::getIntrinsicPtr(const TimeStamp _ts)
StateBlockPtr
SensorBase
::
getPPtr
()
StateBlockPtr
SensorBase
::
getPPtr
()
{
{
ProblemPtr
P
=
getProblem
();
return
getStateBlockPtrDynamic
(
0
);
if
(
P
)
{
FrameBasePtr
KF
=
P
->
getLastKeyFramePtr
();
if
(
KF
)
{
return
getPPtr
(
KF
->
getTimeStamp
());
}
}
return
state_block_vec_
[
0
];
}
}
StateBlockPtr
SensorBase
::
getOPtr
()
StateBlockPtr
SensorBase
::
getOPtr
()
{
{
ProblemPtr
P
=
getProblem
();
return
getStateBlockPtrDynamic
(
1
);
if
(
P
)
{
FrameBasePtr
KF
=
P
->
getLastKeyFramePtr
();
if
(
KF
)
{
return
getOPtr
(
KF
->
getTimeStamp
());
}
}
return
state_block_vec_
[
1
];
}
}
StateBlockPtr
SensorBase
::
getIntrinsicPtr
()
StateBlockPtr
SensorBase
::
getIntrinsicPtr
()
{
{
ProblemPtr
P
=
getProblem
();
return
getStateBlockPtrDynamic
(
2
);
if
(
P
)
{
FrameBasePtr
KF
=
P
->
getLastKeyFramePtr
();
if
(
KF
)
{
return
getIntrinsicPtr
(
KF
->
getTimeStamp
());
}
}
return
state_block_vec_
[
2
];
}
}
wolf
::
Size
SensorBase
::
computeCalibSize
()
const
wolf
::
Size
SensorBase
::
computeCalibSize
()
const
...
@@ -346,30 +336,32 @@ ProcessorBasePtr SensorBase::addProcessor(ProcessorBasePtr _proc_ptr)
...
@@ -346,30 +336,32 @@ ProcessorBasePtr SensorBase::addProcessor(ProcessorBasePtr _proc_ptr)
return
_proc_ptr
;
return
_proc_ptr
;
}
}
StateBlockPtr
SensorBase
::
getStateBlockPtrDynamic
(
unsigned
int
_i
,
const
TimeStamp
&
_ts
)
StateBlockPtr
SensorBase
::
getStateBlockPtrDynamic
(
unsigned
int
_i
)
{
{
assert
(
_i
<
state_block_vec_
.
size
()
&&
"Requested a state block pointer out of the vector range!"
);
if
((
_i
<
2
&&
this
->
extrinsicsInCaptures
())
||
(
_i
>=
2
&&
intrinsicsInCaptures
()))
if
(((
_i
<
2
)
&&
extrinsicsInCaptures
())
||
((
_i
>=
2
)
&&
intrinsicsInCaptures
()))
{
{
CaptureBasePtr
cap
=
lastCapture
(
_ts
);
CaptureBasePtr
cap
=
lastCapture
();
return
cap
->
getStateBlockPtr
(
_i
);
if
(
cap
)
return
cap
->
getStateBlockPtr
(
_i
);
else
return
getStateBlockPtrStatic
(
_i
);
}
}
else
else
return
s
tate
_b
lock
_vec_
[
_i
]
;
return
getS
tate
B
lock
PtrStatic
(
_i
)
;
}
}
StateBlockPtr
SensorBase
::
getStateBlockPtr
Auto
(
unsigned
int
_i
)
StateBlockPtr
SensorBase
::
getStateBlockPtr
Dynamic
(
unsigned
int
_i
,
const
TimeStamp
&
_ts
)
{
{
ProblemPtr
P
=
getProblem
();
if
((
_i
<
2
&&
this
->
extrinsicsInCaptures
())
||
(
_i
>=
2
&&
intrinsicsInCaptures
()))
if
(
P
)
{
{
Fram
eBasePtr
KF
=
P
->
getLastKeyFramePtr
(
);
Captur
eBasePtr
cap
=
lastCapture
(
_ts
);
if
(
KF
)
if
(
cap
)
{
return
cap
->
getStateBlockPtr
(
_i
);
return
getStateBlockPtrDynamic
(
_i
,
KF
->
getTimeStamp
());
else
}
return
getStateBlockPtrStatic
(
_i
);
}
}
return
state_block_vec_
[
_i
];
else
return
getStateBlockPtrStatic
(
_i
);
}
}
}
// namespace wolf
}
// namespace wolf
This diff is collapsed.
Click to expand it.
src/sensor_base.h
+
2
−
1
View file @
9f3e5396
...
@@ -102,6 +102,7 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
...
@@ -102,6 +102,7 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
ProcessorBasePtr
addProcessor
(
ProcessorBasePtr
_proc_ptr
);
ProcessorBasePtr
addProcessor
(
ProcessorBasePtr
_proc_ptr
);
ProcessorBaseList
&
getProcessorList
();
ProcessorBaseList
&
getProcessorList
();
CaptureBasePtr
lastCapture
(
void
);
CaptureBasePtr
lastCapture
(
const
TimeStamp
&
_ts
);
CaptureBasePtr
lastCapture
(
const
TimeStamp
&
_ts
);
bool
process
(
const
CaptureBasePtr
capture_ptr
);
bool
process
(
const
CaptureBasePtr
capture_ptr
);
...
@@ -110,8 +111,8 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
...
@@ -110,8 +111,8 @@ class SensorBase : public NodeBase, public std::enable_shared_from_this<SensorBa
const
std
::
vector
<
StateBlockPtr
>&
getStateBlockVec
()
const
;
const
std
::
vector
<
StateBlockPtr
>&
getStateBlockVec
()
const
;
std
::
vector
<
StateBlockPtr
>&
getStateBlockVec
();
std
::
vector
<
StateBlockPtr
>&
getStateBlockVec
();
StateBlockPtr
getStateBlockPtrStatic
(
unsigned
int
_i
)
const
;
StateBlockPtr
getStateBlockPtrStatic
(
unsigned
int
_i
)
const
;
StateBlockPtr
getStateBlockPtrDynamic
(
unsigned
int
_i
);
StateBlockPtr
getStateBlockPtrDynamic
(
unsigned
int
_i
,
const
TimeStamp
&
_ts
);
StateBlockPtr
getStateBlockPtrDynamic
(
unsigned
int
_i
,
const
TimeStamp
&
_ts
);
StateBlockPtr
getStateBlockPtrAuto
(
unsigned
int
_i
);
void
setStateBlockPtrStatic
(
unsigned
int
_i
,
const
StateBlockPtr
_sb_ptr
);
void
setStateBlockPtrStatic
(
unsigned
int
_i
,
const
StateBlockPtr
_sb_ptr
);
void
resizeStateBlockVec
(
int
_size
);
void
resizeStateBlockVec
(
int
_size
);
...
...
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