Control frequency, trigger width and new code for front obstacle avoidance