allwpilib icon indicating copy to clipboard operation
allwpilib copied to clipboard

Rename HolonomicDriveController.calculate() arguments to be more descriptive

Open calcmogul opened this issue 2 years ago • 3 comments

It's currently ambiguous which pose should be used for what. poseRef is the trajectory pose. The heading is used to determine the velocity vector of the trajectory. angleRef is the desired chassis heading (the trajectory spline heading and chassis heading can be different for holonomic drivetrains). Perhaps poseRef should be renamed to trajectoryPose.

calcmogul avatar Apr 08 '22 00:04 calcmogul

~~If these were changed also changing the names in the RamseteController would be a good idea to keep it somewhat consistent~~ Nope see the comments below

ohowe1 avatar Apr 08 '22 18:04 ohowe1

They don't control the same thing though. With RamseteController, poseRef is actually a pose reference. The docs also say the following:

  /**
   * Returns the next output of the Ramsete controller.
   *
   * The reference pose, linear velocity, and angular velocity should come from
   * a drivetrain trajectory.
   *
   * @param currentPose        The current pose.
   * @param poseRef            The desired pose.
   * @param linearVelocityRef  The desired linear velocity.
   * @param angularVelocityRef The desired angular velocity.
   */
  ChassisSpeeds Calculate(const Pose2d& currentPose, const Pose2d& poseRef,
                          units::meters_per_second_t linearVelocityRef,
                          units::radians_per_second_t angularVelocityRef);

calcmogul avatar Apr 08 '22 18:04 calcmogul

Oh. I guess that makes the name change even more necessary than.

ohowe1 avatar Apr 08 '22 18:04 ohowe1