Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bodydynamics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
plugins
bodydynamics
Commits
5669d8e4
Commit
5669d8e4
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Fix 420
parent
d22f42c6
No related branches found
No related tags found
3 merge requests
!18
Release after RAL
,
!17
After 2nd RAL submission
,
!16
Resolve "Follow core 420"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/processor/processor_inertial_kinematics.cpp
+13
-13
13 additions, 13 deletions
src/processor/processor_inertial_kinematics.cpp
src/processor/processor_point_feet_nomove.cpp
+11
-11
11 additions, 11 deletions
src/processor/processor_point_feet_nomove.cpp
with
24 additions
and
24 deletions
src/processor/processor_inertial_kinematics.cpp
+
13
−
13
View file @
5669d8e4
...
...
@@ -53,11 +53,11 @@ inline void ProcessorInertialKinematics::processCapture(CaptureBasePtr _capture)
}
// nothing to do if any of the two buffer is empty
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"PInertialKinematic: KF pack buffer empty, time "
,
_capture
->
getTimeStamp
());
return
;
}
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"PInertialKinematics: Capture buffer empty, time "
,
_capture
->
getTimeStamp
());
return
;
}
...
...
@@ -69,21 +69,21 @@ inline void ProcessorInertialKinematics::processCapture(CaptureBasePtr _capture)
// 1. get corresponding KF
FrameBasePtr
kf
;
auto
buffer_
pack_kf
_it
=
buffer_
pack_kf
_
.
getContainer
().
begin
();
auto
buffer_
frame
_it
=
buffer_
frame
_
.
getContainer
().
begin
();
auto
buffer_capture_it
=
buffer_capture_
.
getContainer
().
begin
();
auto
sensor_angvel
=
getProblem
()
->
getSensor
(
params_ikin_
->
sensor_angvel_name
);
while
((
buffer_
pack_kf
_it
!=
buffer_
pack_kf
_
.
getContainer
().
end
())
while
((
buffer_
frame
_it
!=
buffer_
frame
_
.
getContainer
().
end
())
&&
(
buffer_capture_it
!=
buffer_capture_
.
getContainer
().
end
()))
{
bool
time_ok
=
buffer_capture_
.
simpleCheckTimeTolerance
(
buffer_
pack_kf
_it
->
first
,
buffer_capture_it
->
first
,
buffer_
pack_kf
_it
->
second
->
t
ime
_t
olerance
);
bool
time_ok
=
buffer_capture_
.
simpleCheckTimeTolerance
(
buffer_
frame
_it
->
first
,
buffer_capture_it
->
first
,
buffer_
frame
_it
->
second
->
getT
ime
T
olerance
()
);
if
(
time_ok
)
{
CaptureBasePtr
cap_angvel
=
buffer_
pack_kf
_it
->
second
->
key_frame
->
getCaptureOf
(
sensor_angvel
);
auto
min_ts
=
(
buffer_
pack_kf
_it
->
first
<
buffer_capture_it
->
first
)
?
buffer_
pack_kf
_it
->
first
:
buffer_capture_it
->
first
;
CaptureBasePtr
cap_angvel
=
buffer_
frame
_it
->
second
->
getCaptureOf
(
sensor_angvel
);
auto
min_ts
=
(
buffer_
frame
_it
->
first
<
buffer_capture_it
->
first
)
?
buffer_
frame
_it
->
first
:
buffer_capture_it
->
first
;
if
(
cap_angvel
&&
cap_angvel
->
getStateBlock
(
'I'
)){
// TODO: or only cap_angvel?
// cast incoming capture to the InertialKinematics type, add it to the keyframe
auto
kf
=
buffer_
pack_kf
_it
->
second
->
key_frame
;
auto
kf
=
buffer_
frame
_it
->
second
;
auto
cap_ikin
=
std
::
static_pointer_cast
<
CaptureInertialKinematics
>
(
buffer_capture_it
->
second
);
cap_ikin
->
link
(
kf
);
createInertialKinematicsFactor
(
cap_ikin
,
...
...
@@ -92,27 +92,27 @@ inline void ProcessorInertialKinematics::processCapture(CaptureBasePtr _capture)
// update pointer to origin capture (the previous one attached to a KF) if we have created a new factor
cap_origin_ptr_
=
buffer_capture_it
->
second
;
buffer_capture_it
++
;
buffer_
pack_kf
_it
++
;
buffer_
frame
_it
++
;
}
else
{
// if time ok but no capture angvel yet, there is not gonna be any in the next KF of the buffer
break
;
buffer_capture_it
++
;
buffer_
pack_kf
_it
++
;
buffer_
frame
_it
++
;
}
////////////////
// remove everything before (Inclusive if equal) this timestamp -> the cap_angvel is yet to come
buffer_
pack_kf
_
.
removeUpTo
(
min_ts
);
buffer_
frame
_
.
removeUpTo
(
min_ts
);
buffer_capture_
.
removeUpTo
(
min_ts
);
}
else
{
// if a time difference between captures and KF pack, we increment the oldest iterator
if
(
buffer_capture_it
->
first
<
buffer_
pack_kf
_it
->
first
){
if
(
buffer_capture_it
->
first
<
buffer_
frame
_it
->
first
){
buffer_capture_it
++
;
}
else
{
buffer_
pack_kf
_it
++
;
buffer_
frame
_it
++
;
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/processor/processor_point_feet_nomove.cpp
+
11
−
11
View file @
5669d8e4
...
...
@@ -46,14 +46,14 @@ void ProcessorPointFeetNomove::configure(SensorBasePtr _sensor)
void
ProcessorPointFeetNomove
::
createFactorIfNecessary
(){
auto
sensor_pfnm
=
std
::
static_pointer_cast
<
SensorPointFeetNomove
>
(
getSensor
());
while
(
buffer_
pack_kf
_
.
size
()
>=
2
)
while
(
buffer_
frame
_
.
size
()
>=
2
)
{
auto
kf1_it
=
buffer_
pack_kf
_
.
getContainer
().
begin
();
auto
kf1_it
=
buffer_
frame
_
.
getContainer
().
begin
();
auto
kf2_it
=
std
::
next
(
kf1_it
);
TimeStamp
t1
=
kf1_it
->
first
;
TimeStamp
t2
=
kf2_it
->
first
;
auto
cap1_it
=
buffer_capture_
.
selectIterator
(
t1
,
kf1_it
->
second
->
t
ime
_t
olerance
);
auto
cap2_it
=
buffer_capture_
.
selectIterator
(
t2
,
kf1_it
->
second
->
t
ime
_t
olerance
);
auto
cap1_it
=
buffer_capture_
.
selectIterator
(
t1
,
kf1_it
->
second
->
getT
ime
T
olerance
()
);
auto
cap2_it
=
buffer_capture_
.
selectIterator
(
t2
,
kf1_it
->
second
->
getT
ime
T
olerance
()
);
// check that the first 2 KF have corresponding captures in the capture buffer
// just quit and assume that you will someday have matching captures
...
...
@@ -101,7 +101,7 @@ void ProcessorPointFeetNomove::createFactorIfNecessary(){
auto
cap2
=
std
::
static_pointer_cast
<
CapturePointFeetNomove
>
(
cap2_it
->
second
);
// link (kind of arbitrarily) factor from KF1 to KF2 with a feature and capture on KF2 to mimic capture motion
// however, this capture solely does not contain enough information to recreate the factor
cap2
->
link
(
kf2_it
->
second
->
key_frame
);
cap2
->
link
(
kf2_it
->
second
);
auto
kin_incontact_t2
=
cap2
->
kin_incontact_
;
for
(
auto
kin_pair1
:
kin_incontact_from_t1
){
...
...
@@ -109,13 +109,13 @@ void ProcessorPointFeetNomove::createFactorIfNecessary(){
Vector6d
meas
;
meas
<<
kin_pair1
.
second
,
kin_pair2_it
->
second
;
FeatureBasePtr
feat
=
FeatureBase
::
emplace
<
FeatureBase
>
(
cap2
,
"PointFeet"
,
meas
,
sensor_pfnm
->
getCovFootNomove
());
FactorPointFeetNomovePtr
fac
=
FactorBase
::
emplace
<
FactorPointFeetNomove
>
(
feat
,
feat
,
kf1_it
->
second
->
key_frame
,
nullptr
,
true
);
FactorPointFeetNomovePtr
fac
=
FactorBase
::
emplace
<
FactorPointFeetNomove
>
(
feat
,
feat
,
kf1_it
->
second
,
nullptr
,
true
);
}
}
// Once the factors are created, remove kf1 and all the captures until ts 2 NOT INCLUDING the one at ts 2 since we need it for the next
// Note: erase by range does not include the end range iterator
buffer_
pack_kf
_
.
getContainer
().
erase
(
buffer_
pack_kf
_
.
getContainer
().
begin
(),
kf2_it
);
// !! works only if getContainer returns a non const reference
buffer_
frame
_
.
getContainer
().
erase
(
buffer_
frame
_
.
getContainer
().
begin
(),
kf2_it
);
// !! works only if getContainer returns a non const reference
buffer_capture_
.
getContainer
().
erase
(
buffer_capture_
.
getContainer
().
begin
(),
cap2_it
);
}
}
...
...
@@ -130,11 +130,11 @@ inline void ProcessorPointFeetNomove::processCapture(CaptureBasePtr _capture)
return
;
}
// nothing to do if any of the two buffer is empty
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"PInertialKinematic: KF pack buffer empty, time "
,
_capture
->
getTimeStamp
());
return
;
}
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"PInertialKinematics: Capture buffer empty, time "
,
_capture
->
getTimeStamp
());
return
;
}
...
...
@@ -151,11 +151,11 @@ inline void ProcessorPointFeetNomove::processKeyFrame(FrameBasePtr _keyframe_ptr
return
;
}
// nothing to do if any of the two buffer is empty
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"ProcessorPointFeetNomove: KF pack buffer empty, time "
,
_keyframe_ptr
->
getTimeStamp
());
return
;
}
if
(
buffer_
pack_kf
_
.
empty
()){
if
(
buffer_
frame
_
.
empty
()){
WOLF_DEBUG
(
"ProcessorPointFeetNomove: Capture buffer empty, time "
,
_keyframe_ptr
->
getTimeStamp
());
return
;
}
...
...
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