Methods For Kinematic Analysis And Optimization Of Overactuated Serial And Parallel Structures