energy changed

This commit is contained in:
sun
2019-08-04 01:24:39 +08:00
parent af85869f48
commit 851c716153
4 changed files with 7 additions and 7 deletions

View File

@@ -80,6 +80,7 @@ private:
float guess_polar_angle;//猜测的下一个目标装甲板极坐标角度
float last_base_angle;//上一帧的各扇叶在0区0°~72°的基础角度
float predict_rad;//预测提前角
float predict_rad_norm;//预测提前角的绝对值
float attack_distance;//步兵与风车平面距离
float center_delta_yaw, center_delta_pitch;//对心时相差的角度
float yaw_rotation, pitch_rotation;//云台yaw轴和pitch轴应该转到的角度

View File

@@ -46,6 +46,7 @@ void Energy::initEnergy() {
guess_polar_angle = -1000;
last_base_angle = -1000;
predict_rad = 25;
predict_rad_norm = 25;
attack_distance = ATTACK_DISTANCE;
center_delta_yaw = 1000;
center_delta_pitch = 1000;

View File

@@ -16,11 +16,9 @@ using std::vector;
// ---------------------------------------------------------------------------------------------------------------------
void Energy::getPredictPoint(cv::Point target_point) {
if (is_big) {
if (energy_rotation_direction == 1) rotate(target_point);
if (energy_rotation_direction == -1) {
predict_rad = -25;
rotate(target_point);
}
if (energy_rotation_direction == 1) predict_rad = predict_rad_norm;
else if (energy_rotation_direction == -1) predict_rad = -predict_rad_norm;
rotate(target_point);
} else if (is_small) predict_point = target_point;
}

View File

@@ -66,8 +66,8 @@ int main(int argc, char *argv[]) {
video_gimbal = new CameraWrapper(ARMOR_CAMERA_GAIN, 2/*, "armor"*/);
video_chassis = new CameraWrapper(ENERGY_CAMERA_GAIN, 2/*, "energy"*/);
} else {
video_gimbal = new VideoWrapper("/home/sun/项目/energy_video/new/5.avi");
video_chassis = new VideoWrapper("/home/sun/项目/energy_video/new/5.avi");
video_gimbal = new VideoWrapper("/home/sun/项目/energy_video/new/18.avi");
video_chassis = new VideoWrapper("/home/sun/项目/energy_video/new/18.avi");
}
if (video_gimbal->init()) {
LOGM("video_gimbal source initialization successfully.");