cb_base_navigation
a_star_planner_gpp.h
Go to the documentation of this file.
1 /*******************************
2  * *
3  * Author: Rein Appeldoorn *
4  * Date: 2013-03-06 *
5  * *
6  *******************************/
7 
8 #ifndef cb_global_planner_ASTARPLANNER_GPP_H_
9 #define cb_global_planner_ASTARPLANNER_GPP_H_
10 
11 #include "a_star_planner.h"
14 
16 
17 #include <geometry_msgs/PoseStamped.h>
18 #include <geometry_msgs/Point.h>
19 
20 #include <ros/service_client.h>
21 
22 #include <tf2/transform_datatypes.h>
23 
24 #include <std_msgs/ColorRGBA.h>
25 
26 #include <visualization_msgs/Marker.h>
27 
28 #include <memory>
29 
30 namespace cb_global_planner {
31 
36 class AStarPlannerGPP : public GlobalPlannerPlugin
37 {
38 
39 public:
44 
46 
53  void initialize(std::string name, tf2_ros::Buffer* tf, costmap_2d::Costmap2DROS* global_costmap_ros);
54 
62  bool makePlan(const geometry_msgs::PoseStamped& start, const cb_base_navigation_msgs::PositionConstraint& pc,
64 
71 
72 private:
73 
76  tf2_ros::Buffer* tf_;
77  bool initialized_;
78 
79  bool constraintChanged(const cb_base_navigation_msgs::PositionConstraint& pc) { return (pc_.constraint != pc.constraint || pc_.frame != pc.frame); }
80 
81  bool updateConstraintPositionsInConstraintFrame(const cb_base_navigation_msgs::PositionConstraint& pc);
82  bool evaluateConstraint(const tf2::Vector3& p);
85 
86  cb_base_navigation_msgs::PositionConstraint pc_;
88 
90  ros::ServiceClient ed_client_;
91 
92  bool queryEntityPose(const std::string& id, tf2::Transform& pose);
93 
94 };
95 
96 #endif
97 
98 }
cb_global_planner::AStarPlannerGPP::ed_client_
ros::ServiceClient ed_client_
World model client.
Definition: a_star_planner_gpp.h:95
std::string
cb_global_planner::AStarPlannerGPP::tf_
tf2_ros::Buffer * tf_
Definition: a_star_planner_gpp.h:81
std::vector< geometry_msgs::PoseStamped >
cb_global_planner::AStarPlannerGPP::AStarPlannerGPP
AStarPlannerGPP()
Constructor for the AStarPlannerGPP object.
Definition: a_star_planner_gpp.cpp:53
a_star_planner.h
cb_global_planner::AStarPlannerGPP::checkPlan
bool checkPlan(const std::vector< geometry_msgs::PoseStamped > &plan)
Check if plan is valid.
Definition: a_star_planner_gpp.cpp:311
cb_global_planner::AStarPlannerGPP::~AStarPlannerGPP
~AStarPlannerGPP()
Definition: a_star_planner_gpp.cpp:73
costmap_2d_ros.h
cb_global_planner::AStarPlannerGPP::constraintChanged
bool constraintChanged(const cb_base_navigation_msgs::PositionConstraint &pc)
Definition: a_star_planner_gpp.h:84
global_planner_plugin.h
cb_global_planner::AStarPlannerGPP::evaluateConstraint
bool evaluateConstraint(const tf2::Vector3 &p)
cb_global_planner::AStarPlannerGPP::global_costmap_ros_
costmap_2d::Costmap2DROS * global_costmap_ros_
Definition: a_star_planner_gpp.h:79
cb_global_planner::AStarPlannerGPP::goal_positions_in_constraint_frame_
std::vector< tf2::Vector3 > goal_positions_in_constraint_frame_
Definition: a_star_planner_gpp.h:92
cb_global_planner::AStarPlannerGPP::updateConstraintPositionsInConstraintFrame
bool updateConstraintPositionsInConstraintFrame(const cb_base_navigation_msgs::PositionConstraint &pc)
Definition: a_star_planner_gpp.cpp:194
cb_global_planner::AStarPlannerGPP::initialized_
bool initialized_
Definition: a_star_planner_gpp.h:82
cb_global_planner::AStarPlannerGPP::pc_
cb_base_navigation_msgs::PositionConstraint pc_
Definition: a_star_planner_gpp.h:91
cb_global_planner::AStarPlannerGPP::makePlan
bool makePlan(const geometry_msgs::PoseStamped &start, const cb_base_navigation_msgs::PositionConstraint &pc, std::vector< geometry_msgs::PoseStamped > &plan, std::vector< tf2::Vector3 > &goal_positions)
Given a set of goal constraints, compute a plan.
Definition: a_star_planner_gpp.cpp:77
memory
cb_global_planner::AStarPlannerGPP::planToWorld
void planToWorld(const std::vector< int > &plan_xs, const std::vector< int > &plan_ys, std::vector< geometry_msgs::PoseStamped > &plan)
Definition: a_star_planner_gpp.cpp:278
cb_global_planner::AStarPlannerGPP::initialize
void initialize(std::string name, tf2_ros::Buffer *tf, costmap_2d::Costmap2DROS *global_costmap_ros)
Initialization function for the AStarPlannerGPP object.
Definition: a_star_planner_gpp.cpp:57
cb_global_planner::AStarPlannerGPP::queryEntityPose
bool queryEntityPose(const std::string &id, tf2::Transform &pose)
Definition: a_star_planner_gpp.cpp:20
cb_global_planner::AStarPlannerGPP::calculateMapConstraintArea
bool calculateMapConstraintArea(std::vector< unsigned int > &mx, std::vector< unsigned int > &my, std::vector< tf2::Vector3 > &goal_positions)
Definition: a_star_planner_gpp.cpp:240
cb_global_planner
Definition: a_star_planner.cpp:5
std::unique_ptr
cb_global_planner::AStarPlannerGPP::planner_
std::unique_ptr< AStarPlanner > planner_
Definition: a_star_planner_gpp.h:80
costmap_2d::Costmap2DROS
constraint_evaluator.h