Robot Motion Planning—Home Work 2

 

 

Q2) Implement the Bug algorithm of your choice.

 

I implemented Bug 2 algorithm using Matlab. Some of the successful and failure runs of my implementation of Bug 2 are available in the following links: (They are all .avi files.)

 

Success 1    -        Two Triangular Obstacles on the path to goal

Success 2    -        Three Triangular Obstacles on the path to goal

Success 3    -        Four Triangular Obstacles on the path to goal

Success 4    -        Two Quadrilateral Obstacles on the path to goal

Failure 1      -        Goal point within the second triangular obstacle

Failure 2      -        Goal point within the quadrilateral obstacle

 

Implementation:

· The user can choose the number of obstacles and the number of edges of the obstacles. Here, all obstacles have been assumed to be polygons and having same number of edges. The above videos primarily have triangular obstacles just for the sake of convenience.

· The user selects the vertices of the obstacle polygons in a counter-clockwise direction and then selects the start and goal points. The obstacles appear as blue polygons without any fill. I didn't fill them up as it would be better to visualize a goal point within them. The start and goal points are represented by red circles and have a tag next to them.

· The robot is represented by the center of a black ‘*’ and is assumed to be a point moving around the huge obstacles. The edges of the ‘*’ keep the robot (at the center) away from colliding with the obstacles.

· The Bug 2 algorithm is as follows (And this is what is implemented):

1. The robot moves towards the goal (It is assumed that the robot always knows which direction the goal is) i.e along the m-line. (Refer to the figure here)

2. If an obstacle is in its way, it turns right and follows the obstacle’s boundary until it reaches the m-line again at a point that is closer to the goal than the previous point.

3. The robot leaves the obstacle and heads towards the goal.

4. The robot repeats step 1, 2 & 3 until it reaches the goal and quits.

· The failure cases occur when the goal point is within the obstacle. In such a case, the robot reaches the m-line again but at a point that is not closer to the goal. In such a case, my implementation displays “NO PATH FOUND” and quits.

 

The reasons I chose to implement Bug 2 algorithm are:

· Bug 2 algorithm sounds more logical than a circumnavigating Bug 1 algorithm where it keeps going all over the obstacle.  It definitely makes a lot of sense to stop on the m-line when you know the direction of the goal.

· Bug 2 algorithm requires no range sensors and uses very little data while the Tangent Bug algorithm acquires a lot of data using range sensors, and processes them. I find Bug 2 algorithm less expensive than the Tangent Bug Algorithm.

Hence, Bug 2 algorithm serves the purpose in a more logical and less expensive way and that’s why I implemented it.