Skip to content

Commit

Permalink
fuse optimizers cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
giafranchini committed Jan 11, 2024
1 parent 4366749 commit 34a3ab3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
8 changes: 0 additions & 8 deletions fuse_optimizers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ target_link_libraries(${PROJECT_NAME}
)
ament_target_dependencies(${PROJECT_NAME} diagnostic_updater)

## batch_optimizer node
# add_executable(batch_optimizer_node src/batch_optimizer_node.cpp)
# target_link_libraries(batch_optimizer_node ${PROJECT_NAME})

## fixed_lag_smoother node
# add_executable(fixed_lag_smoother_node src/fixed_lag_smoother_node.cpp)
# target_link_libraries(fixed_lag_smoother_node ${PROJECT_NAME})

## batch_optimizer component
add_library(batch_optimizer_component SHARED src/batch_optimizer_component.cpp)
target_include_directories(batch_optimizer_component PRIVATE include)
Expand Down
8 changes: 1 addition & 7 deletions fuse_optimizers/src/fixed_lag_smoother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ void FixedLagSmoother::optimizationLoop()
while (interfaces_.get_node_base_interface()->get_context()->is_valid() &&
optimization_running_)
{
RCLCPP_DEBUG(logger_, "In the optimization loop");
// Wait for the next signal to start the next optimization cycle
// NOTE(CH3): Uninitialized, but it's ok since it's meant to get overwritten.
auto optimization_deadline = rclcpp::Time(0, 0, RCL_ROS_TIME);
Expand All @@ -214,7 +213,6 @@ void FixedLagSmoother::optimizationLoop()
}
// Optimize
{
RCLCPP_DEBUG(logger_, "optimizing");
std::lock_guard<std::mutex> lock(optimization_mutex_);
// Apply motion models
auto new_transaction = fuse_core::Transaction::make_shared();
Expand Down Expand Up @@ -255,8 +253,6 @@ void FixedLagSmoother::optimizationLoop()
// Optimize the entire graph
summary_ = graph_->optimize(params_.solver_options);

// std::cout << summary_.FullReport() << std::endl;

// Optimization is complete. Notify all the things about the graph changes.
const auto new_transaction_stamp = new_transaction->stamp();
notify(std::move(new_transaction), graph_->clone());
Expand Down Expand Up @@ -294,9 +290,7 @@ void FixedLagSmoother::optimizationLoop()
<< (optimization_complete - optimization_deadline).nanoseconds() << "ns");
}
}
RCLCPP_DEBUG(logger_, "Ending while loop");
}
RCLCPP_DEBUG(logger_, "optimization finished");
}

void FixedLagSmoother::optimizerTimerCallback()
Expand Down Expand Up @@ -406,6 +400,7 @@ void FixedLagSmoother::processQueue(
return;
}
}

// Use the most recent transaction time as the current time
const auto current_time = pending_transactions_.front().stamp();

Expand Down Expand Up @@ -505,7 +500,6 @@ void FixedLagSmoother::transactionCallback(
fuse_core::Transaction::SharedPtr transaction)
{
// If this transaction occurs before the start time, just ignore it
RCLCPP_DEBUG(logger_, "transactionCallback: inside transactionCallback");
auto start_time = getStartTime();
const auto max_time = transaction->maxStamp();
if (started_ && max_time < start_time) {
Expand Down

0 comments on commit 34a3ab3

Please sign in to comment.