Skip to content

Commit

Permalink
Rename and update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-hahn committed Dec 6, 2019
1 parent 415c913 commit 4bb4e0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions applications/maplab_node/include/maplab-node/synchronizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ class Synchronizer {
int64_t previous_nframe_timestamp_ns_;
// Threshold used to throttle the consecutively published NFrames.
const int64_t min_nframe_timestamp_diff_ns_;
// allow for slight variations in frame rate; relevant when camera frame rate
// and throttling rate nearly identical.
const float nframe_timestamp_diff_tolerance_;
// Tolerance factor between 0.0 and 1.0 to allow for slight variations in
// frame rate; relevant when camera frame rate and throttling rate nearly
// identical.
const float min_nframe_timestamp_diff_tolerance_factor_;

// Number of received odometry measurements.
int64_t odometry_measurement_counter_;
Expand Down
7 changes: 4 additions & 3 deletions applications/maplab_node/src/synchronizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DEFINE_double(
"Maximum output frequency of the synchronized NFrame structures "
"from the synchronizer.");
DEFINE_double(
vio_nframe_timestamp_diff_tolerance_, 0.95,
vio_nframe_sync_max_output_frequency_tolerance_factor_, 0.95,
"Tolerance on the minimum timestamp differance required by throttler above "
"which an nframe is released. This is helpful when the desired throttling "
"frequency is close to the actual frame rate and the latter has slight "
Expand Down Expand Up @@ -64,7 +64,7 @@ Synchronizer::Synchronizer(const vi_map::SensorManager& sensor_manager)
aslam::time::getInvalidTime()),
time_last_pointcloud_map_message_received_or_checked_ns_(
aslam::time::getInvalidTime()),
nframe_timestamp_diff_tolerance_(FLAGS_vio_nframe_timestamp_diff_tolerance_) {
min_nframe_timestamp_diff_tolerance_factor_(FLAGS_vio_nframe_sync_max_output_frequency_tolerance_factor_) {
CHECK_GT(FLAGS_vio_nframe_sync_max_output_frequency_hz, 0.);

if (FLAGS_enable_synchronizer_statistics) {
Expand Down Expand Up @@ -356,7 +356,8 @@ void Synchronizer::releaseNFrameData(
// the following nodes are running (e.g. tracker).
if (aslam::time::isValidTime(previous_nframe_timestamp_ns_)) {
if (current_frame_timestamp_ns - previous_nframe_timestamp_ns_ <
min_nframe_timestamp_diff_ns_ * nframe_timestamp_diff_tolerance_) {
min_nframe_timestamp_diff_ns_ *
min_nframe_timestamp_diff_tolerance_factor_) {
++frame_skip_counter_;
continue;
}
Expand Down

0 comments on commit 4bb4e0b

Please sign in to comment.