Baselocalplanner is the base class for all local path planners, and all local path planner is its plug- in
Baselocalplanner Interface:
Computevelocitycommands
Isgoalreached
Setplan
Initialize
1. in Dwaplannerros For example:
a) the external first call is the Initialize function, stuffed into the outside to fix Costmap
b) Dwaplannerros is an external package for Dwaplanner, Dwaplanner is the actual DWA algorithm implementation class
c) Costmap will be plugged into the plannerutils, then the util will be passed into the Dwaplanner constructor
d) in actual use, will be a number of judgments, similar to a state machine, the specific method of choice. Mainly in the fast to the point and some special state time without DWA to calculate.
2. DWA Analysis in Ros
a) dwa In fact, the most important thing is the design and selection of various speed scoring functions and their weights.
b) the following scoring functions are used mainly in this DWA:
base_local_planner::oscillationcostfunction oscillation_costs_;
base_local_planner::obstaclecostfunction obstacle_costs_ ;
base_local_planner::mapgridcostfunction path_costs_ ;
base_local_planner::mapgridcostfunction goal_costs_ ;
base_local_planner::mapgridcostfunction goal_front_costs_ ;
base_local_planner::mapgridcostfunction alignment_costs_;
c) all costfunction are inherited from the trajectorycostfunction
d) The main interfaces of the trajectorycostfunction are as follows: all interfaces required for scoring functions, initialization, weight setting, acquisition, scoring calculation
i. Prepare
II. scoretrajectory
III. Setscale
iv. getscale
e) all costfunction are stuffed into a trajectorycostfunction* container , and the order of the plugs must be noted, Because any costfunction return negative score will let the evaluation rate be discarded, so you can use this feature to improve the efficiency of the algorithm
except costfunction is a must , you also need a trajectory generator that uses the base_local_planner::simpletrajectorygenerator , plugged in base_local_planner:: trajectorysamplegenerator* Container
Both costfunction and generator were initialized and stuffed Scored_sampling_planner_ , the variable is base_local_planner::simplescoredsamplingplanner Type, inherited from pure virtual base class Base_local_ Planner::trajectorysearch
f) The interface that is actually intended for external invocation is
Findbestpath (
tf::stamped<tf::P ose> global_pose,
tf::stamped<tf::P ose> global_vel,
tf::stamped<tf::P ose>& drive_velocities,
in this function, the first initializes the generator_ and then calls the Scored_sampling_planner_ of the findbesttrajectory interface. The first parameter of the findbesttrajectory is the track result, and the second parameter is the traversal of all traces. In the findbesttrajectory function, the generator generation trajectory is performed first, and then the costfunction is used to score.
g) So the immediate question arises as to how generator generates the trajectory and how the costfuntion is scored.
h) Dwa in generator as mentioned earlier, only one, is simpletrajectorygenerator, the class will perform all trajectory calculations, the trajectory will save the trajectory point, speed, Ratings and other factors, the final issued speed instructions are also selected here to determine
Analysis of ROS Local planning module