# TEB's path does not fit global plan, and there is always an oscillation.

Hi, I use TEB as a local path planner for a car-like robot.

Below are the parameters:

```
TebLocalPlannerROS:
odom_topic: odom
# Trajectory
teb_autosize: True
dt_ref: 0.35
dt_hysteresis: 0.1
global_plan_overwrite_orientation: True
allow_init_with_backwards_motion: True
max_global_plan_lookahead_dist: 5.0
feasibility_check_no_poses: 2
global_plan_viapoint_sep: 0.5
# Robot
max_vel_x: 0.55
max_vel_x_backwards: 0.3
max_vel_y: 0.0
max_vel_theta: 0.5 # the angular velocity is also bounded by min_turning_radius in case of a carlike robot (r = v / omega)
acc_lim_x: 0.5
acc_lim_theta: 0.2
# ********************** Carlike robot parameters ********************
min_turning_radius: 1.0 # Min turning radius of the carlike robot (compute value using a model or adjust with rqt_reconfigure manually)
wheelbase: 1.35 # Wheelbase of our robot
cmd_angle_instead_rotvel: False # stage simulator takes the angle instead of the rotvel as input (twist message)
# ********************************************************************
footprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
type: "line"
radius: 0.2 # for type "circular"
line_start: [0.3, 0.0] # for type "line"
line_end: [1.1, 0.0] # for type "line"
front_offset: 1.0 # for type "two_circles"
front_radius: 0.56 # for type "two_circles"
rear_offset: -0.16 # for type "two_circles"
rear_radius: 0.56 # for type "two_circles"
vertices: [ [0.0, 0], [0.0, 1.55], [1.55, 0.4], [0.0, 0.4 ]] # for type "polygon"
# GoalTolerance
xy_goal_tolerance: 0.2
yaw_goal_tolerance: 0.1
free_goal_vel: False
# Obstacles
min_obstacle_dist: 0.85 # This value must also include our robot's expansion 0.6m for line type"
include_costmap_obstacles: True
costmap_obstacles_behind_robot_dist: 1.0
obstacle_poses_affected: 25
costmap_converter_plugin: ""
costmap_converter_spin_thread: True
costmap_converter_rate: 5
# Optimization
no_inner_iterations: 5
no_outer_iterations: 4
optimization_activate: True
optimization_verbose: False
penalty_epsilon: 0.1
weight_max_vel_x: 1
weight_max_vel_theta: 1
weight_acc_lim_x: 1
weight_acc_lim_theta: 5
weight_kinematics_nh: 1000
weight_kinematics_forward_drive: 1
weight_kinematics_turning_radius: 1
weight_optimaltime: 1
weight_obstacle: 50
weight_dynamic_obstacle: 10 # not in use yet
# Homotopy Class Planner
enable_homotopy_class_planning: True
enable_multithreading: True
simple_exploration: False
max_number_classes: 2
selection_cost_hysteresis: 1.0
selection_obst_cost_scale: 1.0
selection_alternative_time_cost: False
roadmap_graph_no_samples: 10
roadmap_graph_area_width: 3
h_signature_prescaler: 0.5
h_signature_threshold: 0.1
obstacle_keypoint_offset: 0.1
obstacle_heading_threshold: 0.45
visualize_hc_graph: False
```

The local planned path has always an oscillation around global path, I have played with the parameter:

```
dt_ref
max_global_plan_lookahead_dist
global_plan_viapoint_sep
max_vel_theta
acc_lim_theta
weight_acc_lim_theta
```

But not help. The robot can move can avoid obstacles, but always in this oscillating way, and there is no warning or error output in console.

Can anyone give me some suggestion?