RussTedrake / underactuated

The course text for MIT 6.832 (and 6.832x on edX)
Other
753 stars 215 forks source link

Error in running UAV GCS AdvanceTo() visualization #568

Open verityw opened 3 weeks ago

verityw commented 3 weeks ago

I duplicated the UAV GCS DeepNote notebook and tried running it. While the solver does find a reasonable looking trajectory for the generated layout (when visualized by plotting), it seems like actually running the simulator errors out when AdvanceTo() is called:

IndexError                                Traceback (most recent call last)
Cell In [11], line 1
----> 1 uav_env.animate_trajectory(
      2     meshcat,
      3     [baseline_traj], # , shortest_path_traj],
      4     fly_in_sequence=False,
      5 )

File /usr/local/lib/python3.10/dist-packages/underactuated/uav_environment.py:1916, in UavEnvironment.animate_trajectory(self, meshcat, trajectories, fly_in_sequence, quadrotor_seperation)
   1914 if trajectories:
   1915     meshcat.StartRecording()
-> 1916     simulator.AdvanceTo(total_animation_duration)
   1917     meshcat.PublishRecording()
   1918 else:

IndexError: _Map_base::at

In particular, it seems like this happens when the UAV is about to enter the house -- see attached image from the default provided seed of 8.

image

I've found that this occurs in other seeds as well, and suspect it's due to collisions or something -- for seed 9, it looks like it crashes right as the drone's about to clip the side of the house: image For reference, here's the full generated trajectory plotted in 2D: image This looks correct, based on inspecting the rendered crashed environment's visualization of the random household (though I guess I don't know where the goal location for the UAV is in the household, since unlike the original gcs-science-robotics version, it doesn't have a cube marking the goal?)

Both the above examples are from just visualizing the baseline trajectory, not the shortest path one. I haven't changed anything in any of the cells, except to comment out the shortest path stuff and to only animate the baseline (though running the unaltered notebook similarly crashes at this point):

uav_env.animate_trajectory(
    meshcat,
    [baseline_traj], # , shortest_path_traj],
    fly_in_sequence=False,
)

I've also tried the Docker installation of the older gcs-science-robotics repo, and that seems to work.