Skip to content

Commit

Permalink
chore: remove set period
Browse files Browse the repository at this point in the history
Signed-off-by: vividf <[email protected]>
  • Loading branch information
vividf committed Feb 7, 2025
1 parent c99f1fe commit cbb94ec
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class CloudCollector
[[nodiscard]] std::shared_ptr<CollectorInfoBase> get_info() const;
void show_debug_message();
void reset();
void set_period(const int64_t new_period);

private:
std::shared_ptr<PointCloudConcatenateDataSynchronizerComponent> ros2_parent_node_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ bool CloudCollector::process_pointcloud(
if (status_ == CollectorStatus::Idle) {
// Add first pointcloud to the collector, restart the timer
status_ = CollectorStatus::Processing;
const auto period_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::duration<double>(timeout_sec_));
try {
set_period(period_ns.count());
} catch (rclcpp::exceptions::RCLError & ex) {
RCLCPP_WARN_THROTTLE(
ros2_parent_node_->get_logger(), *ros2_parent_node_->get_clock(), 5000, "%s", ex.what());
}
timer_->reset();
} else if (status_ == CollectorStatus::Processing) {
// Check if the map already contains an entry for the same topic. This shouldn't happen if the
Expand All @@ -103,22 +95,6 @@ bool CloudCollector::process_pointcloud(
return true;
}

void CloudCollector::set_period(const int64_t new_period)
{
if (!timer_) {
return;
}
int64_t old_period = 0;
rcl_ret_t ret = rcl_timer_get_period(timer_->get_timer_handle().get(), &old_period);
if (ret != RCL_RET_OK) {
rclcpp::exceptions::throw_from_rcl_error(ret, "Couldn't get old period");
}
ret = rcl_timer_exchange_period(timer_->get_timer_handle().get(), new_period, &old_period);
if (ret != RCL_RET_OK) {
rclcpp::exceptions::throw_from_rcl_error(ret, "Couldn't exchange_period");
}
}

CollectorStatus CloudCollector::get_status() const
{
return status_;
Expand Down

0 comments on commit cbb94ec

Please sign in to comment.