Skip to content

Conversation

@willtreaty21
Copy link
Collaborator

Swerve drive code integrated with joystick.

Copy link

@Ayidana-Aboraah Ayidana-Aboraah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly formatting changes and important configuration changes.

Comment on lines +30 to +31
steerencoder.configMagnetOffset(encoderoffset);
steerencoder.configAbsoluteSensorRange(AbsoluteSensorRange.Unsigned_0_to_360);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to configure statusFramePeriod and add timeouts. Sensor direction may also be a setting you want to configure.

swervemotor.getEncoder().setPosition(0);
}

public void rotateto(double rotation){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase should be used.

swervemotor.getEncoder().setPosition(Math.toRadians(steerencoder.getAbsolutePosition()));
}

public void move(double setSwerveMotorPosition, double drivemotorspeed){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

M should be captial

steerencoder.configAbsoluteSensorRange(AbsoluteSensorRange.Unsigned_0_to_360);
}

public void resetSteerPosition() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R should be capital

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants