Shared vehicle control using safe driving envelopes for obstacle avoidance and stability