diff --git a/src/MindVisionMain.cpp b/src/MindVisionMain.cpp index 1fc7036..b62128b 100644 --- a/src/MindVisionMain.cpp +++ b/src/MindVisionMain.cpp @@ -6,7 +6,7 @@ #include #include #include - +#include #include #include @@ -30,13 +30,13 @@ void output_control_data(const cv::Point2f* ballistic_point, std::ostringstream send_str; // Calculate offset (based on actual image center) - int ballistic_offset_x = -static_cast(ballistic_point->x - img_center.x); - if ( abs(ballistic_offset_x) > 320){ - ballistic_offset_x = ( ballistic_offset_x / abs( ballistic_offset_x ) ) * 320 ; + int ballistic_offset_yaw = 1.9*-static_cast(ballistic_point->x - img_center.x); + if ( abs(ballistic_offset_yaw) > 320){ + ballistic_offset_yaw = ( ballistic_offset_yaw / abs( ballistic_offset_yaw ) ) * 220 ; } - int ballistic_offset_y = -static_cast(img_center.y - ballistic_point->y); - if ( abs(ballistic_offset_y) > 180 ) { - ballistic_offset_y = ( ballistic_offset_x / abs( ballistic_offset_x ) ) * 180 ; + int ballistic_offset_pitch = 1.9*-static_cast(img_center.y - ballistic_point->y); + if ( abs(ballistic_offset_pitch) > 180 ) { + ballistic_offset_pitch = ( ballistic_offset_pitch / abs( ballistic_offset_pitch ) ) * 180*1.9 ; } // Color simplification mapping