energy changed

This commit is contained in:
sun
2019-08-05 17:27:49 +08:00
parent 7337f10123
commit e1fc19fdbf
4 changed files with 77 additions and 73 deletions

View File

@@ -82,7 +82,8 @@ void Energy::initEnergy() {
void Energy::initEnergyPartParam() {
// gimbal_energy_part_param_.GRAY_THRESH = 120;//home
// gimbal_energy_part_param_.GRAY_THRESH = 200;//official
gimbal_energy_part_param_.GRAY_THRESH = 180;//game
// gimbal_energy_part_param_.GRAY_THRESH =180;//single game
gimbal_energy_part_param_.GRAY_THRESH =100;//game
gimbal_energy_part_param_.SPLIT_GRAY_THRESH = 180;
gimbal_energy_part_param_.FAN_GRAY_THRESH = 75;
gimbal_energy_part_param_.ARMOR_GRAY_THRESH = 80;

View File

@@ -107,6 +107,8 @@ void Energy::runBig(cv::Mat &gimbal_src) {
getPredictPoint(target_point);
getAimPoint(predict_point);
judgeShootInGimbal();
// cout << "yaw: " << yaw_rotation << '\t' << "pitch: " << pitch_rotation << '\t' << "shoot: " << shoot << endl;
// waitKey(0);
sendEnergy();
}

View File

@@ -25,6 +25,7 @@ void Energy::sendEnergy() {
yaw_rotation = BIG_YAW_AIM_KP * yaw_rotation + BIG_YAW_AIM_KI * sum_yaw + BIG_YAW_AIM_KD * (yaw_rotation - last_yaw);
pitch_rotation = BIG_PITCH_AIM_KP * pitch_rotation + BIG_PITCH_AIM_KI * sum_pitch +
BIG_PITCH_AIM_KD * (pitch_rotation - last_pitch);
MINMAX(yaw_rotation, -10, 10);
last_yaw = tmp_yaw;
last_pitch = tmp_pitch;
} else if (is_chassis) {