The target follows the mouse while it's down, and the robot arm tries to reach it.
This uses inverse kinematics to find the angles for the pivot and joint of the arm that will make it reach the target.