Week 8 | |
I implemented a new function which accounts better for the relative position of the obstacle to the robot. Since the function use to add all of the obstacle vectors it use to be too large or too small in some instances and thus give a wrong vector to the vector mover. With the new function if the obstacle is between 0 and Pi/2 radians (to the left of) to the robot then the x-component of that obstacle vector would be added while the y-component of the vector would be subtracted. Similarly, if the obstacle is on the right side of the robot( 0 to -Pi/2 radians) the y-component of the obstacle vector would be added and the x-component subtracted. A better segmentation can be done if the -Pi/2 to Pi/2 region is divided into four regions, where the front two regions would influence the movement front to back while the side regions would influence the top-down movement. An interesting thing happened this week. While last week i had not chance to work on my code and the Friday before we left for Boston my code worked in some areas, this week it worked in the areas it did not work before and did not work where it did work before. I have no explanation for this. Most of the week the framework was broken so i could not do anything. I looked through all of the saved pieces of code dated before my departure for Boston but i could not find anything that worked or was different from the new code. Before when the program saw its goal behind an obstacle and decided to move towards it, the robot crashed into the obstacle because it entered a mode "if obstacle in sight". However with this code, the robot avoids those obstacles and reaches its goal without crashing. On Thursday someone noticed that the laser was returning incorrect readings and Fritz began to work on the framework. I checked the readings but they were okay. However, i could not do anything because the framework was down. Unfortunately I cannot post the videos of the simulations because the files are too big. |