Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swerve improvements #84

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Swerve improvements #84

wants to merge 4 commits into from

Conversation

deadlyvortex
Copy link
Contributor

No description provided.

@danielbrownmsm danielbrownmsm linked an issue Apr 8, 2023 that may be closed by this pull request
@danielbrownmsm
Copy link
Collaborator

#84

Comment on lines 247 to 266
if (left_front_speed > 1) {
right_front_speed = right_front_speed/left_front_speed;
left_back_speed = left_back_speed/left_front_speed;
right_back_speed = right_back_speed/left_front_speed;
}
if (left_back_speed > 1) {
left_front_speed = left_front_speed/left_back_speed;
right_front_speed = right_front_speed/left_back_speed;
right_back_speed = right_back_speed/left_back_speed;
}
if (right_front_speed > 1) {
left_front_speed = left_front_speed/right_front_speed;
left_back_speed = left_back_speed/right_front_speed;
right_back_speed = right_back_speed/right_front_speed;
}
if (right_back_speed > 1) {
left_front_speed = left_front_speed/right_back_speed;
left_back_speed = left_back_speed/right_back_speed;
right_front_speed= right_front_speed/right_back_speed;
}

Choose a reason for hiding this comment

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

Need to use abs() as the speeds can be negative

Comment on lines +287 to +294
if (abs(drive_) > 0.05 || abs(strafe_) > 0.03 || abs(turn_) > 0.2) {
OKC_CALL(this->left_front_module_->SetAngle(left_front_turn));
OKC_CALL(this->left_back_module_->SetAngle(left_back_turn));
OKC_CALL(this->right_front_module_->SetAngle(right_front_turn));
OKC_CALL(this->right_back_module_->SetAngle(right_back_turn));
}

if (abs(drive_) < 0.05 && abs(strafe_) < 0.05 && abs(turn_) < 0.3) {
if (abs(drive_) < 0.05 && abs(strafe_) < 0.03 && abs(turn_) < 0.2) {

Choose a reason for hiding this comment

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

Parameterize these

Comment on lines 310 to 316
if (abs(drive_) < 0.05 && abs(strafe_) < 0.03 && abs(turn_) > 0.2) {
this->interface_->left_front_drive_motor_output = turn_ * 2;
this->interface_->left_back_drive_motor_output= turn_ * 2;
this->interface_->right_front_drive_motor_output = turn_ * 2;
this->interface_->right_back_drive_motor_output = turn_ * 2;

}

Choose a reason for hiding this comment

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

Parameterize these and add a comment about what this check is for

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.

Swerve Drive Improvements
3 participants