collision_checker.cpp
Go to the documentation of this file.
1 
4 /*****************************************************************************
5 ** Includes
6 *****************************************************************************/
7 
8 #include "../../include/yocs_navi_toolkit/collision_checker.hpp"
9 #include <costmap_2d/footprint.h>
10 
11 /*****************************************************************************
12 ** Namespaces
13 *****************************************************************************/
14 
15 namespace yocs_navi_toolkit {
16 
17 /*****************************************************************************
18 ** Implementation
19 *****************************************************************************/
20 
22 : costmap_ros_(costmap_ros)
23 , costmap_model_(*costmap_ros->getCostmap())
24 , footprint_(costmap_ros_->getRobotFootprint())
25 {
26  // don't need to compute the radii, but if we precompute here, it saves
27  // the footprintCost() function from repeatedly computing them internally
29 }
30 
31 bool CollisionChecker::inCollision(const float& x, const float& y, const float& yaw) {
33  // cost >= 0 implies not in collision
34  // cost < 0 implies collision
35  return (cost < 0 );
36 }
37 
38 /*****************************************************************************
39  ** Trailers
40  *****************************************************************************/
41 
42 } // namespace yocs_navi_toolkit
base_local_planner::CostmapModel costmap_model_
CollisionChecker(costmap_2d::Costmap2DROS *costmap_ros)
Initialise the checker with a costmap.
std::vector< geometry_msgs::Point > footprint_
bool inCollision(const float &x, const float &y, const float &yaw)
Check for collision along the boundaries of the footprint.
virtual double footprintCost(const geometry_msgs::Point &position, const std::vector< geometry_msgs::Point > &footprint, double inscribed_radius, double circumscribed_radius)
void calculateMinAndMaxDistances(const std::vector< geometry_msgs::Point > &footprint, double &min_dist, double &max_dist)


yocs_navi_toolkit
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 15:53:55