Skip to content

Commit

Permalink
feat(time_synchronizer_nodelet): set input_offsets zero if it was not…
Browse files Browse the repository at this point in the history
… defined (autowarefoundation#6664)

Signed-off-by: Berkay Karaman <brkay54@gmail.com>
  • Loading branch information
brkay54 authored and anhnv3991 committed Apr 5, 2024
1 parent fcf0529 commit 45f77be
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@ PointCloudDataSynchronizerComponent::PointCloudDataSynchronizerComponent(
timeout_sec_ = static_cast<double>(declare_parameter("timeout_sec", 0.1));

input_offset_ = declare_parameter("input_offset", std::vector<double>{});
if (!input_offset_.empty() && input_topics_.size() != input_offset_.size()) {

// If input_offset_ is not defined, set all offsets to 0
if (input_offset_.empty()) {
input_offset_.resize(input_topics_.size(), 0.0);
RCLCPP_INFO(get_logger(), "Input offset is not defined. Set all offsets to 0.0.");
} else if (input_topics_.size() != input_offset_.size()) {
RCLCPP_ERROR(get_logger(), "The number of topics does not match the number of offsets.");
return;
}
Expand Down

0 comments on commit 45f77be

Please sign in to comment.