-
Notifications
You must be signed in to change notification settings - Fork 41
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
Change constant-speed gyro to dynamic-speed gyro. #124
Conversation
double sin_gyro_base_scale_{ 1. }; | ||
double sin_gyro_amplitude_{ 0. }; | ||
double sin_gyro_period_{ 1. }; | ||
double sin_gyro_phase_{ 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.
同一个功能的四个变量要放在一行里面写,不要分几行
vel_cmd_sender_->setAngularZVel(gyro_rotate_reduction_); | ||
vel_cmd_sender_->setAngularZVel( | ||
getDynamicScale(sin_gyro_base_scale_, sin_gyro_amplitude_, sin_gyro_period_, sin_gyro_phase_) * | ||
gyro_rotate_reduction_); |
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.
这里不需要改吧
else | ||
vel_cmd_sender_->setAngularZVel(1.0); | ||
vel_cmd_sender_->setAngularZVel( | ||
getDynamicScale(sin_gyro_base_scale_, sin_gyro_amplitude_, sin_gyro_period_, sin_gyro_phase_)); |
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.
这里不需要改吧
@@ -42,7 +47,22 @@ void ChassisGimbalShooterCoverManual::changeSpeedMode(SpeedMode speed_mode) | |||
speed_change_scale_ = normal_speed_scale_; | |||
} | |||
} | |||
|
|||
double ChassisGimbalShooterCoverManual::getDynamicScale(double base_scale, double amplitude, double period, double phase) |
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.
在函数里不会改变的变量,加上const。
@Rayy0527 记得改改看看 |
Add dynamic-speed gyro on standard.