lol
January 26, 2024, 11:06pm
1
Video of the effect:
https://streamable.com/f45r6h
We’re switching from a custom swerve to YAGSL and are having the issue shown above. We’re using MK4i swerve with NEOs and cancoders.
No idea why they only jitter when not in use. I thought it was maybe PID at first but the modules behave just fine when receiving input.
nstrike
January 26, 2024, 11:10pm
2
Can you link to your code? The default control (for the example) of the right stick is to control robot heading wherever that is. The wheels don’t stop until the heading is achieved.
lol
January 26, 2024, 11:30pm
3
I set headingCorrection to false. Doing that should disable that behavior, right?
nstrike
January 26, 2024, 11:34pm
4
No, you have to use the other command from the example that specifies angular velocity control.
lol
January 26, 2024, 11:51pm
5
So, just to clarify, calling SwerveDriveInstance.drive with only a chassis speeds as a parameter would still do the heading thing?
1 Like
nstrike
January 26, 2024, 11:54pm
6
Which one? Some yes, some no, some both. I provided a very wide array of use cases all documented here.
1 Like
lol
January 26, 2024, 11:57pm
7
Only a ChassisSpeeds, so it should be this one
nstrike
January 27, 2024, 12:03am
8
Depends on how you got the chassisspeeds, if you use this then yes.
/**
* Command to drive the robot using translative values and heading as a setpoint.
*
* @param translationX Translation in the X direction. Cubed for smoother controls.
* @param translationY Translation in the Y direction. Cubed for smoother controls.
* @param headingX Heading X to calculate angle of the joystick.
* @param headingY Heading Y to calculate angle of the joystick.
* @return Drive command.
*/
public Command driveCommand(DoubleSupplier translationX, DoubleSupplier translationY, DoubleSupplier headingX,
DoubleSupplier headingY)
{
// swerveDrive.setHeadingCorrection(true); // Normally you would want heading correction for this kind of control.
return run(() -> {
double xInput = Math.pow(translationX.getAsDouble(), 3); // Smooth controll out
double yInput = Math.pow(translationY.getAsDouble(), 3); // Smooth controll out
// Make the robot move
driveFieldOriented(swerveDrive.swerveController.getTargetSpeeds(xInput, yInput,
headingX.getAsDouble(),
headingY.getAsDouble(),
This file has been truncated. show original
lol
January 27, 2024, 1:11am
9
I just get em right from the controller