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
af46fcd3
Commit
af46fcd3
authored
3 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Patches
Plain Diff
Minor cleanup
parent
0ad9ff88
No related branches found
No related tags found
3 merge requests
!436
Release to start wolf public
,
!433
After 2nd RA-L submission
,
!431
Resolve "Add time_tolerance field in Frame and remove PackKeyFrame"
Pipeline
#7848
failed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
demos/hello_wolf/processor_range_bearing.cpp
+10
-13
10 additions, 13 deletions
demos/hello_wolf/processor_range_bearing.cpp
with
10 additions
and
13 deletions
demos/hello_wolf/processor_range_bearing.cpp
+
10
−
13
View file @
af46fcd3
...
...
@@ -50,30 +50,27 @@ void ProcessorRangeBearing::processCapture(CaptureBasePtr _capture)
}
// 1. get KF
FrameBasePtr
k
f
(
nullptr
);
FrameBasePtr
k
eyframe
(
nullptr
);
if
(
!
buffer_frame_
.
empty
()
)
{
// KeyFrame Callback received
FrameBasePtr
keyframe
=
buffer_frame_
.
select
(
_capture
->
getTimeStamp
(),
params_
->
time_tolerance
);
if
(
keyframe
!=
nullptr
)
kf
=
keyframe
;
keyframe
=
buffer_frame_
.
select
(
_capture
->
getTimeStamp
(),
params_
->
time_tolerance
);
buffer_frame_
.
removeUpTo
(
_capture
->
getTimeStamp
()
);
assert
(
k
f
&&
"Callback KF is not close enough to _capture!"
);
assert
(
k
eyframe
&&
"Callback KF is not close enough to _capture!"
);
}
if
(
!
k
f
)
if
(
!
k
eyframe
)
{
// No KeyFrame callback received -- we assume a KF is available to hold this _capture (checked in assert below)
k
f
=
getProblem
()
->
closestFrameToTimeStamp
(
_capture
->
getTimeStamp
());
assert
(
(
fabs
(
k
f
->
getTimeStamp
()
-
_capture
->
getTimeStamp
())
<
params_
->
time_tolerance
)
&&
"Could not find a KF close enough to _capture!"
);
k
eyframe
=
getProblem
()
->
closestFrameToTimeStamp
(
_capture
->
getTimeStamp
());
assert
(
(
fabs
(
k
eyframe
->
getTimeStamp
()
-
_capture
->
getTimeStamp
())
<
params_
->
time_tolerance
)
&&
"Could not find a KF close enough to _capture!"
);
}
// 2. cast incoming capture to the range-and-bearing type, add it to the keyframe
CaptureRangeBearingPtr
capture_rb
=
std
::
static_pointer_cast
<
CaptureRangeBearing
>
(
_capture
);
capture_rb
->
link
(
k
f
);
capture_rb
->
link
(
k
eyframe
);
// 3. explore all observations in the capture
for
(
SizeEigen
i
=
0
;
i
<
capture_rb
->
getIds
().
size
();
i
++
)
...
...
@@ -103,14 +100,14 @@ void ProcessorRangeBearing::processCapture(CaptureBasePtr _capture)
}
// 5. create feature
Vector2d
rb
(
range
,
bearing
);
Vector2d
measurement_
rb
(
range
,
bearing
);
auto
ftr
=
FeatureBase
::
emplace
<
FeatureRangeBearing
>
(
capture_rb
,
rb
,
measurement_
rb
,
getSensor
()
->
getNoiseCov
());
// 6. create factor
auto
prc
=
shared_from_this
();
auto
ctr
=
FactorBase
::
emplace
<
FactorRangeBearing
>
(
ftr
,
auto
fac
=
FactorBase
::
emplace
<
FactorRangeBearing
>
(
ftr
,
capture_rb
,
ftr
,
lmk
,
...
...
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