37 #ifndef TRAJECTORY_ROLLOUT_WORLD_MODEL_H_ 38 #define TRAJECTORY_ROLLOUT_WORLD_MODEL_H_ 43 #include <geometry_msgs/Point.h> 62 virtual double footprintCost(
const geometry_msgs::Point& position,
const std::vector<geometry_msgs::Point>& footprint,
63 double inscribed_radius,
double circumscribed_radius) = 0;
65 double footprintCost(
double x,
double y,
double theta,
const std::vector<geometry_msgs::Point>& footprint_spec,
double inscribed_radius = 0.0,
double circumscribed_radius=0.0){
67 double cos_th = cos(theta);
68 double sin_th = sin(theta);
69 std::vector<geometry_msgs::Point> oriented_footprint;
70 for(
unsigned int i = 0; i < footprint_spec.size(); ++i){
71 geometry_msgs::Point new_pt;
72 new_pt.x = x + (footprint_spec[i].x * cos_th - footprint_spec[i].y * sin_th);
73 new_pt.y = y + (footprint_spec[i].x * sin_th + footprint_spec[i].y * cos_th);
74 oriented_footprint.push_back(new_pt);
77 geometry_msgs::Point robot_position;
81 if(inscribed_radius==0.0){
85 return footprintCost(robot_position, oriented_footprint, inscribed_radius, circumscribed_radius);
96 double footprintCost(
const geometry_msgs::Point& position,
const std::vector<geometry_msgs::Point>& footprint,
97 double inscribed_radius,
double circumscribed_radius,
double extra) {
98 return footprintCost(position, footprint, inscribed_radius, circumscribed_radius);
virtual double footprintCost(const geometry_msgs::Point &position, const std::vector< geometry_msgs::Point > &footprint, double inscribed_radius, double circumscribed_radius)=0
Subclass will implement this method to check a footprint at a given position and orientation for lega...
double footprintCost(double x, double y, double theta, const std::vector< geometry_msgs::Point > &footprint_spec, double inscribed_radius=0.0, double circumscribed_radius=0.0)
double footprintCost(const geometry_msgs::Point &position, const std::vector< geometry_msgs::Point > &footprint, double inscribed_radius, double circumscribed_radius, double extra)
Checks if any obstacles in the costmap lie inside a convex footprint that is rasterized into the grid...
An interface the trajectory controller uses to interact with the world regardless of the underlying w...
virtual ~WorldModel()
Subclass will implement a destructor.
void calculateMinAndMaxDistances(const std::vector< geometry_msgs::Point > &footprint, double &min_dist, double &max_dist)