Skip to content

Feat/field oriented drive#57

Merged
danielbrownmsm merged 11 commits intomasterfrom
feat/field-oriented-drive
Mar 23, 2023
Merged

Feat/field oriented drive#57
danielbrownmsm merged 11 commits intomasterfrom
feat/field-oriented-drive

Conversation

@danielbrownmsm
Copy link
Collaborator

Makes the teleop swerve drive code be field-oriented for a better driving experience. First driver has tested it and says it is a definite improvement. I've tested it and it works, although we haven't taken any hits yet. Could use some tuning

@danielbrownmsm danielbrownmsm linked an issue Mar 20, 2023 that may be closed by this pull request
@danielbrownmsm danielbrownmsm requested a review from jkleiber March 20, 2023 01:17
@danielbrownmsm
Copy link
Collaborator Author

Also note we fixed the cosine error limit thing (although I'm not really sure how well it works) and temporarily disabled inverting the wheels whenever error >100 degrees for testing, need to add that back in

Copy link
Contributor

@jkleiber jkleiber left a comment

Choose a reason for hiding this comment

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

comments about deadbands

Comment on lines 153 to 156
// if strafe is very small
if (abs(final_strafe) < 0.15) {
final_strafe = 0.0; // then zero it
if (abs(strafe) < 0.15) {
strafe_ = 0.0; // then zero it
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we have a similar deadband for drive power?

Copy link
Contributor

Choose a reason for hiding this comment

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

Consider this link as well for an "outer deadband" (also linked in that swerve doc): http://blog.hypersect.com/interpreting-analog-sticks/

Comment on lines +192 to +195
OKC_CALL(TeamOKC::WrapAngle(&left_front_turn));
OKC_CALL(TeamOKC::WrapAngle(&left_back_turn));
OKC_CALL(TeamOKC::WrapAngle(&right_front_turn));
OKC_CALL(TeamOKC::WrapAngle(&right_back_turn));
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we duplicating the lines above this?

Copy link
Contributor

@jkleiber jkleiber left a comment

Choose a reason for hiding this comment

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

approved

@danielbrownmsm danielbrownmsm merged commit bcfca5c into master Mar 23, 2023
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.

Field Oriented Drive

2 participants