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
f944a81c
Commit
f944a81c
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Move methods to cpp
parent
dd1564be
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/processor_motion.cpp
+23
-0
23 additions, 0 deletions
src/processor_motion.cpp
src/processor_motion.h
+0
-25
0 additions, 25 deletions
src/processor_motion.h
with
23 additions
and
25 deletions
src/processor_motion.cpp
+
23
−
0
View file @
f944a81c
...
@@ -141,6 +141,29 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr)
...
@@ -141,6 +141,29 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr)
incoming_ptr_
=
nullptr
;
// This line is not really needed, but it makes things clearer.
incoming_ptr_
=
nullptr
;
// This line is not really needed, but it makes things clearer.
}
}
void
ProcessorMotion
::
getState
(
const
TimeStamp
&
_ts
,
Eigen
::
VectorXs
&
_x
)
{
CaptureMotionPtr
capture_motion
;
if
(
_ts
>=
origin_ptr_
->
getTimeStamp
())
// timestamp found in the current processor buffer
capture_motion
=
last_ptr_
;
else
// We need to search in previous keyframes for the capture containing a motion buffer with the queried time stamp
capture_motion
=
getCaptureMotionContainingTimeStamp
(
_ts
);
if
(
capture_motion
)
{
// We found a CaptureMotion whose buffer contains the time stamp
VectorXs
state_0
=
capture_motion
->
getOriginFramePtr
()
->
getState
();
VectorXs
delta
=
capture_motion
->
getDeltaCorrected
(
origin_ptr_
->
getCalibration
(),
_ts
);
Scalar
dt
=
_ts
-
capture_motion
->
getBuffer
().
get
().
front
().
ts_
;
statePlusDelta
(
state_0
,
delta
,
dt
,
_x
);
}
else
// We could not find any CaptureMotion for the time stamp requested
std
::
runtime_error
(
"Could not find any Capture for the time stamp requested"
);
}
CaptureMotionPtr
ProcessorMotion
::
findCaptureContainingTimeStamp
(
const
TimeStamp
&
_ts
)
const
CaptureMotionPtr
ProcessorMotion
::
findCaptureContainingTimeStamp
(
const
TimeStamp
&
_ts
)
const
{
{
//std::cout << "ProcessorMotion::findCaptureContainingTimeStamp: ts = " << _ts.getSeconds() << "." << _ts.getNanoSeconds() << std::endl;
//std::cout << "ProcessorMotion::findCaptureContainingTimeStamp: ts = " << _ts.getSeconds() << "." << _ts.getNanoSeconds() << std::endl;
...
...
This diff is collapsed.
Click to expand it.
src/processor_motion.h
+
0
−
25
View file @
f944a81c
...
@@ -452,31 +452,6 @@ inline Eigen::VectorXs ProcessorMotion::getState(const TimeStamp& _ts)
...
@@ -452,31 +452,6 @@ inline Eigen::VectorXs ProcessorMotion::getState(const TimeStamp& _ts)
return
x
;
return
x
;
}
}
inline
void
ProcessorMotion
::
getState
(
const
TimeStamp
&
_ts
,
Eigen
::
VectorXs
&
_x
)
{
CaptureMotionPtr
capture_motion
;
if
(
_ts
>=
origin_ptr_
->
getTimeStamp
())
// timestamp found in the current processor buffer
capture_motion
=
last_ptr_
;
else
// We need to search in previous keyframes for the capture containing a motion buffer with the queried time stamp
capture_motion
=
getCaptureMotionContainingTimeStamp
(
_ts
);
if
(
capture_motion
)
{
// We found a CaptureMotion whose buffer contains the time stamp
VectorXs
state_0
=
capture_motion
->
getOriginFramePtr
()
->
getState
();
VectorXs
delta
=
capture_motion
->
getDeltaCorrected
(
origin_ptr_
->
getCalibration
(),
_ts
);
Scalar
dt
=
_ts
-
capture_motion
->
getBuffer
().
get
().
front
().
ts_
;
statePlusDelta
(
state_0
,
delta
,
dt
,
_x
);
}
else
// We could not find any CaptureMotion for the time stamp requested
std
::
runtime_error
(
"Could not find any Capture for the time stamp requested"
);
}
inline
wolf
::
TimeStamp
ProcessorMotion
::
getCurrentTimeStamp
()
inline
wolf
::
TimeStamp
ProcessorMotion
::
getCurrentTimeStamp
()
{
{
return
getBuffer
().
get
().
back
().
ts_
;
return
getBuffer
().
get
().
back
().
ts_
;
...
...
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