Skip to content

Commit

Permalink
fix: bugprone-error
Browse files Browse the repository at this point in the history
Signed-off-by: kobayu858 <[email protected]>
  • Loading branch information
kobayu858 committed Dec 17, 2024
1 parent c17b000 commit cdabc67
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void AbstractPlanningAlgorithm::setMap(const nav_msgs::msg::OccupancyGrid & cost
std::vector<bool> is_obstacle_table;
is_obstacle_table.resize(nb_of_cells);
for (uint32_t i = 0; i < nb_of_cells; ++i) {
const int cost = costmap_.data[i];
const int cost = static_cast<unsigned char>(costmap_.data[i]);
if (cost < 0 || planner_common_param_.obstacle_threshold <= cost) {

Check failure on line 119 in planning/autoware_freespace_planning_algorithms/src/abstract_algorithm.cpp

View workflow job for this annotation

GitHub Actions / cppcheck-differential

Condition 'cost<0' is always false [knownConditionTrueFalse]
is_obstacle_table[i] = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ double AstarSearch::getExpansionDistance(const AstarNode & current_node) const
double AstarSearch::getSteeringCost(const int steering_index) const
{
return planner_common_param_.curve_weight *
(abs(steering_index) / planner_common_param_.turning_steps);
(static_cast<double>(abs(steering_index)) / planner_common_param_.turning_steps);
}

double AstarSearch::getSteeringChangeCost(
Expand Down

0 comments on commit cdabc67

Please sign in to comment.