Advanced robotics redundancy and optimization