Motion planning for hybrid dynamical systems: Framework, algorithm template, and a sampling-based approach