提交 ca78c387 编写于 作者: X Xiangquan Xiao 提交者: Jiangtao Hu

Robot: Code clean with clang-format.

上级 9b3f021a
......@@ -84,8 +84,7 @@ bool IsCompliedWithCriterion(float actual_value,
case ComparisonOperator::NOT_EQUAL:
return (actual_value != target_value);
default:
AERROR << "Unsupported comparison operator found:"
<< comparison_operator;
AERROR << "Unsupported comparison operator found:" << comparison_operator;
return false;
}
}
......
......@@ -243,8 +243,8 @@ bool FusionCameraDetectionComponent::Init() {
if (enable_cipv_) {
cipv_.Init(homography_im2car_, min_laneline_length_for_cipv_,
average_lane_width_in_meter_, max_vehicle_width_in_meter_,
average_frame_rate_, image_based_cipv_, debug_level_);
average_lane_width_in_meter_, max_vehicle_width_in_meter_,
average_frame_rate_, image_based_cipv_, debug_level_);
}
if (enable_visualization_) {
......@@ -780,8 +780,8 @@ int FusionCameraDetectionComponent::InternalProc(
// Get Drop points
if (motion_buffer_->size() > 0) {
cipv_.CollectDrops(motion_buffer_, world2camera,
&camera_frame.tracked_objects);
cipv_.CollectDrops(motion_buffer_, world2camera,
&camera_frame.tracked_objects);
} else {
AWARN << "motion_buffer is empty";
}
......@@ -811,8 +811,8 @@ int FusionCameraDetectionComponent::InternalProc(
camera_frame.data_provider->GetImage(image_options, &out_image);
memcpy(output_image.data, out_image.cpu_data(),
out_image.total() * sizeof(uint8_t));
visualize_.ShowResult_all_info_single_camera(output_image, camera_frame,
motion_buffer_, world2camera);
visualize_.ShowResult_all_info_single_camera(
output_image, camera_frame, motion_buffer_, world2camera);
}
}
......
......@@ -906,14 +906,11 @@ void ScenarioManager::UpdatePlanningContextTrafficLightScenario(
}
}
// update: pull_over status in PlanningContext
void ScenarioManager::UpdatePlanningContextPullOverScenario(
const Frame& frame, const ScenarioConfig::ScenarioType& scenario_type) {
if (scenario_type != ScenarioConfig::PULL_OVER) {
PlanningContext::Instance()
->mutable_planning_status()
->clear_pull_over();
PlanningContext::Instance()->mutable_planning_status()->clear_pull_over();
return;
}
}
......
......@@ -73,10 +73,8 @@ PullOverStatus CheckADCPullOver(const ReferenceLineInfo& reference_line_info,
const auto& pull_over_status =
PlanningContext::Instance()->planning_status().pull_over();
if (!pull_over_status.is_feasible() ||
!pull_over_status.has_x() ||
!pull_over_status.has_y() ||
!pull_over_status.has_theta()) {
if (!pull_over_status.is_feasible() || !pull_over_status.has_x() ||
!pull_over_status.has_y() || !pull_over_status.has_theta()) {
ADEBUG << "pull_over status not set properly: "
<< pull_over_status.DebugString();
return UNKNOWN;
......
......@@ -643,8 +643,7 @@ bool OpenSpaceRoiDecider::GetPullOverSpot(
hdmap::Path *nearby_path) {
const auto &pull_over_status =
PlanningContext::Instance()->planning_status().pull_over();
if (!pull_over_status.has_x() ||
!pull_over_status.has_y() ||
if (!pull_over_status.has_x() || !pull_over_status.has_y() ||
!pull_over_status.has_theta()) {
AERROR << "Pull over position not set in planning context";
return false;
......
......@@ -175,8 +175,8 @@ Status PathBoundsDecider::Process(
RemoveRedundantPathBoundaries(&candidate_path_boundaries);
auto* pull_over_status = PlanningContext::Instance()
->mutable_planning_status()
->mutable_pull_over();
->mutable_planning_status()
->mutable_pull_over();
// If needed, search for pull-over position.
if (config_.path_bounds_decider_config().is_pull_over()) {
if (!exist_self_path_bound) {
......@@ -366,9 +366,8 @@ bool PathBoundsDecider::SearchPullOverPosition(
// Check if destination is some distance away from ADC.
ADEBUG << "Destination is at s = " << destination_s
<< ", ADC is at s = " << adc_end_s;
if (destination_s - adc_end_s <
config_.path_bounds_decider_config()
.pull_over_destination_to_adc_buffer()) {
if (destination_s - adc_end_s < config_.path_bounds_decider_config()
.pull_over_destination_to_adc_buffer()) {
ADEBUG << "ADC is close to the destination.";
const auto& pull_over_status =
PlanningContext::Instance()->planning_status().pull_over();
......@@ -377,10 +376,10 @@ bool PathBoundsDecider::SearchPullOverPosition(
reference_line.XYToSL({pull_over_status.x(), pull_over_status.y()},
&pull_over_sl);
ADEBUG << "pull-over pisition: s[" << pull_over_sl.s()
<< "] l[" << pull_over_sl.l() << "] x[" << pull_over_status.x()
<< "] y[" << pull_over_status.y()
<< "] theta[" << pull_over_status.theta() << "]";
ADEBUG << "pull-over pisition: s[" << pull_over_sl.s() << "] l["
<< pull_over_sl.l() << "] x[" << pull_over_status.x() << "] y["
<< pull_over_status.y() << "] theta[" << pull_over_status.theta()
<< "]";
int pull_over_idx = 0;
for (const auto& path_bound_point : path_bound) {
if (std::get<0>(path_bound_point) < pull_over_sl.s()) {
......@@ -389,11 +388,9 @@ bool PathBoundsDecider::SearchPullOverPosition(
break;
}
}
*pull_over_configuration = std::make_tuple(
pull_over_status.x(),
pull_over_status.y(),
pull_over_status.theta(),
pull_over_idx);
*pull_over_configuration =
std::make_tuple(pull_over_status.x(), pull_over_status.y(),
pull_over_status.theta(), pull_over_idx);
return true;
} else {
ADEBUG << "Destination is too close to ADC. distance["
......@@ -405,7 +402,7 @@ bool PathBoundsDecider::SearchPullOverPosition(
// Check if destination is within path-bounds searching scope.
const double destination_to_pathend_buffer =
config_.path_bounds_decider_config()
.pull_over_destination_to_pathend_buffer();
.pull_over_destination_to_pathend_buffer();
if (destination_s + destination_to_pathend_buffer >=
std::get<0>(path_bound.back())) {
ADEBUG << "Destination is not within path_bounds search scope";
......@@ -500,9 +497,8 @@ bool PathBoundsDecider::SearchPullOverPosition(
reference_line.GetReferencePoint(pull_over_s);
const double pull_over_theta = reference_point.heading();
*pull_over_configuration =
std::make_tuple(pull_over_x, pull_over_y,
pull_over_theta, (i + j) / 2);
*pull_over_configuration = std::make_tuple(pull_over_x, pull_over_y,
pull_over_theta, (i + j) / 2);
break;
}
--i;
......
......@@ -84,8 +84,8 @@ int Destination::MakeDecisions(Frame* frame,
if (FLAGS_enable_scenario_pull_over) {
const auto& pull_over_status =
PlanningContext::Instance()->planning_status().pull_over();
if (pull_over_status.is_feasible() &&
pull_over_status.has_x() && pull_over_status.has_y()) {
if (pull_over_status.is_feasible() && pull_over_status.has_x() &&
pull_over_status.has_y()) {
// build stop decision based on pull-over position
ADEBUG << "BuildStopDecision: pull-over position";
common::SLPoint pull_over_sl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册