Starting from:

$40

CS8803-Polygon Robot Solved

. Instead of always moving in an approximate circle, the robot can now move in the shape of arbitrary convex polygons.  This has been implemented by adding one additional robot parameter (line_length) which specifies the number of straight forward movements (each of target_speed) to make on a single line segment before turning.  Note that the robot sends back a location measurement after each move, even if it did not turn as part of that move.  The second change is every set interval (set by parameter) the robot moves stochastically.  Some random uniform value between 0.0 and 1.0 is used to determine the scale amount of the move and independently a scale amount of the turn angle.  While this is still solvable with a good Kalman filter, you may find that a particle filter is more robust to this type of non linear movement noise.

When using the robot class defined in the robot.py file, your code MUST call  move_in_polygon instead of move_in_circle. Note that this file has been updated from that used in the mini project!

Of note is that when line_length is set to one (1) the Polygon Robot acts like the Runaway Robot.  However, if the line_length parameter is set to a number larger than 1, (especially if the target_period parameter is small)  the robot’s motion will more closely approximate a polygon than a circle.  Below are two examples of robot motion with (period=3, line_length=2) and (period=8, line_length=5).  Note that while the robot motion is noise free, the reported locations (measurements) may include Gaussian noise in parts 2, 3, & 4.



You must submit your code to Canvas for grading using the Assignments tool.

We will run your code against 10 test cases per part to grade your work. Each test case is worth 2.5 points, so there is a maximum of 100 points.  We will run your code once per test case; passing a test case is worth 2.5 point, and failing a test case is worth 0 points.

The parameter ranges for the test cases are slightly different from the Runaway Robot mini-project, and the will satisfy the following constraints:

•       -20.0 <= target_starting_position_x <= 20.0

•       -20.0  <=target_starting_position_y <= 20.0

•       -math.pi <= target_starting_heading <=  math.pi

•       3 <= abs( target_period )  <=  12

•       1.0  <= target_speed <=  5.0

•       1 <= line_length <= 16

•       -20.0 <= hunter_starting_position_x  <= 20.0

•       - 20.0 <= hunter_starting_position_y  <= 20.0

•       -math.pi <= hunter_starting_heading  <=    math.pi • random_move = 20

target_period will be an integer. It represents the number of turns required for the robot to make one complete cycle [e.g. the number of sides of the polygon]. line_length is also an integer, representing the number of segments that make up each “straight” line. A positive value for target_period means that the robot will move counterclockwise; a negative value means the robot will move clockwise.

The standard deviation of the Gaussian applied to the target's measurements will be 0 in Part 1, and 0.05 times the target's speed in Parts 2–4.

The hunter bot (present in parts 3 & 4 only) will have a max speed twice that of the target in Part 3 and 0.99 that of the target in Part 4.

The random move value will be locked to 20 for this semesters assignment.

The requirements for passing a test case are:

•       Part 1: Identifies the position of the target within a distance of  0.02*target_speed using at most 10 calls to  estimate_next_pos

•       Part 2: Identifies the position of the target within a distance of 0.02*target_speed using at most 1000 calls to estimate_next_pos

•       Parts 3 & 4: Put the hunter within a distance of  0.02*target_speed of the target using at most 1000 calls to next_move

All Parts: The code takes a maximum of 5 seconds per test case

More products