Robotic in-hand manipulation with relaxed optimization