A sonar based obstacle avoidance module for application on AUV