參考官方教程 http://wiki.ros.org/teb_local_planner/Tutorials, 全英文看着有點累, 在此總結一下調試的過程和小小的經驗
安裝 teb_local_planner
sudo apt-get install ros-kinetic-teb-local-planner
sudo apt-get install ros-kinetic-teb-local-planner-tutorials
觀察單個軌跡的仿真
主要是觀察參數對於路徑規劃上的影響
啓動節點 和 rviz
rosparam set /test_optim_node/enable_homotopy_class_planning True
roslaunch teb_local_planner test_optim_node.launch
啓動參數調節器
這裏可以觀察參數的對於路徑規劃上的影響.
rosrun rqt_reconfigure rqt_reconfigure
不同機器人FootPrint 的仿真
兩輪差速 機器人的仿真
roslaunch teb_local_planner_tutorials robot_diff_drive_in_stage.launch
啓動參數調節器
rosrun rqt_reconfigure rqt_reconfigure
汽車模型機器人
roslaunch teb_local_planner_tutorials robot_carlike_in_stage.launch
TEB 的參數調試
參數 | 類型 | 含義 | 最小 | 默認 | 最大 |
---|---|---|---|---|---|
teb_autosize | bool | 優化期間允許改變軌跡的時域長度;Enable the automatic resizing of the trajectory during optimization (based on the temporal resolution of the trajectory, recommended) | False | True | True |
dt_ref | double | 局部路徑規劃的解析度; Temporal resolution of the planned trajectory (usually it is set to the magnitude of the 1/control_rate) | 0.01 | 0.3 | 1.0 |
dt_hysteresis | double | 允許改變的時域解析度的浮動範圍, 一般爲 dt_ref 的 10% 左右; Hysteresis that is utilized for automatic resizing depending on the current temporal resolution (dt): usually 10% of dt_ref | 0.002 | 0.1 | 0.5 |
global_plan_overwrite_orientation | bool | 覆蓋全局路徑中局部路徑點的朝向,Some global planners are not considering the orientation at local subgoals between start and global goal, therefore determine it automatically | False | True | True |
allow_init_with_backwards_motion | bool | 允許在開始時想後退來執行軌跡,If true, the underlying trajectories might be initialized with backwards motions in case the goal is behind the start within the local costmap (this is only recommended if the robot is equipped with rear sensors) | False | False | True |
max_global_plan_lookahead_dist | double | 考慮優化的全局計劃子集的最大長度(累積歐幾里得距離)(如果爲0或負數:禁用;長度也受本地Costmap大小的限制), Specify maximum length (cumulative Euclidean distances) of the subset of the global plan taken into account for optimization [if 0 or negative: disabled; the length is also bounded by the local costmap size ] | 0.0 | 3.0 | 50.0 |
force_reinit_new_goal_dist | double | 如果上一個目標的間隔超過指定的米數(跳過熱啓動),則強制規劃器重新初始化軌跡,Force the planner to reinitialize the trajectory if a previous goal is updated with a seperation of more than the specified value in meters (skip hot-starting) | 0.0 | 1.0 | 10.0 |
feasibility_check_no_poses | int | 檢測位姿可到達的時間間隔,Specify up to which pose on the predicted plan the feasibility should be checked each sampling interval | 0 | 5 | 50 |
exact_arc_length | bool | 如果爲真,規劃器在速度、加速度和轉彎率計算中使用精確的弧長[->增加的CPU時間],否則使用歐幾里德近似。If true, the planner uses the exact arc length in velocity, acceleration and turning rate computations [-> increased cpu time], otherwise the euclidean approximation is used. | False | False | True |
publish_feedback | bool | 發佈包含完整軌跡和活動障礙物列表的規劃器反饋,Publish planner feedback containing the full trajectory and a list of active obstacles (should be enabled only for evaluation or debugging purposes) | False | False | True |
visualize_with_time_as_z_axis_scale | double | 如果該值大於0,則使用該值縮放的Z軸的時間在3D中可視化軌跡和障礙物。最適用於動態障礙。 If this value is bigger than 0, the trajectory and obstacles are visualized in 3d using the time as the z-axis scaled by this value. Most useful for dynamic obstacles. | 0.0 | 0.0 | 1.0 |
global_plan_viapoint_sep | double | 從全局計劃中提取的每兩個連續通過點之間的最小間隔[如果爲負:禁用], Min. separation between each two consecutive via-points extracted from the global plan [if negative: disabled] | -0.1 | -0.1 | 5.0 |
via_points_ordered | bool | 如果爲真,規劃器遵循存儲容器中通過點的順序。If true, the planner adheres to the order of via-points in the storage container | False | False | True |
max_vel_x | double | 最大x前向速度,Maximum translational velocity of the robot | 0.01 | 0.4 | 100.0 |
max_vel_x_backwards | double | 最大x後退速度,Maximum translational velocity of the robot for driving backwards | 0.01 | 0.2 | 100.0 |
max_vel_theta | double | 最大轉向叫速度 Maximum angular velocity of the robot | 0.01 | 0.3 | 100.0 |
acc_lim_x | double | 最大x加速度,Maximum translational acceleration of the robot | 0.01 | 0.5 | 100.0 |
acc_lim_theta | double | 最大角速度,Maximum angular acceleration of the robot | 0.01 | 0.5 | 100.0 |
is_footprint_dynamic | bool | 是否footprint 爲動態的,If true, updated the footprint before checking trajectory feasibility | False | False | True |
min_turning_radius | double | 車類機器人的最小轉彎半徑,Minimum turning radius of a carlike robot (diff-drive robot: zero) | 0.0 | 0.0 | 50.0 |
wheelbase | double | 驅動軸和轉向軸之間的距離(僅適用於啓用了“Cmd_angle_而不是_rotvel”的Carlike機器人);對於後輪式機器人,該值可能爲負值! The distance between the drive shaft and steering axle (only required for a carlike robot with ‘cmd_angle_instead_rotvel’ enabled); The value might be negative for back-wheeled robots! | -10.0 | 1.0 | 10.0 |
cmd_angle_instead_rotvel | bool | 將收到的角速度消息轉換爲 操作上的角度變化。 Substitute the rotational velocity in the commanded velocity message by the corresponding steering angle (check ‘axles_distance’) | False | False | True |
max_vel_y | double | 最大y方向速度, Maximum strafing velocity of the robot (should be zero for non-holonomic robots!) | 0.0 | 0.0 | 100.0 |
acc_lim_y | double | 最大y向加速度, Maximum strafing acceleration of the robot | 0.01 | 0.5 | 100.0 |
xy_goal_tolerance | double | 目標 xy 偏移容忍度,Allowed final euclidean distance to the goal position | 0.001 | 0.2 | 10.0 |
yaw_goal_tolerance | double | 目標 角度 偏移容忍度, Allowed final orientation error to the goal orientation | 0.001 | 0.1 | 3.2 |
free_goal_vel | bool | 允許機器人以最大速度駛向目的地, Allow the robot’s velocity to be nonzero for planning purposes (the robot can arrive at the goal with max speed) | False | False | True |
min_obstacle_dist | double | 和障礙物最小距離, Minimum desired separation from obstacles | 0.0 | 0.5 | 10.0 |
inflation_dist | double | 障礙物膨脹距離, Buffer zone around obstacles with non-zero penalty costs (should be larger than min_obstacle_dist in order to take effect) | 0.0 | 0.6 | 15.0 |
dynamic_obstacle_inflation_dist | double | 動態障礙物的膨脹範圍, Buffer zone around predicted locations of dynamic obstacles with non-zero penalty costs (should be larger than min_obstacle_dist in order to take effect) | 0.0 | 0.6 | 15.0 |
include_dynamic_obstacles | bool | 是否將動態障礙物預測爲速度模型, Specify whether the movement of dynamic obstacles should be predicted by a constant velocity model (this also changes the homotopy class search). If false, all obstacles are considered to be static. | False | False | True |
include_costmap_obstacles | bool | costmap 中的障礙物是否被直接考慮, Specify whether the obstacles in the costmap should be taken into account directly (this is necessary if no seperate clustering and detection is implemented) | False | True | True |
legacy_obstacle_association | bool | 是否嚴格遵循局部規劃出來的路徑, If true, the old association strategy is used (for each obstacle, find the nearest TEB pose), otherwise the new one (for each teb pose, find only ‘relevant’ obstacles). | False | False | True |
obstacle_association_force_inclusion_factor | double | The non-legacy obstacle association technique tries to connect only relevant obstacles with the discretized trajectory during optimization, all obstacles within a specifed distance are forced to be included (as a multiple of min_obstacle_dist), e.g. choose 2.0 in order to consider obstacles within a radius of 2.0*min_obstacle_dist. | 0.0 | 1.5 | 100.0 |
obstacle_association_cutoff_factor | double | See obstacle_association_force_inclusion_factor, but beyond a multiple of [value]*min_obstacle_dist all obstacles are ignored during optimization. obstacle_association_force_inclusion_factor is processed first. | 1.0 | 5.0 | 100.0 |
costmap_obstacles_behind_robot_dist | double | Limit the occupied local costmap obstacles taken into account for planning behind the robot (specify distance in meters) | 0.0 | 1.5 | 20.0 |
obstacle_poses_affected | int | The obstacle position is attached to the closest pose on the trajectory to reduce computational effort, but take a number of neighbors into account as well | 0 | 30 | 200 |
no_inner_iterations | int | 被外循環調用後內循環執行優化次數, Number of solver iterations called in each outerloop iteration | 1 | 5 | 100 |
no_outer_iterations | int | 執行的外循環的優化次數, Each outerloop iteration automatically resizes the trajectory and invokes the internal optimizer with no_inner_iterations | 1 | 4 | 100 |
optimization_activate | bool | 激活優化, Activate the optimization | False | True | True |
optimization_verbose | bool | 打印優化過程詳情, Print verbose information | False | False | True |
penalty_epsilon | double | 對於硬約束近似,在懲罰函數中添加安全範圍, Add a small safty margin to penalty functions for hard-constraint approximations | 0.0 | 0.1 | 1.0 |
weight_max_vel_x | double | 最大x速度權重, Optimization weight for satisfying the maximum allowed translational velocity | 0.0 | 2.0 | 1000.0 |
weight_max_vel_y | double | 最大y速度權重,Optimization weight for satisfying the maximum allowed strafing velocity (in use only for holonomic robots) | 0.0 | 2.0 | 1000.0 |
weight_max_vel_theta | double | 最大叫速度權重, Optimization weight for satisfying the maximum allowed angular velocity | 0.0 | 1.0 | 1000.0 |
weight_acc_lim_x | double | 最大x 加速度權重,Optimization weight for satisfying the maximum allowed translational acceleration | 0.0 | 1.0 | 1000.0 |
weight_acc_lim_y | double | 最大y 加速度權重,Optimization weight for satisfying the maximum allowed strafing acceleration (in use only for holonomic robots) | 0.0 | 1.0 | 1000.0 |
weight_acc_lim_theta | double | 最大角速度權重,Optimization weight for satisfying the maximum allowed angular acceleration | 0.0 | 1.0 | 1000.0 |
weight_kinematics_nh | double | Optimization weight for satisfying the non-holonomic kinematics | 0.0 | 1000.0 | 10000.0 |
weight_kinematics_forward_drive | double | 優化過程中,迫使機器人只選擇前進方向,差速輪適用,Optimization weight for forcing the robot to choose only forward directions (positive transl. velocities, only diffdrive robot) | 0.0 | 1.0 | 1000.0 |
weight_kinematics_turning_radius | double | 優化過程中,車型機器人的最小轉彎半徑的權重。 Optimization weight for enforcing a minimum turning radius (carlike robots) | 0.0 | 1.0 | 1000.0 |
weight_optimaltime | double | 優化過程中,基於軌跡的時間上的權重, Optimization weight for contracting the trajectory w.r.t transition time | 0.0 | 1.0 | 1000.0 |
weight_obstacle | double | 優化過程中,和障礙物最小距離的權重,Optimization weight for satisfying a minimum seperation from obstacles | 0.0 | 50.0 | 1000.0 |
weight_inflation | double | 優化過程中, 膨脹區的權重,Optimization weight for the inflation penalty (should be small) | 0.0 | 0.1 | 10.0 |
weight_dynamic_obstacle | double | 優化過程中,和動態障礙物最小距離的權重,Optimization weight for satisfying a minimum seperation from dynamic obstacles | 0.0 | 50.0 | 1000.0 |
weight_dynamic_obstacle_inflation | double | 優化過程中,和動態障礙物膨脹區的權重,Optimization weight for the inflation penalty of dynamic obstacles (should be small) | 0.0 | 0.1 | 10.0 |
weight_viapoint | double | 優化過程中,和全局路徑採樣點距離的權重, Optimization weight for minimizing the distance to via-points | 0.0 | 1.0 | 1000.0 |
weight_adapt_factor | double | Some special weights (currently ‘weight_obstacle’) are repeatedly scaled by this factor in each outer TEB iteration (weight_new: weight_old * factor); Increasing weights iteratively instead of setting a huge value a-priori leads to better numerical conditions of the underlying optimization problem. | 1.0 | 2.0 | 100.0 |
enable_multithreading | bool | 允許多線程並行處理, Activate multiple threading for planning multiple trajectories in parallel | False | True | True |
max_number_classes | int | 允許的線程數, Specify the maximum number of allowed alternative homotopy classes (limits computational effort) | 1 | 5 | 100 |
selection_cost_hysteresis | double | Specify how much trajectory cost must a new candidate have w.r.t. a previously selected trajectory in order to be selected (selection if new_cost < old_cost*factor) | 0.0 | 1.0 | 2.0 |
selection_prefer_initial_plan | double | Specify a cost reduction in the interval (0,1) for the trajectory in the equivalence class of the initial plan.) | 0.0 | 0.95 | 1.0 |
selection_obst_cost_scale | double | Extra scaling of obstacle cost terms just for selecting the ‘best’ candidate (new_obst_cost: obst_cost*factor) | 0.0 | 100.0 | 1000.0 |
selection_viapoint_cost_scale | double | Extra scaling of via-point cost terms just for selecting the ‘best’ candidate. (new_viapt_cost: viapt_cost*factor) | 0.0 | 1.0 | 100.0 |
selection_alternative_time_cost | bool | If true, time cost is replaced by the total transition time. | False | False | True |
switching_blocking_period | double | Specify a time duration in seconds that needs to be expired before a switch to new equivalence class is allowed | 0.0 | 0.0 | 60.0 |
roadmap_graph_no_samples | int | Specify the number of samples generated for creating the roadmap graph, if simple_exploration is turend off | 1 | 15 | 100 |
roadmap_graph_area_width | double | Specify the width of the area in which sampled will be generated between start and goal [m ] (the height equals the start-goal distance) | 0.1 | 5.0 | 20.0 |
roadmap_graph_area_length_scale | double | The length of the rectangular region is determined by the distance between start and goal. This parameter further scales the distance such that the geometric center remains equal!) | 0.5 | 1.0 | 2.0 |
h_signature_prescaler | double | Scale number of obstacle value in order to allow huge number of obstacles. Do not choose it extremly low, otherwise obstacles cannot be distinguished from each other (0.2<H<=1) | 0.2 | 1.0 | 1.0 |
h_signature_threshold | double | Two h-signuteres are assumed to be equal, if both the difference of real parts and complex parts are below the specified threshold | 0.0 | 0.1 | 1.0 |
obstacle_heading_threshold | double | Specify the value of the normalized scalar product between obstacle heading and goal heading in order to take them (obstacles) into account for exploration) | 0.0 | 0.45 | 1.0 |
viapoints_all_candidates | bool | If true, all trajectories of different topologies are attached to the set of via-points, otherwise only the trajectory sharing the same one as the initial/global plan is attached (no effect in test_optim_node). | False | True | True |
visualize_hc_graph | bool | Visualize the graph that is created for exploring new homotopy classes | False | False | True |
shrink_horizon_backup | bool | 當規劃器檢測到系統異常,允許縮小時域規劃範圍。Allows the planner to shrink the horizon temporary (50%) in case of automatically detected issues. | False | True | True |
oscillation_recovery | bool | 嘗試檢測和解決振盪,Try to detect and resolve oscillations between multiple solutions in the same equivalence class (robot frequently switches between left/right/forward/backwards). | False | True | True |
重要參數總結
序號 | 參數 | 功能 |
---|---|---|
1 | max_global_plan_lookahead_dist | 考慮優化的全局計劃子集的最大長度(累積歐幾里得距離) |
2 | min_obstacle_dist | 避障距離(障礙物膨脹半徑) |
3 | dt_ref | 軌跡的時間分辨率, TEB 時間最優策略, 分辨率越高更好逼近真實 |