Reading: Find material on Dijstra's Algorithm and read through carefully at least once. For example: Module 8 of the Algorithms course.
In this exercise, you will write a controller for the Dubin car (non-accelerative model) to perform a single task.
But first, let's see how a car simulator can be used without the GUI. Suppose you have written a controller. There are two ways you can test your controller:
public class SimpleCarControlTest {
public static void main (String[] argv)
{
// Build an instance of the simulator. Note: no obstacles in this example.
// The constructor: isAccel=false, isUnicycle=true
SimpleCarSimulator simulator = new SimpleCarSimulator (false, true);
simulator.init (50, 50, 0, null);
// This example moves the unicycle from (50,50) to (550,50).
double x = 50;
while (x < 550) {
// Pass the controls (v=10, theta=0) to the simulator. DeltaT=0.1.
simulator.nextStep (10, 0, 0.1);
// Now extract the new location and other info.
double t = simulator.getTime ();
x = simulator.getX ();
double y = simulator.getY ();
// Display.
System.out.println ("t=" + t + " x=" + x + " y=" + y);
// The CarGUI merely adds an animation delay and drawing here.
} //end-while
}
}
To use the DubinCarSimulator, your code would be similar:
public class DubinCarControlTest {
public static void main (String[] argv)
{
// Build an instance of the simulator. Note: no obstacles in this example.
// The constructor: isAccel=false
DubinCarSimulator simulator = new DubinCarSimulator (false);
simulator.init (50, 50, 0, null);
// This example moves the car from (50,50) to (550,50).
double x = 50;
while (x < 550) {
// Pass the controls (v1=10, v2=10) to the simulator. DeltaT=0.1.
simulator.nextStep (10, 10, 0.1);
// Now extract the new location and other info.
double t = simulator.getTime ();
x = simulator.getX ();
double y = simulator.getY ();
// Display.
System.out.println ("t=" + t + " x=" + x + " y=" + y);
} //end-while
}
}
You are to use the configuration in Scene-3:

The ultimate goal is to reach the target quickly and in the orientation facing rightwards. However, you are to do this in four discrete phases:



You should experiment with various values of A, v1 and v2 to see which values get you to the target (and facing rightwards) the soonest. Write code to systematically try different values of A, v1 and v2. This latter program is different than the controller that uses the best values.
Guidelines:
Submission: