Skip to content

Commit

Permalink
style(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Nov 18, 2024
1 parent f376f1a commit 1dc325c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions perception/autoware_tensorrt_common/src/tensorrt_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ void TrtCommon::printNetworkInfo(const std::string & onnx_file_path)
total_gflops += gflops;
total_params += num_weights;
std::cout << "L" << i << " [conv " << k_dims.d[0] << "x" << k_dims.d[1] << " (" << groups
<< ") " << "/" << s_dims.d[0] << "] " << dim_in.d[3] << "x" << dim_in.d[2] << "x"
<< ") "
<< "/" << s_dims.d[0] << "] " << dim_in.d[3] << "x" << dim_in.d[2] << "x"

Check warning on line 319 in perception/autoware_tensorrt_common/src/tensorrt_common.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

TrtCommon::printNetworkInfo already has high cyclomatic complexity, and now it increases in Lines of Code from 94 to 95. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
<< dim_in.d[1] << " -> " << dim_out.d[3] << "x" << dim_out.d[2] << "x"
<< dim_out.d[1];
std::cout << " weights:" << num_weights;
Expand Down Expand Up @@ -380,7 +381,8 @@ bool TrtCommon::buildEngineFromOnnx(
if (num_available_dla > 0) {
std::cout << "###" << num_available_dla << " DLAs are supported! ###" << std::endl;
} else {
std::cout << "###Warning : " << "No DLA is supported! ###" << std::endl;
std::cout << "###Warning : "
<< "No DLA is supported! ###" << std::endl;

Check warning on line 385 in perception/autoware_tensorrt_common/src/tensorrt_common.cpp

View check run for this annotation

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

TrtCommon::buildEngineFromOnnx already has high cyclomatic complexity, and now it increases in Lines of Code from 172 to 173. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
}
config->setDefaultDeviceType(nvinfer1::DeviceType::kDLA);
config->setDLACore(build_config_->dla_core_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ PlannerPlugin::LaneletRoute DefaultPlanner::plan(const RoutePoints & points)

std::stringstream log_ss;
for (const auto & point : points) {
log_ss << "x: " << point.position.x << " " << "y: " << point.position.y << std::endl;
log_ss << "x: " << point.position.x << " "
<< "y: " << point.position.y << std::endl;
}
RCLCPP_DEBUG_STREAM(
logger, "start planning route with check points: " << std::endl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,9 @@ void Lanelet2MapFilterComponent::pointcloudCallback(const PointCloud2ConstPtr cl
if (!transformPointCloud("map", cloud_msg, input_transformed_cloud_ptr.get())) {
RCLCPP_ERROR_STREAM_THROTTLE(
this->get_logger(), *this->get_clock(), std::chrono::milliseconds(10000).count(),
"Failed transform from " << "map"
<< " to " << cloud_msg->header.frame_id);
"Failed transform from "
<< "map"
<< " to " << cloud_msg->header.frame_id);
return;
}
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
Expand Down

0 comments on commit 1dc325c

Please sign in to comment.