Skip to content

Choreo v2025.0.0-beta-3

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 12 Oct 06:44
· 191 commits to main since this release
6b63ad6

This is the last release that supports WPILib 2024.

Event Markers

Event markers have now been added.
image
GUI-wise, they function just like in 2024, except that the default command type is now "None", since these markers are also used for ChoreoLib timestamped triggers, and that the offset and wait time fields are time expressions.

Keep In Lane Constraint

A new Keep In Lane constraint has been added to replace the Straight Line constraint.
Before:
image
After:
image
With variable tolerance:
image
Across multiple waypoints:
image

This constraints the center of the robot to be within the two parallel lines for the entire scope of the constraint. Note that other keep-in constraints apply to the bumpers, unlike this one. Also note that the boundary lines actually extend to infinity, but are only drawn between the two waypoints.
image

Opening Previous Project

The behavior of re-opening a prior project has been re-added. Choreo betas have already been tracking the last-opened project, but for some users upgrading from 2024 versions directly to this beta, the app may try to open a 2024 project and fail.

ChoreoLib Changes

Renames

choreo.auto.AutoFactory.ChoreoAutoBindings -> choreo.auto.AutoFactory.AutoBindings
choreo.Choreo.ChoreoTrajectoryCache -> choreo.Choreo.TrajectoryCache

Breaking Changes

The AutoFactory constructor previously took a (Pose2d currentPose, Sample currentSample)->ChassisSpeeds and a separate (ChassisSpeeds speeds)->void. This is unnecessarily constraining. Now it just takes a (Pose2d currentPose, Sample currentSample)->void as a control function. The ChoreoControlFunction type alias for this parameter is also gone.

Control Function

Many have asked what to put for the control function. We intentionally don't provide a pre-made one because the function is more about plumbing than algorithms. Here is an example of a (swerve) control function that would be pasted into the drive subsystem.

public void choreoController(Pose2d curPose, SwerveSample sample) {
    ChassisSpeeds speeds = ChassisSpeeds.fromFieldRelativeSpeeds(
        new ChassisSpeeds(
            xController.calculate(curPose.getX(), sample.x) + sample.vx,
            yController.calculate(curPose.getY(), sample.y) + sample.vy,
            thetaController.calculate(curPose.getRotation().getRadians(), sample.heading) + sample.omega
        ), curPose.getRotation());
  this.driveRobotRelative(speeds);
}

While the basic controller is shown here, our approach allows teams to add logging, implement additional control influences like heading override, and even use the module forces and higher-derivative components of the sample as their drivetrain code permits. The latter is a main reason why the controller needs to encompass more than just outputting ChassisSpeeds.

Markers in ChoreoLib

There are two main ways to integrate the markers into ChoreoLib's autonomous utilities. For all ChoreoLib uses, the name of the marker is used to reference the event in bindings. The command type selected in the GUI is still a PathPlanner-only integration feature, and is not read by ChoreoLib.

image

Consider this event as an example.

The AutoBindings class specifies global command bindings. It is recommended to set up the bindings class entirely, before passing it into the AutoFactory.

new AutoFactory.AutoBindings()
    .bind("Marker", Commands.print("This message triggers on any marker with that name, in any trajectory."))

The other way to use markers is with AutoTrajectory, where they can be used to create triggers

  Command myAuto() {
    var loop = factory.newLoop("myAuto");
    AutoTrajectory trajectory = factory.trajectory("MyAutoTrajectory", loop);
    trajectory.atTime("Marker").onTrue(
      Commands.print("This message only prints during this specific trajectory, but for every marker of that name in the trajectory."));
    loop.enabled().onTrue(trajectory.cmd());
    return loop.cmd();
  }

What's Changed

  • [trajoptlib] Make GetIndex() usage consistent and fix GetIndex() by @bruingineer in #820
  • [choreolib] Remove Choreo suffix from remaining classes by @calcmogul in #822
  • [build] Fixup CMake presets a bit by @spacey-sooty in #827
  • [choreo] [trajoptlib] Use more robust time estimates for intervals and initial dt decision variable by @bruingineer in #821
  • [docs] Treat JavaDoc and Doxygen warnings as errors by @calcmogul in #819
  • [choreolib] Merge control function and outputChassisSpeeds by @spacey-sooty in #829
  • [choreolib] Remove unused return type from ControlFunction by @spacey-sooty in #831
  • [ci] Build TrajoptLib Rust in CI by @spacey-sooty in #832
  • [trajoptlib] Make constraints use current and next index by @calcmogul in #830
  • [trajoptlib] Fix order of trackwidth in FFI by @spacey-sooty in #834
  • [ci] Upgrade to wpiformat 2024.42 by @calcmogul in #837
  • [trajoptlib] Sort constraint types lexicographically by @calcmogul in #838
  • [trajoptlib] Fix Translation2d and Rotation2d equality operators by @calcmogul in #839
  • [trajoptlib] Use more compact differential drive model by @calcmogul in #833
  • [trajoptlib] Add lane constraint by @spacey-sooty in #836
  • Remove bad scope-fixing in heading conflict checks by @shueja in #842
  • Use std instead of core by @spacey-sooty in #843
  • [trajoptlib] Expose lane constraint to Rust by @spacey-sooty in #844
  • Sort C++ PathBuilder functions and remove PathBuilder Rust trait by @calcmogul in #846
  • [trajoptlib] fix inputModulus by @bruingineer in #847
  • [choreo] Add Lane Constraint to UI by @spacey-sooty in #845
  • Upgrade Cargo and pnpm dependencies by @calcmogul in #850
  • [choreolib] Remove Choreo prefix from typedef by @calcmogul in #851
  • [choreolib] Remove controller function typedef by @calcmogul in #852
  • [choreo] Event marker refactor by @shueja in #773
  • [choreolib] Add "struct:" prefix to struct serialization by @calcmogul in #857
  • Use marker name for triggers; change spec to prepare for timestamp-range markers. by @shueja in #856
  • Make sure trajectories have at least one split section by @shueja in #858
  • Apply max height to variables panel. by @shueja in #859
  • Add null tolerance when parsing commands in app. by @shueja in #861
  • Filter event markers with null timestamps or empty names by @shueja in #862
  • Re-enable opening of last project by @shueja in #863
  • Change version to 2025.0.0-beta-3 by @shueja in #860

Full Changelog: v2025.0.0-beta-2...v2025.0.0-beta-3