RobotLocomotion / drake

Model-based design and verification for robotics.
https://drake.mit.edu
Other
3.17k stars 1.24k forks source link

Fix Segmentation Fault in GcsTrajectoryOptimization::AddRegions #21658

Closed cohnt closed 2 days ago

cohnt commented 2 days ago

If the user manually specifies the edges between regions and provides an index which is out-of-range, GcsTrajectoryOptimization segfaults. This PR adds a test that reveals the problem, and switches to indexing with .at(...) to prevent the segmentation fault.


This change is Reviewable