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

Change constant-speed gyro to dynamic-speed gyro. #124

Merged
merged 5 commits into from
Dec 7, 2024

Conversation

Rayy0527
Copy link
Contributor

@Rayy0527 Rayy0527 commented Dec 1, 2024

Add dynamic-speed gyro on standard.

double sin_gyro_base_scale_{ 1. };
double sin_gyro_amplitude_{ 0. };
double sin_gyro_period_{ 1. };
double sin_gyro_phase_{ 0. };
Copy link
Contributor

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_);
Copy link
Contributor

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_));
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

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

在函数里不会改变的变量,加上const。

@YoujianWu
Copy link
Contributor

@Rayy0527 记得改改看看

include/rm_manual/chassis_gimbal_shooter_cover_manual.h Outdated Show resolved Hide resolved
src/chassis_gimbal_shooter_cover_manual.cpp Outdated Show resolved Hide resolved
src/chassis_gimbal_shooter_cover_manual.cpp Outdated Show resolved Hide resolved
@Rayy0527 Rayy0527 changed the title Dynamic-speed gyro Change constant-speed gyro to dynamic-speed gyro. Dec 7, 2024
@YoujianWu YoujianWu merged commit 9d4c7e8 into rm-controls:master Dec 7, 2024
3 checks passed
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.

2 participants