Search-based task and motion planning for hybrid systems