Follow-up from #30.
Background
Choreo event markers, drawn in the GUI, fire named events along a trajectory. ChoreoLib connects commands to them in two ways:
AutoFactory.bind(name, command), where one binding covers every trajectory, and
- per-trajectory triggers:
atTime("name"), atPose("name", …), atTranslation("name", …).
We deferred this until mechanisms exist. For now the only placeholder autos are drive-out and branching examples.
Things to know before starting
- Order matters for
bind(). It applies only to trajectories created after it is called (AutoFactory.bind javadoc, v2027.0.0-alpha-3). In our pattern, each AutoMode builds its own AutoFactory, and subclasses load trajectories in their constructors. So the bindings have to be made in the AutoMode base constructor, before trajectory(ChoreoTraj) is called. Otherwise they silently do nothing.
- Event names are typed as strings. Choreo's code generation covers trajectory names (
ChoreoTraj) but not event names. A misspelled marker or binding fails silently.
- A guard already exists.
ChoreoProjectTest.trajectoriesHaveNoEventMarkers currently fails if any .traj has events. It is there to force this decision.
Tasks
Done when
- A marker drawn in Choreo runs its command in sim.
- A misspelled marker or binding fails the guard test loudly.
Follow-up from #30.
Background
Choreo event markers, drawn in the GUI, fire named events along a trajectory. ChoreoLib connects commands to them in two ways:
AutoFactory.bind(name, command), where one binding covers every trajectory, andatTime("name"),atPose("name", …),atTranslation("name", …).We deferred this until mechanisms exist. For now the only placeholder autos are drive-out and branching examples.
Things to know before starting
bind(). It applies only to trajectories created after it is called (AutoFactory.bindjavadoc, v2027.0.0-alpha-3). In our pattern, eachAutoModebuilds its ownAutoFactory, and subclasses load trajectories in their constructors. So the bindings have to be made in theAutoModebase constructor, beforetrajectory(ChoreoTraj)is called. Otherwise they silently do nothing.ChoreoTraj) but not event names. A misspelled marker or binding fails silently.ChoreoProjectTest.trajectoriesHaveNoEventMarkerscurrently fails if any.trajhas events. It is there to force this decision.Tasks
AutoModebase constructor. Build it on Rebuilt's structure, not a new framework.trajectoriesHaveNoEventMarkerswith a two-way check:.trajfile has a binding, andDone when