Oscillations when using teb_local_planner for car like robot
Facing an issue with the teb_local_planner, which is also mentioned here - Oscillations around global path while using teb local planner?.
I am using an Ackermann drive based (car like steering mechanism) robot with a teb_local_planner. However, the robot seems to oscillate around the global path, i.e. if the robot starts off to the right of the path, then goes to the left, tries to come back and again goes to the right.
This is my teb_local_planner_params.yaml
:
TebLocalPlannerROS:
odom_topic: /vesc/odom
map_frame: map # default value is odom
# ******* Trajectory **********
teb_autosize: True
dt_ref: 0.4
dt_hysteresis: 0.1
global_plan_overwrite_orientation: True
allow_init_with_backwards_motion: True
max_global_plan_lookahead_dist: 3.0
feasibility_check_no_poses: 2
# ********** Robot **********
max_vel_x: 2.0
max_vel_x_backwards: 1.0
max_vel_y: 0.0
max_vel_theta: 0.3 # 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.5
# ********************** Carlike robot parameters ********************
min_turning_radius: 0.82
wheelbase: 0.34 # Wheelbase of our robot
cmd_angle_instead_rotvel: False
# ********************************************************************
footprint_model: # types: "point", "circular", "two_circles", "line", "polygon"
type: "circular"
radius: 0.28 # for type "circular"
# ********** GoalTolerance **********
xy_goal_tolerance: 0.2
yaw_goal_tolerance: 3.0
# velocity at goal point can be anything
free_goal_vel: False
# ********** Obstacles **********
min_obstacle_dist: 0.2
include_costmap_obstacles: True
costmap_obstacles_behind_robot_dist: 1.0
obstacle_poses_affected: 30
inflation_dist: 0.3
costmap_converter_plugin: ""
costmap_converter_spin_thread: True
costmap_converter_rate: 5
# ********** Optimization Parameters **********
weight_kinematics_forward_drive: 100.0
weight_acc_lim_x: 0.0
I visualized the trajectories (nav_msgs/Path) in rviz. The global planner's trajectory looked fine, one which the human would have taken. The local planner's trajectory had back and forth motions.
- Fixed the
robot_base_frame
from the center of my robot to the rear axle - Reduced both
acc_lim_theta
andmax_vel_theta
from about 0.3 to 0.12. - Increased
weight_kinematics_forward_drive
, which penalizes backward motion, from1.0
to1000
. The path planned by the planner remained the same.
This is the video of the actual robot motion (click on the image, redirects to YouTube):