-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Feat!!!]: add the whole hero code #64
Conversation
Able to rotate from -90 (deg) to +70 (deg)
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.
weak
is misspelled as week
, since this changeset is very large it should just be fixed here instead of in some refactor.
// pitch data from keyboard | ||
if (dbus->keyboard.bit.E) pitch_keyboard -= PI; // offset need test | ||
if (dbus->keyboard.bit.Q) pitch_keyboard += PI; // offset need test | ||
if (-0.55 * PI <= pitch_keyboard && pitch_keyboard <= 0.55 * PI) pitch_keyboard = 0; | ||
if (pitch_keyboard > 0) | ||
pitch_keyboard -= 0.85 * PI; | ||
if (pitch_keyboard < 0) | ||
pitch_keyboard += 0.85 * PI; | ||
pitch_keyboard = clip<float>(pitch_keyboard, -30 * PI, 30 * PI); |
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.
Instead of using all the if conditions. What if we just increase pitch_keyboard 1.5pi when Q is pressed, and decrease 1.5 pi when E is pressed?
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.
In this situation, pitch_keyboard is like a discrete angular velocity, rather than angle. Therefore, we want this velocity decrease to 0 when we do not press the keyboard.
control::Motor4310::TransmitOutput(motor_can1_gimbal, 1); | ||
} else { | ||
chassis->SetSpeed(0, 0, 0); | ||
} |
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.
Not sure what elevation does, better explain more and the numbers in it with comments
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.
elevation is for the gimbal. when elevation, the mouse is used to control the shooter rather than chassis.
// 5. reload motor release to the original position to prepare for the next load | ||
|
||
// Load Detector | ||
LoadDetect.input(dbus->swr == remote::UP || dbus->mouse.l); |
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.
why called "LoadDetect" should it not be "Trigger detect“?
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.
just detect the load signal.
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.
lgtm
Implement the whole hero code.