# OMPL Plannification: /home/blue/GitLab Repo/OMPL_Planning/Source Files/mapping_planning_tutorial/control_turtlebot/src/OMPL_Planning/ROS_Implementation/ROS_OMPL_Planner.hpp Source File

ROS_OMPL_Planner.hpp
#include <ros/ros.h>
#include <visualization_msgs/Marker.h>
#include <nav_msgs/Odometry.h>
#include <std_msgs/Bool.h>
#include <geometry_msgs/PoseArray.h>
#include <ros/package.h>
#include <std_srvs/Empty.h>
#include <tf/message_filter.h>
#include <tf/transform_listener.h>
#include <control_turtlebot/FindPathToGoal.h>
#include <geometry_msgs/Pose2D.h>
#include <geometry_msgs/Pose.h>
#include <octomap_msgs/conversions.h>
#include <octomap_msgs/GetOctomap.h>
//ROS-Octomap interface
using octomap_msgs::GetOctomap;
#include "../OMPL_Planner/OMPL_Planner.hpp"
class ROS_OMPL_Planner
{
public:
ROS_OMPL_Planner(int dimension);
bool updateMap();
void odomCallback(const nav_msgs::OdometryPtr &odom_msg);
bool findPathToGoal(control_turtlebot::FindPathToGoal::Request& request, control_turtlebot::FindPathToGoal::Response& response);
void visualizeRRT(const og::SimpleSetup simple_setup);
void PublishPath(control_turtlebot::FindPathToGoal::Response& response);
void PublishPath();
bool getObstacleFlag() const;
bool updatePath();
~ROS_OMPL_Planner();
private:
OMPL_Planner planner;
//Octomap
octomap::AbstractOcTree* abs_octree_;
octomap::OcTree* octree_ = nullptr;
// *** ROS ***
ros::NodeHandle _node_hand;
ros::Publisher visual_traj_pub_, path_pub_;
ros::Subscriber odom_sub_;
ros::ServiceServer service_;
// Octomap server
GetOctomap::Request req;
GetOctomap::Response resp;
std::string serv_name = "/octomap_full";
bool _obstacle_flag;
int planningDimension;
double solving_time_,planning_depth_limit;
std::string planner_name_;
std::vector<double> current_position_, goal_state;
std::vector<double> planning_bounds_x_, planning_bounds_y_, planning_bounds_z_;
Checking_Box collision_mask;
};
ROS_OMPL_Planner::visualizeRRT
void visualizeRRT(const og::SimpleSetup simple_setup)
Procedure to visualize the resulting path.
Definition: ROS_OMPL_Planner.cpp:151
ROS_OMPL_Planner
ROS implementation class for OMPL_Planner.
Definition: ROS_OMPL_Planner.hpp:34
Checking_Box
Collision Mask : virtual representation of the drone as a box with x,y,z length.
Definition: StateChecker.hpp:29
ROS_OMPL_Planner::updatePath
bool updatePath()
Update the path.
Definition: ROS_OMPL_Planner.cpp:435
ROS_OMPL_Planner::~ROS_OMPL_Planner
~ROS_OMPL_Planner()
Destructor.
Definition: ROS_OMPL_Planner.cpp:464
ROS_OMPL_Planner::updateMap
bool updateMap()
Request and load the actual map from the Octomap server.
Definition: ROS_OMPL_Planner.cpp:74
ROS_OMPL_Planner::PublishPath
void PublishPath()
Publish the resulting path.
Definition: ROS_OMPL_Planner.cpp:370
ROS_OMPL_Planner::ROS_OMPL_Planner
ROS_OMPL_Planner(int dimension)
Constructor.
Definition: ROS_OMPL_Planner.cpp:10
ROS_OMPL_Planner::getObstacleFlag
bool getObstacleFlag() const
Return the flag representing the validity of the current path.
Definition: ROS_OMPL_Planner.cpp:430
ROS_OMPL_Planner::odomCallback
void odomCallback(const nav_msgs::OdometryPtr &odom_msg)
Callback for getting current vehicle position.
Definition: ROS_OMPL_Planner.cpp:108
OMPL_Planner
Class for planner for 2D and 3D planning.
Definition: OMPL_Planner.hpp:35
ROS_OMPL_Planner::findPathToGoal
bool findPathToGoal(control_turtlebot::FindPathToGoal::Request &request, control_turtlebot::FindPathToGoal::Response &response)
Find a path.
Definition: ROS_OMPL_Planner.cpp:115