Skip to content

Commit

Permalink
rename seach to search
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx committed Dec 17, 2024
1 parent 123cc3a commit ccc4204
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
efficiency: 1.0
safety: 1.0

grid_seach:
grid_search:
min: 0.1
max: 1.0
resolution: 0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ struct Parameters
double w1{1.0};
double w2{1.0};
double w3{1.0};
GridSearchParameters grid_seach{};
GridSearchParameters grid_search{};
TargetStateParameters target_state{};
};

Expand Down
26 changes: 13 additions & 13 deletions planning/autoware_planning_data_analyzer/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ BehaviorAnalyzerNode::BehaviorAnalyzerNode(const rclcpp::NodeOptions & node_opti
parameters_->w1 = declare_parameter<double>("weight.lon_comfortability");
parameters_->w2 = declare_parameter<double>("weight.efficiency");
parameters_->w3 = declare_parameter<double>("weight.safety");
parameters_->grid_seach.dt = declare_parameter<double>("grid_seach.dt");
parameters_->grid_seach.min = declare_parameter<double>("grid_seach.min");
parameters_->grid_seach.max = declare_parameter<double>("grid_seach.max");
parameters_->grid_seach.resolution = declare_parameter<double>("grid_seach.resolution");
parameters_->grid_seach.thread_num = declare_parameter<int>("grid_seach.thread_num");
parameters_->grid_search.dt = declare_parameter<double>("grid_search.dt");
parameters_->grid_search.min = declare_parameter<double>("grid_search.min");
parameters_->grid_search.max = declare_parameter<double>("grid_search.max");
parameters_->grid_search.resolution = declare_parameter<double>("grid_search.resolution");
parameters_->grid_search.thread_num = declare_parameter<int>("grid_search.thread_num");
parameters_->target_state.lat_positions =
declare_parameter<std::vector<double>>("target_state.lateral_positions");
parameters_->target_state.lat_velocities =
Expand Down Expand Up @@ -205,7 +205,7 @@ void BehaviorAnalyzerNode::weight(
[[maybe_unused]] const Trigger::Request::SharedPtr req, Trigger::Response::SharedPtr res)
{
std::lock_guard<std::mutex> lock(mutex_);
RCLCPP_INFO(get_logger(), "start weight grid seach.");
RCLCPP_INFO(get_logger(), "start weight grid search.");

const auto & p = parameters_;

Expand All @@ -215,9 +215,9 @@ void BehaviorAnalyzerNode::weight(

std::vector<Result> weight_grid;

double resolution = p->grid_seach.resolution;
double min = p->grid_seach.min;
double max = p->grid_seach.max;
double resolution = p->grid_search.resolution;
double min = p->grid_search.min;
double max = p->grid_search.max;
for (double w0 = min; w0 < max + 0.1 * resolution; w0 += resolution) {
for (double w1 = min; w1 < max + 0.1 * resolution; w1 += resolution) {
for (double w2 = min; w2 < max + 0.1 * resolution; w2 += resolution) {
Expand Down Expand Up @@ -246,7 +246,7 @@ void BehaviorAnalyzerNode::weight(

stop_watch.tic("total_time");
while (reader_.has_next() && rclcpp::ok()) {
update(bag_data, p->grid_seach.dt);
update(bag_data, p->grid_search.dt);

if (!bag_data->ready()) break;

Expand Down Expand Up @@ -282,22 +282,22 @@ void BehaviorAnalyzerNode::weight(
size_t i = 0;
while (rclcpp::ok()) {
std::vector<std::thread> threads;
for (size_t thread_id = 0; thread_id < p->grid_seach.thread_num; thread_id++) {
for (size_t thread_id = 0; thread_id < p->grid_search.thread_num; thread_id++) {
threads.emplace_back(update, data_set, i + thread_id);
}

for (auto & t : threads) t.join();

if (i + 1 > weight_grid.size()) break;

i += p->grid_seach.thread_num;
i += p->grid_search.thread_num;
}

show_best_result();
}
std::cout << "process time: " << stop_watch.toc("total_time") << "[ms]" << std::endl;

RCLCPP_INFO(get_logger(), "finish weight grid seach.");
RCLCPP_INFO(get_logger(), "finish weight grid search.");

res->success = true;
}
Expand Down

0 comments on commit ccc4204

Please sign in to comment.