dwa_planner.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * Software License Agreement (BSD License)
4 *
5 * Copyright (c) 2009, Willow Garage, Inc.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * * Redistributions in binary form must reproduce the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer in the documentation and/or other materials provided
17 * with the distribution.
18 * * Neither the name of Willow Garage, Inc. nor the names of its
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 *
35 * Author: Eitan Marder-Eppstein
36 *********************************************************************/
37 #ifndef DWA_LOCAL_PLANNER_DWA_PLANNER_H_
38 #define DWA_LOCAL_PLANNER_DWA_PLANNER_H_
39 
40 #include <vector>
41 #include <Eigen/Core>
42 
43 
44 #include <dwa_local_planner/DWAPlannerConfig.h>
45 
46 //for creating a local cost grid
48 #include <pcl_ros/publisher.h>
49 
50 //for obstacle data access
51 #include <costmap_2d/costmap_2d.h>
52 
57 
63 
64 #include <nav_msgs/Path.h>
65 
66 namespace dwa_local_planner {
71  class DWAPlanner {
72  public:
79  DWAPlanner(std::string name, base_local_planner::LocalPlannerUtil *planner_util);
80 
85 
89  void reconfigure(DWAPlannerConfig &cfg);
90 
98  bool checkTrajectory(
99  const Eigen::Vector3f pos,
100  const Eigen::Vector3f vel,
101  const Eigen::Vector3f vel_samples);
102 
111  tf::Stamped<tf::Pose> global_pose,
112  tf::Stamped<tf::Pose> global_vel,
113  tf::Stamped<tf::Pose>& drive_velocities);
114 
127  const std::vector<geometry_msgs::PoseStamped>& new_plan,
128  const std::vector<geometry_msgs::Point>& footprint_spec);
129 
134  double getSimPeriod() { return sim_period_; }
135 
146  bool getCellCosts(int cx, int cy, float &path_cost, float &goal_cost, float &occ_cost, float &total_cost);
147 
151  bool setPlan(const std::vector<geometry_msgs::PoseStamped>& orig_global_plan);
152 
153  private:
154 
156 
159  Eigen::Vector3f vsamples_;
160 
161  double sim_period_;
163 
165 
166  std::vector<geometry_msgs::PoseStamped> global_plan_;
167 
168  boost::mutex configuration_mutex_;
169  pcl::PointCloud<base_local_planner::MapGridCostPoint>* traj_cloud_;
173 
175 
177 
178  // see constructor body for explanations
187 
189  };
190 };
191 #endif
void reconfigure(DWAPlannerConfig &cfg)
Reconfigures the trajectory planner.
Definition: dwa_planner.cpp:52
pcl_ros::Publisher< base_local_planner::MapGridCostPoint > traj_cloud_pub_
Definition: dwa_planner.h:170
bool setPlan(const std::vector< geometry_msgs::PoseStamped > &orig_global_plan)
base_local_planner::MapGridCostFunction goal_front_costs_
Definition: dwa_planner.h:184
base_local_planner::MapGridCostFunction goal_costs_
Definition: dwa_planner.h:183
double sim_period_
The number of seconds to use to compute max/min vels for dwa.
Definition: dwa_planner.h:161
base_local_planner::OscillationCostFunction oscillation_costs_
Definition: dwa_planner.h:180
base_local_planner::LocalPlannerUtil * planner_util_
Definition: dwa_planner.h:155
bool publish_cost_grid_pc_
Whether or not to build and publish a PointCloud.
Definition: dwa_planner.h:171
bool getCellCosts(int cx, int cy, float &path_cost, float &goal_cost, float &occ_cost, float &total_cost)
Compute the components and total cost for a map grid cell.
base_local_planner::TwirlingCostFunction twirling_costs_
Definition: dwa_planner.h:186
double getSimPeriod()
Get the period at which the local planner is expected to run.
Definition: dwa_planner.h:134
std::vector< geometry_msgs::PoseStamped > global_plan_
Definition: dwa_planner.h:166
pcl::PointCloud< base_local_planner::MapGridCostPoint > * traj_cloud_
Definition: dwa_planner.h:169
base_local_planner::MapGridCostFunction alignment_costs_
Definition: dwa_planner.h:185
DWAPlanner(std::string name, base_local_planner::LocalPlannerUtil *planner_util)
Constructor for the planner.
base_local_planner::SimpleScoredSamplingPlanner scored_sampling_planner_
Definition: dwa_planner.h:188
A class implementing a local planner using the Dynamic Window Approach.
Definition: dwa_planner.h:71
base_local_planner::ObstacleCostFunction obstacle_costs_
Definition: dwa_planner.h:181
base_local_planner::MapGridVisualizer map_viz_
The map grid visualizer for outputting the potential field generated by the cost function.
Definition: dwa_planner.h:176
base_local_planner::MapGridCostFunction path_costs_
Definition: dwa_planner.h:182
void updatePlanAndLocalCosts(tf::Stamped< tf::Pose > global_pose, const std::vector< geometry_msgs::PoseStamped > &new_plan, const std::vector< geometry_msgs::Point > &footprint_spec)
Update the cost functions before planning.
base_local_planner::Trajectory findBestPath(tf::Stamped< tf::Pose > global_pose, tf::Stamped< tf::Pose > global_vel, tf::Stamped< tf::Pose > &drive_velocities)
Given the current position and velocity of the robot, find the best trajectory to exectue...
base_local_planner::Trajectory result_traj_
Definition: dwa_planner.h:162
base_local_planner::SimpleTrajectoryGenerator generator_
Definition: dwa_planner.h:179
~DWAPlanner()
Destructor for the planner.
Definition: dwa_planner.h:84
double stop_time_buffer_
How long before hitting something we&#39;re going to enforce that the robot stop.
Definition: dwa_planner.h:157
bool checkTrajectory(const Eigen::Vector3f pos, const Eigen::Vector3f vel, const Eigen::Vector3f vel_samples)
Check if a trajectory is legal for a position/velocity pair.


dwa_local_planner
Author(s): Eitan Marder-Eppstein, contradict@gmail.com
autogenerated on Thu Jan 21 2021 04:05:59