Skip to content

Commit

Permalink
use hypot
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristofDubs committed Jan 31, 2023
1 parent faa6476 commit 4d56340
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion global_planner/include/global_planner/planner_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class GlobalPlanner : public mbf_costmap_core::CostmapPlanner {
inline double sq_distance(const geometry_msgs::PoseStamped& p1, const geometry_msgs::PoseStamped& p2){
double dx = p1.pose.position.x - p2.pose.position.x;
double dy = p1.pose.position.y - p2.pose.position.y;
return dx*dx + dy*dy;
return std::hypot(dx, dy);
}
void mapToWorld(double mx, double my, double& wx, double& wy);
bool worldToMap(double wx, double wy, double& mx, double& my);
Expand Down

0 comments on commit 4d56340

Please sign in to comment.