allwpilib
allwpilib copied to clipboard
Rename HolonomicDriveController.calculate() arguments to be more descriptive
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
.
~~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
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);
Oh. I guess that makes the name change even more necessary than.