Hybrid A* Planner
 All Classes Namespaces Files Functions Variables Friends Pages
planner.h
1 #ifndef PLANNER_H
2 #define PLANNER_H
3 
4 #include <iostream>
5 #include <ctime>
6 
7 #include <ros/ros.h>
8 #include <tf/transform_datatypes.h>
9 #include <tf/transform_listener.h>
10 #include <nav_msgs/OccupancyGrid.h>
11 #include <geometry_msgs/PoseWithCovarianceStamped.h>
12 
13 #include "constants.h"
14 #include "helper.h"
15 #include "collisiondetection.h"
16 #include "dynamicvoronoi.h"
17 #include "algorithm.h"
18 #include "node3d.h"
19 #include "path.h"
20 #include "smoother.h"
21 #include "visualize.h"
22 #include "lookup.h"
23 
24 namespace HybridAStar {
28 class Planner {
29  public:
31  Planner();
32 
37  void initializeLookups();
38 
43  void setMap(const nav_msgs::OccupancyGrid::Ptr map);
44 
49  void setStart(const geometry_msgs::PoseWithCovarianceStamped::ConstPtr& start);
50 
55  void setGoal(const geometry_msgs::PoseStamped::ConstPtr& goal);
56 
60  void plan();
61 
62  private:
64  ros::NodeHandle n;
66  ros::Publisher pubStart;
68  ros::Subscriber subMap;
70  ros::Subscriber subGoal;
72  ros::Subscriber subStart;
74  tf::TransformListener listener;
76  tf::StampedTransform transform;
90  nav_msgs::OccupancyGrid::Ptr grid;
92  geometry_msgs::PoseWithCovarianceStamped start;
94  geometry_msgs::PoseStamped goal;
96  bool validStart = false;
98  bool validGoal = false;
100  Constants::config collisionLookup[Constants::headings * Constants::positions];
102  float* dubinsLookup = new float [Constants::headings * Constants::headings * Constants::dubinsWidth * Constants::dubinsWidth];
103 };
104 }
105 #endif // PLANNER_H
Visualize visualization
The visualization used for search visualization.
Definition: planner.h:84
A class that creates the interface for the hybrid A* algorithm.
Definition: planner.h:28
Planner()
The default constructor.
Definition: planner.cpp:7
This is a collection of constants that are used throughout the project.
void setGoal(const geometry_msgs::PoseStamped::ConstPtr &goal)
setGoal
Definition: planner.cpp:129
The CollisionDetection class determines whether a given configuration q of the robot will result in a...
Definition: collisiondetection.h:31
Constants::config collisionLookup[Constants::headings *Constants::positions]
A lookup table for configurations of the vehicle and their spatial occupancy enumeration.
Definition: planner.h:100
nav_msgs::OccupancyGrid::Ptr grid
A pointer to the grid the planner runs on.
Definition: planner.h:90
void setStart(const geometry_msgs::PoseWithCovarianceStamped::ConstPtr &start)
setStart
Definition: planner.cpp:100
This class takes a path object and smoothes the nodes of the path.
Definition: smoother.h:18
ros::Subscriber subGoal
A subscriber for receiving goal updates.
Definition: planner.h:70
tf::TransformListener listener
A listener that awaits transforms.
Definition: planner.h:74
Path smoothedPath
The path smoothed and ready for the controller.
Definition: planner.h:82
float * dubinsLookup
A lookup of analytical solutions (Dubin's paths)
Definition: planner.h:102
Path path
The path produced by the hybrid A* algorithm.
Definition: planner.h:78
bool validStart
Flags for allowing the planner to plan.
Definition: planner.h:96
tf::StampedTransform transform
A transform for moving start positions.
Definition: planner.h:76
ros::Subscriber subStart
A subscriber for receiving start updates.
Definition: planner.h:72
A structure capturing the lookup for each theta configuration.
Definition: constants.h:132
Smoother smoother
The smoother used for optimizing the path.
Definition: planner.h:80
ros::NodeHandle n
The node handle.
Definition: planner.h:64
geometry_msgs::PoseStamped goal
The goal pose set through RViz.
Definition: planner.h:94
void initializeLookups()
Initializes the collision as well as heuristic lookup table.
Definition: planner.cpp:34
ros::Subscriber subMap
A subscriber for receiving map updates.
Definition: planner.h:68
void setMap(const nav_msgs::OccupancyGrid::Ptr map)
Sets the map e.g. through a callback from a subscriber listening to map updates.
Definition: planner.cpp:45
A class for visualizing the hybrid A* search.
Definition: visualize.h:23
bool validGoal
Flags for allowing the planner to plan.
Definition: planner.h:98
DynamicVoronoi voronoiDiagram
The voronoi diagram.
Definition: planner.h:88
A DynamicVoronoi object computes and updates a distance map and Voronoi diagram.
Definition: dynamicvoronoi.h:14
A class for tracing and visualizing the path generated by the Planner.
Definition: path.h:22
CollisionDetection configurationSpace
The collission detection for testing specific configurations.
Definition: planner.h:86
geometry_msgs::PoseWithCovarianceStamped start
The start pose set through RViz.
Definition: planner.h:92
ros::Publisher pubStart
A publisher publishing the start position for RViz.
Definition: planner.h:66
void plan()
The central function entry point making the necessary preparations to start the planning.
Definition: planner.cpp:151
This is a collection of helper functions that are used throughout the project.