Ok everyone I had some free time and wanted to continue making my RMOAR (you can find it with a search).
So I decided to write the code from scratch cause I had an idea about its object avoiding function.
I started writing some of the code and also debugging and testing it in every step. Allthough I figured out that when
I added a line of code ,when the servo used for scanning was going left all were going smoothly when was going right
suddenly the speed was increased .So Im asking here "What Im doing wrong?" .