-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
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; | ||
} |
There was a problem hiding this comment.
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
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameterize these
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; | ||
|
||
} |
There was a problem hiding this comment.
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
No description provided.