You are on page 1of 1

Code:

To complete this simulation mainly two functions were used, first one was to draw the Voronoi

diagram on a 2d plane and second one was to move the robot on the that 2d plane. You can also

import a Voronoi diagram in a 2d plot and move the robot accordingly. Both ways are correct Now

the challenge was to move the robot on the lines of Voronoi diagram without colliding with the

obstacles on different path. Moreover, robot should follow the shortest path on the 2d plot to reach

the ending side.

hgtransform(); was used to draw a square shaped robot.

makehgtform(); was used to move the robot on the desired path without collision with the

obstacles.

To move the robot, you must specify the starting and ending points on the plane. Now we all know

that we are using a 2d plane so ‘z’ axis value must remain constant throughout the code.

menu(); was used to display a simple 2 option menu when code was executed.

Simulation:

A generalized Voronoi diagram for a map containing at 4 obstacles is simulated using GUI in

MATLAB. There are start and end points. The robot is moving from the start point to the end point

through the edge of generalized Voronoi diagram. The robot motion is continuously deformed in

response to unexpected obstacles. If the robot encounter any obstacle then it will deform its path

and move to any other path to reach the end point.

You might also like