SleipnirGroup / Choreo

A graphical tool for planning time-optimized trajectories for autonomous mobile robots in the FIRST Robotics Competition.
BSD 3-Clause "New" or "Revised" License
150 stars 46 forks source link

Added routine.trajectory() method #912

Open Daniel1464 opened 2 weeks ago

Daniel1464 commented 2 weeks ago

Currently, the way to construct AutoTrajectories is using the factory.trajectory method:

var trajectory = factory.trajectory("AmpToC1", routine);

This PR provides a better-named alternative:

var trajectory = routine.trajectory("AmpToC1");

Note: c++ and docs updates are still tbd.

calcmogul commented 2 weeks ago

Is adding a second way to do the same thing necessary? Can we remove the other one?

Daniel1464 commented 2 weeks ago

Is adding a second way to do the same thing necessary? Can we remove the other one?

Possibly; I didn't want to introduce a breaking change.

calcmogul commented 2 weeks ago

The API is new for 2025, so we can break whatever we want before kickoff.