This assignment explores using function optimization to do inverse kinematics.
We are expecting you to use Matlab.
Part 1: You will write a Matlab subroutine that chooses joint angles for a version of the Atlas robot that
Part 2: In Matlab's fmincon, one can use several algorithms: interior-point (default), trust-region-reflective (needs objective function gradient and only one type of equality constraint), sqp, and active-set. See the fmincon documentation to see how to set the options variable using optimoptions().
We would also like you to try CMA-ES. Matlab implementations are available at here.
How does performance change when using the interior-point, sqp, active-set and CMA-ES algorithms, in terms of answer quality and run time?
Part 3: For many positions, there are multiple local minimum. Given a position and orientation target, can you find multiple distinct local minima, and provide the user with a choice of local minima?
BONUS: Use automatic differentiation to find the derivatives of the criterion and the constraints, and then use the derivatives in the optimization. Does it improve performance? Faster optimization? Better answers? See this documentation for fmincon for how the criterion and constraint functions can return a value, a gradient, and possibly a Hessian in the Input Arguments section. Google "matlab automatic differentiation" for automatic differentiation tools. You can also do it manually (It's not that hard for forward kinematics).
Matlab code we provide: Everything as a zip file. The geometry of the robot is listed in drc4.m along with other useful stuff. A forward kinematics routine is provided: drc_forward_kinematics.m. There is a very simple drawing program draw.m that might help you debug. It draws a robot stick figure with the current angles, given drc_forward_kinematics() has been called. The notes.txt file is notes on how to use the code. generate_axis_angle_rotation_matrix.m and q_to_R.m are programs to generate rotation matrices from other orientation representations.
Here is a Matlab script from Seungmoon Song that draws the ATLAS robot. You can run the "test.m" file in the "anim" folder. Unfortunately, this needs to be debugged with the current model, and the meshes do not match the current robot, especially for the head location.