Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
2a569513
Commit
2a569513
authored
5 years ago
by
Sebastian Hahta
Browse files
Options
Downloads
Patches
Plain Diff
closes
#114
; precision depends on thread::sleep_for
parent
5a9c19b2
No related branches found
No related tags found
No related merge requests found
Pipeline
#12194
passed
5 years ago
Stage: all
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
components/rgbd-sources/src/snapshot.cpp
+8
-4
8 additions, 4 deletions
components/rgbd-sources/src/snapshot.cpp
with
8 additions
and
4 deletions
components/rgbd-sources/src/snapshot.cpp
+
8
−
4
View file @
2a569513
...
@@ -145,7 +145,9 @@ bool SnapshotWriter::addCameraRGBD(const string &name, const Mat &rgb, const Mat
...
@@ -145,7 +145,9 @@ bool SnapshotWriter::addCameraRGBD(const string &name, const Mat &rgb, const Mat
}
}
SnapshotStreamWriter
::
SnapshotStreamWriter
(
const
string
&
filename
,
int
delay
)
:
SnapshotStreamWriter
::
SnapshotStreamWriter
(
const
string
&
filename
,
int
delay
)
:
run_
(
false
),
finished_
(
false
),
writer_
(
filename
),
delay_
(
delay
)
{}
run_
(
false
),
finished_
(
false
),
delay_
(
delay
),
writer_
(
filename
)
{
DCHECK
(
delay
>
0
);
}
SnapshotStreamWriter
::~
SnapshotStreamWriter
()
{
SnapshotStreamWriter
::~
SnapshotStreamWriter
()
{
...
@@ -161,8 +163,10 @@ void SnapshotStreamWriter::run() {
...
@@ -161,8 +163,10 @@ void SnapshotStreamWriter::run() {
vector
<
Mat
>
depth
(
sources_
.
size
());
vector
<
Mat
>
depth
(
sources_
.
size
());
while
(
run_
)
{
while
(
run_
)
{
auto
now
=
std
::
chrono
::
system_clock
::
now
();
auto
t_now
=
std
::
chrono
::
system_clock
::
now
();
auto
duration
=
now
.
time_since_epoch
();
auto
t_wakeup
=
t_now
+
std
::
chrono
::
milliseconds
(
delay_
);
auto
duration
=
t_now
.
time_since_epoch
();
auto
ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
duration
).
count
();
auto
ms
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
duration
).
count
();
for
(
size_t
i
=
0
;
i
<
sources_
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
sources_
.
size
();
++
i
)
{
...
@@ -173,7 +177,7 @@ void SnapshotStreamWriter::run() {
...
@@ -173,7 +177,7 @@ void SnapshotStreamWriter::run() {
writer_
.
addCameraRGBD
(
std
::
to_string
(
ms
)
+
"-"
+
std
::
to_string
(
i
),
rgb
[
i
],
depth
[
i
]);
writer_
.
addCameraRGBD
(
std
::
to_string
(
ms
)
+
"-"
+
std
::
to_string
(
i
),
rgb
[
i
],
depth
[
i
]);
}
}
std
::
this_thread
::
sleep_
for
(
std
::
chrono
::
milliseconds
(
delay_
)
);
std
::
this_thread
::
sleep_
until
(
t_wakeup
);
}
}
run_
=
false
;
run_
=
false
;
...
...
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