Tuesday, July 28, 2009

Obstacle Avoidance with NXT


Implanting obstacle avoidance to the NXT is very complicated. The fact that the NXT is following the leader while trying to avoid obstacles and other NXTs makes the whole process way much harder to maintain. I am facing many different problems with my algorithm. The first problem was “the monkey in the middle”, where one NXT will get in the way of the other NXT preventing it from seeing the light. Then when I used one NXT sensors, I didn’t have enough data to provide for the NXT to allow it to avoid obstacles effectively, I was limited with directions. So I decided to use two NXT ultrasonic sensors, but I faced two major issues with that, the first was that the sensor only covers 30 degrees from the center on the sensor not the sides as I thought before. The other problem was with placing the sensors at the right angle. I could do that using the NXT parts we had; there was no possible way to mount the sensors on the NXT with the angles I desired. After all these problems I started considering using 3 ultrasonic sensors, having a sensor on each side and one in the front. Using three sensors is very complicated, there is a lot of data coming in at once which makes it a bit harder for the NXT to process and react to all the given data.

I wrote a code for the three sensors and started testing it. Testing showed that there are still blind spots on the NXT that lead the NXT to crash into some objects. Using only sonar sensors to cover all the NXT leaving no blind spots is very hard to do. Currently I am considering using another motor to have the sensor at the front of the NXT moving from side to side leaving the NXT with no blind spots but I still have to discuss that with my professor.

As I mentioned previously I had to raise the light to solve the Monkey in the Middle problem. But raising the light became a nightmare. My algorithm for flowing works as follows. When the NXTCam detects and object it moves the motors so it would have that object in its center of vision. I could flip the camera backwards and my algorithm will still work with no need to modify the code at all. Since the light is higher than the eye level of the NXTCam I had to change the angle of the NXTCam. When I changed the angle my algorithm just stopped working, and following the leader was not happening. I have to do many modifications to my constants in my code trying to find to right numbers, and find the right angle to put the NXTCam in. Such process was way harder than I expected. It is very frustrating because I am limited with the angles I can put the NXTCam in, but none of them seems to work with my constants.

Time: 8hrs

No comments:

Post a Comment