Lab 9: Inverse Kinematics
Lead TAs: Joey Gannon, Seunghwan Hong, Jason Winters

# Introduction:

The "flip side" of Lab 8. This is more often the required approachwhen dealing with robot arm or snake motion planning. You do inverse kinematicswhen you can describe the location of a point in Cartesian (or polar) coordinates,and want to drive your robot to get there.

The purpose of this lab is to combine your knowledge of inverse kinematics and motion planning

P. J. McKerrow, Introduction to Robotics, pp201--207.

# Challenge Statement:

In this lab you will use the two-link manipulator you built in Lab 8 to navigate through a given world with an obstacle.

The total size of the world is 14" x 8" and is subdivided into .5"x.5" squares. A tall, rectangular and very real obstacle with dimentions 4"x2.5" will be placed inside the world. The corners of the obstacle will be at coordinates (-2,5.5), (2, 5.5), (-2,8), (2, 8). The shoulder of the first link of your robotic arm will coincide with the origin in the X,Y plane

We are giving you a work space and you are to create a configuration space. The origin (0,0) of the work space is the location of the base point of the two-link robot.

You will create a configuration space for your two link manipulator, i.e., create a Theta1, Theta2 coordinate space. The reference configuration for the two-link manipulator is along the horizontal axis, as it has been in class and Lab 8. So,the origin of the configuration space is corresponds to Theta1 and Theta2 both being zero. When the robot has a (0,0) configuration, its end-effector is located at (6.25,0) in the workspace. Please be careful not to confuse work space and configuration space.

As in Lab 8, the values of Theta1 should vary between 0 and 180 degress, and Theta2 between -90 and 90 degrees. You need to determine the configuration space and are welcome to do this by hand and hard code it into the source code Feel freeto discretize the configuration space by 10 degree increments, so each pixel corresponds to "10 by 10 degrees."

You will then be given a start and end position for the end effector of your robot in the work space, i.e, (x,y) coordinate world. Starting from the reference configuration of Theta1 = Theta2 = 0, you will use inverse kinematics to determine the start configuration (from the start end-effector location) and then perform path planning from the reference configuration to the start configuration.

Next, you will use inverse kinematics again to determine the goal configuration (from the goal end-effector location) and use path planning to move from the start to the goal configuration.

Please feel free to use any path planner you want, but we suggest using the wavefront planner. If you use a different planner, please email Howie ASAP to make sure that the planner fits in the spirit of the problem.

Note: the middle joint of your arm does not have to remain within the world at all times. Only the obstacle in the middle is inviolate; nothing you build can intrude upon that space.

# More Details:

Step 1:
Use the same arm from Lab 8 to demonstrate inverse kinematics.

Step 2:
Determine your robots configuration space

Step 3:
Write a function that takes a start point in the X,Y coordinate world and a end point in the X,Y coordinate world. Uses inverse kinematics to derive the angle values of thelinks for the start (S) and end (E) points.

Step 4:
Find the closest point, S', in your configuration space to the actual start point, S. Find the closest point, E', in your configuration space to the actual end point, E.

Step 5:
Use wavefront algorithm to determine a path from the reference configuration to S', use a simple interpolation to move to S, and stopPut a mark down at the start point

Step 6:
Move back to S' via a simple interpolation

Step 7:
Move from S' to E', and finally use a simple interpolation to get to E.Place a mark at the end point.

Hint: Minimizing the amount of times the arm stops or changes direction helps reduce accumulated error

IC Bugs: (Check this)

1) 1.0 ^ x gives an error

2) 0.0 ^ x gives an error

3) (negative number) ^ (odd power) gives a positive number.

# Evaluation:

Hand in a copy of your configuration space. On that copy draw the path your robot would take if your start point was S = (5,3) and your end point was E = (-4,4)

Gets to the start point? Follows the wavefront path around obstacle? Reaches end point?

You will have 15 minutes to deploy and demo your robot. You will, however, be limited to three tries maximum. Your scoring is best of any of those three.