Updated the example to support gamepads and to show a trajectory