dlux_global_planner.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2018, Locus Robotics
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef DLUX_GLOBAL_PLANNER_DLUX_GLOBAL_PLANNER_H
36 #define DLUX_GLOBAL_PLANNER_DLUX_GLOBAL_PLANNER_H
37 
39 #include <nav_core2/costmap.h>
43 #include <nav_2d_msgs/Pose2DStamped.h>
45 #include <pluginlib/class_loader.h>
46 #include <ros/ros.h>
47 #include <string>
48 
49 namespace dlux_global_planner
50 {
56 {
57 public:
59 
60  // Standard GlobalPlanner Interface
61  void initialize(const ros::NodeHandle& parent, const std::string& name,
62  TFListenerPtr tf, nav_core2::Costmap::Ptr costmap) override;
63  nav_2d_msgs::Path2D makePlan(const nav_2d_msgs::Pose2DStamped& start,
64  const nav_2d_msgs::Pose2DStamped& goal) override;
65 
71  virtual bool isPlanValid(const nav_2d_msgs::Path2D& path) const;
72 
73 protected:
74  // Path Caching Methods
75 
89  virtual bool hasValidCachedPath(const geometry_msgs::Pose2D& local_goal,
90  unsigned int goal_x, unsigned int goal_y);
91 
96  virtual bool shouldReturnCachedPathImmediately() const;
97 
104  virtual bool shouldReturnNewPath(const nav_2d_msgs::Path2D& new_path, const double new_path_cost) const;
105 
106  // Plugins
111 
112  // Key members
117 
118  // Path Caching
121  nav_2d_msgs::Path2D cached_path_;
124 
125  // potential publishing
127 
128  // debug printing
130 };
131 } // namespace dlux_global_planner
132 
133 #endif // DLUX_GLOBAL_PLANNER_DLUX_GLOBAL_PLANNER_H
dlux_global_planner::DluxGlobalPlanner::traceback_loader_
pluginlib::ClassLoader< Traceback > traceback_loader_
Definition: dlux_global_planner.h:109
dlux_global_planner::DluxGlobalPlanner
Plugin-based global wavefront planner that conforms to the nav_core2 GlobalPlanner interface.
Definition: dlux_global_planner.h:55
dlux_global_planner::DluxGlobalPlanner::isPlanValid
virtual bool isPlanValid(const nav_2d_msgs::Path2D &path) const
Check the costmap for any obstacles on this path.
Definition: dlux_global_planner.cpp:87
dlux_global_planner::DluxGlobalPlanner::print_statistics_
bool print_statistics_
Definition: dlux_global_planner.h:129
class_loader.h
boost::shared_ptr
dlux_global_planner::DluxGlobalPlanner::DluxGlobalPlanner
DluxGlobalPlanner()
Definition: dlux_global_planner.cpp:46
dlux_global_planner::CostInterpreter::Ptr
std::shared_ptr< CostInterpreter > Ptr
Definition: cost_interpreter.h:89
ros.h
dlux_global_planner::DluxGlobalPlanner::improvement_threshold_
double improvement_threshold_
Definition: dlux_global_planner.h:120
dlux_global_planner::DluxGlobalPlanner::traceback_
boost::shared_ptr< Traceback > traceback_
Definition: dlux_global_planner.h:110
dlux_global_planner::DluxGlobalPlanner::calc_loader_
pluginlib::ClassLoader< PotentialCalculator > calc_loader_
Definition: dlux_global_planner.h:107
dlux_global_planner::DluxGlobalPlanner::tf_
TFListenerPtr tf_
Definition: dlux_global_planner.h:114
dlux_global_planner::DluxGlobalPlanner::cost_interpreter_
CostInterpreter::Ptr cost_interpreter_
Definition: dlux_global_planner.h:116
dlux_global_planner::DluxGlobalPlanner::shouldReturnCachedPathImmediately
virtual bool shouldReturnCachedPathImmediately() const
Whether the planner should always return a valid cached path without running the planning algorithm.
Definition: dlux_global_planner.cpp:181
dlux_global_planner::DluxGlobalPlanner::potential_grid_
PotentialGrid potential_grid_
Definition: dlux_global_planner.h:115
dlux_global_planner::DluxGlobalPlanner::hasValidCachedPath
virtual bool hasValidCachedPath(const geometry_msgs::Pose2D &local_goal, unsigned int goal_x, unsigned int goal_y)
Check whether there is a valid cached path where the goal hasn't changed.
Definition: dlux_global_planner.cpp:171
dlux_global_planner::DluxGlobalPlanner::calculator_
boost::shared_ptr< PotentialCalculator > calculator_
Definition: dlux_global_planner.h:108
nav_core2::GlobalPlanner
nav_grid_pub_sub::ScaleGridPublisher< float >
dlux_global_planner::DluxGlobalPlanner::potential_pub_
nav_grid_pub_sub::ScaleGridPublisher< float > potential_pub_
Definition: dlux_global_planner.h:126
costmap.h
nav_grid_publisher.h
dlux_global_planner::DluxGlobalPlanner::shouldReturnNewPath
virtual bool shouldReturnNewPath(const nav_2d_msgs::Path2D &new_path, const double new_path_cost) const
Given a cached path is available and a new path, should the new path be the one returned?
Definition: dlux_global_planner.cpp:187
dlux_global_planner::DluxGlobalPlanner::cached_goal_y_
unsigned int cached_goal_y_
Definition: dlux_global_planner.h:122
pluginlib::ClassLoader
dlux_global_planner::DluxGlobalPlanner::cached_path_cost_
double cached_path_cost_
Definition: dlux_global_planner.h:123
dlux_global_planner
Definition: cost_interpreter.h:42
start
ROSCPP_DECL void start()
nav_core2::Costmap::Ptr
std::shared_ptr< Costmap > Ptr
TFListenerPtr
std::shared_ptr< tf2_ros::Buffer > TFListenerPtr
cost_interpreter.h
dlux_global_planner::DluxGlobalPlanner::costmap_
nav_core2::Costmap::Ptr costmap_
Definition: dlux_global_planner.h:113
tf
dlux_global_planner::DluxGlobalPlanner::cached_path_
nav_2d_msgs::Path2D cached_path_
Definition: dlux_global_planner.h:121
dlux_global_planner::DluxGlobalPlanner::path_caching_
bool path_caching_
Definition: dlux_global_planner.h:119
dlux_global_planner::DluxGlobalPlanner::initialize
void initialize(const ros::NodeHandle &parent, const std::string &name, TFListenerPtr tf, nav_core2::Costmap::Ptr costmap) override
Definition: dlux_global_planner.cpp:53
dlux_global_planner::DluxGlobalPlanner::cached_goal_x_
unsigned int cached_goal_x_
Definition: dlux_global_planner.h:122
global_planner.h
potential_calculator.h
dlux_global_planner::DluxGlobalPlanner::makePlan
nav_2d_msgs::Path2D makePlan(const nav_2d_msgs::Pose2DStamped &start, const nav_2d_msgs::Pose2DStamped &goal) override
Definition: dlux_global_planner.cpp:103
nav_grid::VectorNavGrid< float >
ros::NodeHandle
traceback.h


dlux_global_planner
Author(s):
autogenerated on Sun May 18 2025 02:47:43