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
1cc9ab21
Commit
1cc9ab21
authored
7 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Add calib params in getDelta()
parent
f79a6992
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/capture_motion.cpp
+4
-12
4 additions, 12 deletions
src/capture_motion.cpp
src/capture_motion.h
+2
-2
2 additions, 2 deletions
src/capture_motion.h
src/processor_imu.h
+0
-2
0 additions, 2 deletions
src/processor_imu.h
src/processor_motion.h
+2
-2
2 additions, 2 deletions
src/processor_motion.h
with
8 additions
and
18 deletions
src/capture_motion.cpp
+
4
−
12
View file @
1cc9ab21
...
...
@@ -69,30 +69,22 @@ void CaptureMotion::setCalibration(const VectorXs& _calib)
}
Eigen
::
VectorXs
CaptureMotion
::
getDelta
()
Eigen
::
VectorXs
CaptureMotion
::
getDelta
(
const
VectorXs
&
_calib_current
)
{
VectorXs
calib_preint
=
getCalibrationPreint
();
VectorXs
calib
=
getCalibration
();
VectorXs
delta_preint
=
getBuffer
().
get
().
back
().
delta_integr_
;
MatrixXs
jac_calib
=
getBuffer
().
get
().
back
().
jacobian_calib_
;
VectorXs
delta_error
=
jac_calib
*
(
calib
-
calib_preint
);
VectorXs
delta_error
=
jac_calib
*
(
_
calib
_current
-
calib_preint
);
VectorXs
delta
=
correctDelta
(
delta_preint
,
delta_error
);
// WOLF_DEBUG("cal_preint: ", calib_preint.transpose());
// WOLF_DEBUG("cal : ", calib.transpose());
// WOLF_DEBUG("delta_preint: ", delta_preint.transpose());
// WOLF_DEBUG("Jac_calib: \n", jac_calib);
// WOLF_DEBUG("delta error: ", delta_error.transpose());
// WOLF_DEBUG("delta: ", delta.transpose());
return
delta
;
}
Eigen
::
VectorXs
CaptureMotion
::
getDelta
(
const
TimeStamp
&
_ts
)
Eigen
::
VectorXs
CaptureMotion
::
getDelta
(
const
VectorXs
&
_calib_current
,
const
TimeStamp
&
_ts
)
{
VectorXs
calib_preint
=
getCalibrationPreint
();
VectorXs
calib
=
getCalibration
();
VectorXs
delta_preint
=
getBuffer
().
getMotion
(
_ts
).
delta_integr_
;
MatrixXs
jac_calib
=
getBuffer
().
getMotion
(
_ts
).
jacobian_calib_
;
VectorXs
delta_error
=
jac_calib
*
(
calib
-
calib_preint
);
VectorXs
delta_error
=
jac_calib
*
(
_
calib
_current
-
calib_preint
);
VectorXs
delta
=
correctDelta
(
delta_preint
,
delta_error
);
return
delta
;
}
...
...
This diff is collapsed.
Click to expand it.
src/capture_motion.h
+
2
−
2
View file @
1cc9ab21
...
...
@@ -80,8 +80,8 @@ class CaptureMotion : public CaptureBase
MatrixXs
getJacobianCalib
(
const
TimeStamp
&
_ts
);
// Get delta, corrected for changes on calibration params
VectorXs
getDelta
();
VectorXs
getDelta
(
const
TimeStamp
&
_ts
);
VectorXs
getDelta
(
const
VectorXs
&
_calib_current
);
VectorXs
getDelta
(
const
VectorXs
&
_calib_current
,
const
TimeStamp
&
_ts
);
virtual
VectorXs
correctDelta
(
const
VectorXs
&
_delta
,
const
VectorXs
&
_delta_error
);
// Origin frame
...
...
This diff is collapsed.
Click to expand it.
src/processor_imu.h
+
0
−
2
View file @
1cc9ab21
...
...
@@ -165,7 +165,6 @@ inline void ProcessorIMU::computeCurrentDelta(const Eigen::VectorXs& _data,
Vector3s
delta_v
=
a_dt
;
_delta
<<
delta_p
,
delta_q
.
coeffs
()
,
delta_v
;
/* Compute jacobian of delta wrt data
*
* MATHS : jacobian dd_dn, of delta wrt noise
...
...
@@ -245,7 +244,6 @@ inline void ProcessorIMU::deltaPlusDelta(const Eigen::VectorXs& _delta_preint,
*/
imu
::
compose
(
_delta_preint
,
_delta
,
_dt
,
_delta_preint_plus_delta
,
_jacobian_delta_preint
,
_jacobian_delta
);
}
inline
void
ProcessorIMU
::
deltaPlusDelta
(
const
Eigen
::
VectorXs
&
_delta_preint
,
...
...
This diff is collapsed.
Click to expand it.
src/processor_motion.h
+
2
−
2
View file @
1cc9ab21
...
...
@@ -472,7 +472,7 @@ inline void ProcessorMotion::getState(const TimeStamp& _ts, Eigen::VectorXs& _x)
{
// We found a CaptureMotion whose buffer contains the time stamp
VectorXs
state_0
=
capture_motion
->
getOriginFramePtr
()
->
getState
();
VectorXs
delta
=
capture_motion
->
getDelta
(
_ts
);
VectorXs
delta
=
capture_motion
->
getDelta
(
std
::
static_pointer_cast
<
CaptureMotion
>
(
origin_ptr_
)
->
getCalibration
(),
_ts
);
Scalar
dt
=
_ts
-
capture_motion
->
getBuffer
().
get
().
front
().
ts_
;
statePlusDelta
(
state_0
,
delta
,
dt
,
_x
);
...
...
@@ -496,7 +496,7 @@ inline Eigen::VectorXs ProcessorMotion::getCurrentState()
inline
void
ProcessorMotion
::
getCurrentState
(
Eigen
::
VectorXs
&
_x
)
{
Scalar
Dt
=
getCurrentTimeStamp
()
-
origin_ptr_
->
getTimeStamp
();
statePlusDelta
(
origin_ptr_
->
getFramePtr
()
->
getState
(),
last_ptr_
->
getDelta
(),
Dt
,
_x
);
statePlusDelta
(
origin_ptr_
->
getFramePtr
()
->
getState
(),
last_ptr_
->
getDelta
(
std
::
static_pointer_cast
<
CaptureMotion
>
(
origin_ptr_
)
->
getCalibration
()
),
Dt
,
_x
);
}
inline
void
ProcessorMotion
::
getCurrentStateAndStamp
(
Eigen
::
VectorXs
&
_x
,
TimeStamp
&
_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