Shared control for assistive and collaborative robotics