38 #ifndef NAV2_COSTMAP_2D__FOOTPRINT_HPP_
39 #define NAV2_COSTMAP_2D__FOOTPRINT_HPP_
45 #include "rclcpp/rclcpp.hpp"
46 #include "geometry_msgs/msg/polygon.hpp"
47 #include "geometry_msgs/msg/polygon_stamped.hpp"
48 #include "geometry_msgs/msg/point.hpp"
49 #include "geometry_msgs/msg/point32.hpp"
50 #include "nav2_ros_common/lifecycle_node.hpp"
63 const std::vector<geometry_msgs::msg::Point> & footprint);
68 geometry_msgs::msg::Point
toPoint(
const geometry_msgs::msg::Point32 & pt);
73 geometry_msgs::msg::Point32
toPoint32(
const geometry_msgs::msg::Point & pt);
78 geometry_msgs::msg::Polygon
toPolygon(
const std::vector<geometry_msgs::msg::Point> & pts);
84 const geometry_msgs::msg::Polygon & polygon);
95 double x,
double y,
double theta,
96 const std::vector<geometry_msgs::msg::Point> & footprint_spec,
97 std::vector<geometry_msgs::msg::Point> & oriented_footprint);
108 double x,
double y,
double theta,
109 const std::vector<geometry_msgs::msg::Point> & footprint_spec,
110 geometry_msgs::msg::PolygonStamped & oriented_footprint);
115 void padFootprint(std::vector<geometry_msgs::msg::Point> & footprint,
double padding);
129 const std::string & footprint_string,
130 std::vector<geometry_msgs::msg::Point> & footprint);
geometry_msgs::msg::Polygon toPolygon(const std::vector< geometry_msgs::msg::Point > &pts)
Convert vector of Points to Polygon msg.
geometry_msgs::msg::Point toPoint(const geometry_msgs::msg::Point32 &pt)
Convert Point32 to Point.
void transformFootprint(double x, double y, double theta, const std::vector< geometry_msgs::msg::Point > &footprint_spec, std::vector< geometry_msgs::msg::Point > &oriented_footprint)
Given a pose and base footprint, build the oriented footprint of the robot (list of Points)
bool makeFootprintFromString(const std::string &footprint_string, std::vector< geometry_msgs::msg::Point > &footprint)
Make the footprint from the given string.
std::pair< double, double > calculateMinAndMaxDistances(const std::vector< geometry_msgs::msg::Point > &footprint)
Calculate the extreme distances for the footprint.
void padFootprint(std::vector< geometry_msgs::msg::Point > &footprint, double padding)
Adds the specified amount of padding to the footprint (in place)
geometry_msgs::msg::Point32 toPoint32(const geometry_msgs::msg::Point &pt)
Convert Point to Point32.
std::vector< geometry_msgs::msg::Point > makeFootprintFromRadius(double radius)
Create a circular footprint from a given radius.
std::vector< geometry_msgs::msg::Point > toPointVector(const geometry_msgs::msg::Polygon &polygon)
Convert Polygon msg to vector of Points.