teb_config.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2016,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the institute nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * Author: Christoph Rösmann
37  *********************************************************************/
38 
39 #ifndef TEB_CONFIG_H_
40 #define TEB_CONFIG_H_
41 
42 #include <ros/console.h>
43 #include <ros/ros.h>
44 #include <Eigen/Core>
45 #include <Eigen/StdVector>
46 
47 #include <teb_local_planner/TebLocalPlannerReconfigureConfig.h>
48 
49 
50 // Definitions
51 #define USE_ANALYTIC_JACOBI // if available for a specific edge, use analytic jacobi
52 
53 
54 namespace teb_local_planner
55 {
56 
61 class TebConfig
62 {
63 public:
64 
65  std::string odom_topic;
66  std::string map_frame;
67 
69  struct Trajectory
70  {
71  double teb_autosize;
72  double dt_ref;
73  double dt_hysteresis;
90  } trajectory;
91 
93  struct Robot
94  {
95  double max_vel_x;
97  double max_vel_y;
98  double max_vel_trans;
99  double max_vel_theta;
100  double acc_lim_x;
101  double acc_lim_y;
102  double acc_lim_theta;
104  double wheelbase;
106  bool is_footprint_dynamic; //<! If true, updated the footprint before checking trajectory feasibility
107  bool use_proportional_saturation; //<! If true, reduce all twists components (linear x and y, and angular z) proportionally if any exceed its corresponding bounds, instead of saturating each one individually
108  double transform_tolerance = 0.5; //<! Tolerance when querying the TF Tree for a transformation (seconds)
109  } robot;
110 
113  {
119  bool complete_global_plan; // true prevents the robot from ending the path early when it cross the end goal
120  } goal_tolerance;
121 
123  struct Obstacles
124  {
126  double inflation_dist;
141  } obstacles;
142 
143 
146  {
149 
152 
154 
173 
176  } optim;
177 
178 
180  {
193 
199 
202 
204 
211  } hcp;
212 
214  struct Recovery
215  {
225  } recovery;
226 
227 
242  {
243 
244  odom_topic = "odom";
245  map_frame = "odom";
246 
247  // Trajectory
248 
249  trajectory.teb_autosize = true;
250  trajectory.dt_ref = 0.3;
253  trajectory.max_samples = 500;
268 
269  // Robot
270 
271  robot.max_vel_x = 0.4;
273  robot.max_vel_y = 0.0;
274  robot.max_vel_trans = 0.0;
275  robot.max_vel_theta = 0.3;
276  robot.acc_lim_x = 0.5;
277  robot.acc_lim_y = 0.5;
278  robot.acc_lim_theta = 0.5;
280  robot.wheelbase = 1.0;
282  robot.is_footprint_dynamic = false;
284 
285  // GoalTolerance
286 
293 
294  // Obstacles
295 
312 
313  // Optimization
314 
318  optim.optimization_verbose = false;
319  optim.penalty_epsilon = 0.1;
320  optim.weight_max_vel_x = 2; //1
331  optim.weight_obstacle = 50;
332  optim.weight_inflation = 0.1;
338 
341 
342  // Homotopy Class Planner
343 
345  hcp.enable_multithreading = true;
346  hcp.simple_exploration = false;
354 
358  hcp.roadmap_graph_area_width = 6; // [m]
363 
365 
366  hcp.visualize_hc_graph = false;
369  hcp.detours_orientation_tolerance = M_PI / 2.0;
372 
373  // Recovery
374 
382 
383 
384  }
385 
391 
400  void reconfigure(TebLocalPlannerReconfigureConfig& cfg);
401 
408  void checkParameters() const;
409 
414  void checkDeprecated(const ros::NodeHandle& nh) const;
415 
419  boost::mutex& configMutex() {return config_mutex_;}
420 
421 private:
422  boost::mutex config_mutex_;
423 
424 };
425 
426 
427 } // namespace teb_local_planner
428 
429 #endif
boost::mutex config_mutex_
Mutex for config accesses and changes.
Definition: teb_config.h:422
bool include_costmap_obstacles
Specify whether the obstacles in the costmap should be taken into account directly.
Definition: teb_config.h:129
bool cmd_angle_instead_rotvel
Substitute the rotational velocity in the commanded velocity message by the corresponding steering an...
Definition: teb_config.h:105
double obstacle_proximity_lower_bound
Distance to a static obstacle for which the velocity should be lower.
Definition: teb_config.h:139
std::string map_frame
Global planning frame.
Definition: teb_config.h:66
double max_vel_y
Maximum strafing velocity of the robot (should be zero for non-holonomic robots!) ...
Definition: teb_config.h:97
double weight_velocity_obstacle_ratio
Optimization weight for satisfying a maximum allowed velocity with respect to the distance to a stati...
Definition: teb_config.h:170
int max_samples
Maximum number of samples; Warning: if too small the discretization/resolution might not be sufficien...
Definition: teb_config.h:75
double weight_adapt_factor
Some special weights (currently &#39;weight_obstacle&#39;) are repeatedly scaled by this factor in each outer...
Definition: teb_config.h:174
bool allow_init_with_backwards_motion
If true, the underlying trajectories might be initialized with backwards motions in case the goal is ...
Definition: teb_config.h:77
double acc_lim_x
Maximum translational acceleration of the robot.
Definition: teb_config.h:100
double min_obstacle_dist
Minimum desired separation from obstacles.
Definition: teb_config.h:125
double weight_prefer_rotdir
Optimization weight for preferring a specific turning direction (-> currently only activated if an os...
Definition: teb_config.h:172
bool shrink_horizon_backup
Allows the planner to shrink the horizon temporary (50%) in case of automatically detected issues...
Definition: teb_config.h:216
double force_reinit_new_goal_angular
Reinitialize the trajectory if a previous goal is updated with an angular difference of more than the...
Definition: teb_config.h:84
double roadmap_graph_area_width
< Specify the number of samples generated for creating the roadmap graph, if simple_exploration is tu...
Definition: teb_config.h:195
double dt_hysteresis
Hysteresis for automatic resizing depending on the current temporal resolution (dt): usually 10% of d...
Definition: teb_config.h:73
Config class for the teb_local_planner and its components.
Definition: teb_config.h:61
double weight_max_vel_theta
Optimization weight for satisfying the maximum allowed angular velocity.
Definition: teb_config.h:157
bool selection_alternative_time_cost
If true, time cost is replaced by the total transition time.
Definition: teb_config.h:190
double theta_stopped_vel
Below what maximum rotation velocity we consider the robot to be stopped in rotation.
Definition: teb_config.h:118
double xy_goal_tolerance
Allowed final euclidean distance to the goal position.
Definition: teb_config.h:115
double global_plan_viapoint_sep
Min. separation between each two consecutive via-points extracted from the global plan (if negative: ...
Definition: teb_config.h:78
double obstacle_heading_threshold
Specify the value of the normalized scalar product between obstacle heading and goal heading in order...
Definition: teb_config.h:201
struct teb_local_planner::TebConfig::Robot robot
Robot related parameters.
Recovery/backup related parameters.
Definition: teb_config.h:214
double yaw_goal_tolerance
Allowed final orientation error.
Definition: teb_config.h:114
double min_turning_radius
Minimum turning radius of a carlike robot (diff-drive robot: zero);.
Definition: teb_config.h:103
double detours_orientation_tolerance
A plan is considered a detour if its start orientation differs more than this from the best plan...
Definition: teb_config.h:208
struct teb_local_planner::TebConfig::Trajectory trajectory
Trajectory related parameters.
double weight_max_vel_y
Optimization weight for satisfying the maximum allowed strafing velocity (in use only for holonomic r...
Definition: teb_config.h:156
Goal tolerance related parameters.
Definition: teb_config.h:112
int max_number_plans_in_current_class
Specify the maximum number of trajectories to try that are in the same homotopy class as the current ...
Definition: teb_config.h:185
double weight_kinematics_turning_radius
Optimization weight for enforcing a minimum turning radius (carlike robots)
Definition: teb_config.h:163
bool legacy_obstacle_association
If true, the old association strategy is used (for each obstacle, find the nearest TEB pose)...
Definition: teb_config.h:132
double weight_acc_lim_x
Optimization weight for satisfying the maximum allowed translational acceleration.
Definition: teb_config.h:158
double visualize_with_time_as_z_axis_scale
If this value is bigger than 0, the trajectory and obstacles are visualized in 3d using the time as t...
Definition: teb_config.h:206
double weight_acc_lim_y
Optimization weight for satisfying the maximum allowed strafing acceleration (in use only for holonom...
Definition: teb_config.h:159
bool optimization_activate
Activate the optimization.
Definition: teb_config.h:150
int feasibility_check_no_poses
Specify up to which pose on the predicted plan the feasibility should be checked each sampling interv...
Definition: teb_config.h:85
double costmap_obstacles_behind_robot_dist
Limit the occupied local costmap obstacles taken into account for planning behind the robot (specify ...
Definition: teb_config.h:130
struct teb_local_planner::TebConfig::GoalTolerance goal_tolerance
Goal tolerance related parameters.
double teb_autosize
Enable automatic resizing of the trajectory w.r.t to the temporal resolution (recommended) ...
Definition: teb_config.h:71
Obstacle related parameters.
Definition: teb_config.h:123
bool via_points_ordered
If true, the planner adheres to the order of via-points in the storage container. ...
Definition: teb_config.h:79
double obstacle_association_force_inclusion_factor
The non-legacy obstacle association technique tries to connect only relevant obstacles with the discr...
Definition: teb_config.h:133
void checkDeprecated(const ros::NodeHandle &nh) const
Check if some deprecated parameters are found and print warnings.
Definition: teb_config.cpp:374
void reconfigure(TebLocalPlannerReconfigureConfig &cfg)
Reconfigure parameters from the dynamic_reconfigure config. Change parameters dynamically (e...
Definition: teb_config.cpp:184
double weight_max_vel_x
Optimization weight for satisfying the maximum allowed translational velocity.
Definition: teb_config.h:155
double force_reinit_new_goal_dist
Reinitialize the trajectory if a previous goal is updated with a seperation of more than the specifie...
Definition: teb_config.h:83
double dt_ref
Desired temporal resolution of the trajectory (should be in the magniture of the underlying control r...
Definition: teb_config.h:72
double acc_lim_theta
Maximum angular acceleration of the robot.
Definition: teb_config.h:102
bool enable_multithreading
Activate multiple threading for planning multiple trajectories in parallel.
Definition: teb_config.h:182
Robot related parameters.
Definition: teb_config.h:93
void loadRosParamFromNodeHandle(const ros::NodeHandle &nh)
Load parmeters from the ros param server.
Definition: teb_config.cpp:44
double switching_blocking_period
Specify a time duration in seconds that needs to be expired before a switch to new equivalence class ...
Definition: teb_config.h:192
struct teb_local_planner::TebConfig::HomotopyClasses hcp
std::string odom_topic
Topic name of the odometry message, provided by the robot driver or simulator.
Definition: teb_config.h:65
double selection_dropping_probability
At each planning cycle, TEBs other than the current &#39;best&#39; one will be randomly dropped with this pro...
Definition: teb_config.h:191
double weight_inflation
Optimization weight for the inflation penalty (should be small)
Definition: teb_config.h:167
bool visualize_hc_graph
Visualize the graph that is created for exploring new homotopy classes.
Definition: teb_config.h:205
bool simple_exploration
If true, distinctive trajectories are explored using a simple left-right approach (pass each obstacle...
Definition: teb_config.h:183
int control_look_ahead_poses
Min angular resolution used during the costmap collision check. If not respected, intermediate sample...
Definition: teb_config.h:88
int divergence_detection_max_chi_squared
Maximum acceptable Mahalanobis distance above which it is assumed that the optimization diverged...
Definition: teb_config.h:224
double h_signature_prescaler
Scale number of obstacle value in order to allow huge number of obstacles. Do not choose it extremly ...
Definition: teb_config.h:197
double selection_cost_hysteresis
Specify how much trajectory cost must a new candidate have w.r.t. a previously selected trajectory in...
Definition: teb_config.h:186
double weight_obstacle
Optimization weight for satisfying a minimum separation from obstacles.
Definition: teb_config.h:166
double trans_stopped_vel
Below what maximum velocity we consider the robot to be stopped in translation.
Definition: teb_config.h:117
bool delete_detours_backwards
If enabled, the planner will discard the plans detouring backwards with respect to the best plan...
Definition: teb_config.h:207
bool enable_homotopy_class_planning
Activate homotopy class planning (Requires much more resources that simple planning, since multiple trajectories are optimized at once).
Definition: teb_config.h:181
bool free_goal_vel
Allow the robot&#39;s velocity to be nonzero (usally max_vel) for planning purposes.
Definition: teb_config.h:116
double max_vel_theta
Maximum angular velocity of the robot.
Definition: teb_config.h:99
double oscillation_v_eps
Threshold for the average normalized linear velocity: if oscillation_v_eps and oscillation_omega_eps ...
Definition: teb_config.h:219
double penalty_epsilon
Add a small safety margin to penalty functions for hard-constraint approximations.
Definition: teb_config.h:153
double length_start_orientation_vector
Length of the vector used to compute the start orientation of a plan.
Definition: teb_config.h:209
bool exact_arc_length
If true, the planner uses the exact arc length in velocity, acceleration and turning rate computation...
Definition: teb_config.h:82
double oscillation_filter_duration
Filter length/duration [sec] for the detection of oscillations.
Definition: teb_config.h:222
double obstacle_association_cutoff_factor
See obstacle_association_force_inclusion_factor, but beyond a multiple of [value]*min_obstacle_dist a...
Definition: teb_config.h:134
double selection_viapoint_cost_scale
Extra scaling of via-point cost terms just for selecting the &#39;best&#39; candidate.
Definition: teb_config.h:189
int no_inner_iterations
Number of solver iterations called in each outerloop iteration.
Definition: teb_config.h:147
double weight_acc_lim_theta
Optimization weight for satisfying the maximum allowed angular acceleration.
Definition: teb_config.h:160
double weight_shortest_path
Optimization weight for contracting the trajectory w.r.t. path length.
Definition: teb_config.h:165
double weight_dynamic_obstacle_inflation
Optimization weight for the inflation penalty of dynamic obstacles (should be small) ...
Definition: teb_config.h:169
int prevent_look_ahead_poses_near_goal
Index of the pose used to extract the velocity command.
Definition: teb_config.h:89
double shrink_horizon_min_duration
Specify minimum duration for the reduced horizon in case an infeasible trajectory is detected...
Definition: teb_config.h:217
bool costmap_converter_spin_thread
If true, the costmap converter invokes its callback queue in a different thread.
Definition: teb_config.h:136
int obstacle_poses_affected
The obstacle position is attached to the closest pose on the trajectory to reduce computational effor...
Definition: teb_config.h:131
double obstacle_keypoint_offset
If simple_exploration is turned on, this parameter determines the distance on the left and right side...
Definition: teb_config.h:200
double weight_dynamic_obstacle
Optimization weight for satisfying a minimum separation from dynamic obstacles.
Definition: teb_config.h:168
double obstacle_cost_exponent
Exponent for nonlinear obstacle cost (cost = linear_cost * obstacle_cost_exponent). Set to 1 to disable nonlinear cost (default)
Definition: teb_config.h:175
Optimization related parameters.
Definition: teb_config.h:145
double roadmap_graph_area_length_scale
The length of the rectangular region is determined by the distance between start and goal...
Definition: teb_config.h:196
double obstacle_proximity_ratio_max_vel
Ratio of the maximum velocities used as an upper bound when reducing the speed due to the proximity t...
Definition: teb_config.h:138
std::string costmap_converter_plugin
Define a plugin name of the costmap_converter package (costmap cells are converted to points/lines/po...
Definition: teb_config.h:135
bool viapoints_all_candidates
If true, all trajectories of different topologies are attached to the current set of via-points...
Definition: teb_config.h:203
double weight_optimaltime
Optimization weight for contracting the trajectory w.r.t. transition time.
Definition: teb_config.h:164
double obstacle_proximity_upper_bound
Distance to a static obstacle for which the velocity should be higher.
Definition: teb_config.h:140
bool global_plan_overwrite_orientation
Overwrite orientation of local subgoals provided by the global planner.
Definition: teb_config.h:76
double weight_kinematics_nh
Optimization weight for satisfying the non-holonomic kinematics.
Definition: teb_config.h:161
struct teb_local_planner::TebConfig::Recovery recovery
Parameters related to recovery and backup strategies.
TebConfig()
Construct the TebConfig using default values.
Definition: teb_config.h:241
void checkParameters() const
Check parameters and print warnings in case of discrepancies.
Definition: teb_config.cpp:305
int costmap_converter_rate
The rate that defines how often the costmap_converter plugin processes the current costmap (the value...
Definition: teb_config.h:137
bool include_dynamic_obstacles
Specify whether the movement of dynamic obstacles should be predicted by a constant velocity model (t...
Definition: teb_config.h:128
double global_plan_prune_distance
Distance between robot and via_points of global plan which is used for pruning.
Definition: teb_config.h:81
double max_vel_x_backwards
Maximum translational velocity of the robot for driving backwards.
Definition: teb_config.h:96
bool divergence_detection_enable
True to enable divergence detection.
Definition: teb_config.h:223
double weight_viapoint
Optimization weight for minimizing the distance to via-points.
Definition: teb_config.h:171
double oscillation_recovery_min_duration
Minumum duration [sec] for which the recovery mode is activated after an oscillation is detected...
Definition: teb_config.h:221
int no_outer_iterations
Each outerloop iteration automatically resizes the trajectory and invokes the internal optimizer with...
Definition: teb_config.h:148
double dynamic_obstacle_inflation_dist
Buffer zone around predicted locations of dynamic obstacles with non-zero penalty costs (should be la...
Definition: teb_config.h:127
struct teb_local_planner::TebConfig::Optimization optim
Optimization related parameters.
double selection_obst_cost_scale
Extra scaling of obstacle cost terms just for selecting the &#39;best&#39; candidate.
Definition: teb_config.h:188
bool publish_feedback
Publish planner feedback containing the full trajectory and a list of active obstacles (should be ena...
Definition: teb_config.h:86
double acc_lim_y
Maximum strafing acceleration of the robot.
Definition: teb_config.h:101
double h_signature_threshold
Two h-signatures are assumed to be equal, if both the difference of real parts and complex parts are ...
Definition: teb_config.h:198
double oscillation_omega_eps
Threshold for the average normalized angular velocity: if oscillation_v_eps and oscillation_omega_eps...
Definition: teb_config.h:220
double wheelbase
The distance between the drive shaft and steering axle (only required for a carlike robot with &#39;cmd_a...
Definition: teb_config.h:104
double max_global_plan_lookahead_dist
Specify maximum length (cumulative Euclidean distances) of the subset of the global plan taken into a...
Definition: teb_config.h:80
bool oscillation_recovery
Try to detect and resolve oscillations between multiple solutions in the same equivalence class (robo...
Definition: teb_config.h:218
int max_number_classes
Specify the maximum number of allowed alternative homotopy classes (limits computational effort) ...
Definition: teb_config.h:184
double inflation_dist
buffer zone around obstacles with non-zero penalty costs (should be larger than min_obstacle_dist in ...
Definition: teb_config.h:126
double max_ratio_detours_duration_best_duration
Detours are discarted if their execution time / the execution time of the best teb is > this...
Definition: teb_config.h:210
struct teb_local_planner::TebConfig::Obstacles obstacles
Obstacle related parameters.
double max_vel_trans
Maximum translational velocity of the robot for omni robots, which is different from max_vel_x...
Definition: teb_config.h:98
double weight_kinematics_forward_drive
Optimization weight for forcing the robot to choose only forward directions (positive transl...
Definition: teb_config.h:162
int min_samples
Minimum number of samples (should be always greater than 2)
Definition: teb_config.h:74
boost::mutex & configMutex()
Return the internal config mutex.
Definition: teb_config.h:419
double max_vel_x
Maximum translational velocity of the robot.
Definition: teb_config.h:95
bool optimization_verbose
Print verbose information.
Definition: teb_config.h:151
Trajectory related parameters.
Definition: teb_config.h:69
double selection_prefer_initial_plan
Specify a cost reduction in the interval (0,1) for the trajectory in the equivalence class of the ini...
Definition: teb_config.h:187


teb_local_planner
Author(s): Christoph Rösmann
autogenerated on Wed Jun 1 2022 02:26:31