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
54855703
Commit
54855703
authored
6 years ago
by
Joan Solà Ortega
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/capture_process' into 'devel'
Feature/capture process See merge request mobile_robotics/wolf!238
parents
5b1f59da
60f5743b
No related branches found
No related tags found
1 merge request
!238
Feature/capture process
Pipeline
#2443
passed
6 years ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/capture_base.h
+10
-0
10 additions, 0 deletions
src/capture_base.h
src/processor_tracker.cpp
+2
-1
2 additions, 1 deletion
src/processor_tracker.cpp
src/test/gtest_capture_base.cpp
+9
-0
9 additions, 0 deletions
src/test/gtest_capture_base.cpp
with
21 additions
and
1 deletion
src/capture_base.h
+
10
−
0
View file @
54855703
...
...
@@ -50,6 +50,8 @@ class CaptureBase : public NodeBase, public std::enable_shared_from_this<Capture
// Type
virtual
bool
isMotion
()
const
{
return
false
;
}
bool
process
();
unsigned
int
id
();
TimeStamp
getTimeStamp
()
const
;
void
setTimeStamp
(
const
TimeStamp
&
_ts
);
...
...
@@ -220,6 +222,14 @@ inline void CaptureBase::setTimeStampToNow()
time_stamp_
.
setToNow
();
}
inline
bool
CaptureBase
::
process
()
{
assert
(
getSensorPtr
()
!=
nullptr
&&
"Attempting to process a capture with no associated sensor. Either set the capture's sensor or call sensor->process(capture) instead."
);
return
getSensorPtr
()
->
process
(
shared_from_this
());
}
}
// namespace wolf
#endif
This diff is collapsed.
Click to expand it.
src/processor_tracker.cpp
+
2
−
1
View file @
54855703
...
...
@@ -61,8 +61,9 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
pack
->
key_frame
->
addCapture
(
incoming_ptr_
);
// Process info
// TrackerFeature: We only process new features in Last, here last = nullptr, so we do not have anything to do.
// TrackerLandmark: If we have given a map, all landmarks in the map are know. Process them.
processKnown
();
// We only process new features in Last, here last = nullptr, so we do not have anything to do.
// Update pointers
resetDerived
();
...
...
This diff is collapsed.
Click to expand it.
src/test/gtest_capture_base.cpp
+
9
−
0
View file @
54855703
...
...
@@ -103,6 +103,15 @@ TEST(CaptureBase, addFeatureList)
ASSERT_EQ
(
C
->
getFeatureList
().
back
(),
f_last
);
}
TEST
(
CaptureBase
,
process
)
{
SensorBasePtr
S
(
std
::
make_shared
<
SensorBase
>
(
"DUMMY"
,
nullptr
,
nullptr
,
nullptr
,
2
));
CaptureBasePtr
C
(
std
::
make_shared
<
CaptureBase
>
(
"DUMMY"
,
1.5
,
nullptr
));
ASSERT_DEATH
({
C
->
process
();},
""
);
// No sensor in the capture should fail
C
->
setSensorPtr
(
S
);
ASSERT_TRUE
(
C
->
process
());
// This should not fail (although it does nothing)
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
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