修改了一点参数

This commit is contained in:
2025-12-05 13:27:42 +08:00
parent b4c795f77d
commit 93935889e0

View File

@@ -6,7 +6,7 @@
#include <thread>
#include <memory>
#include <unistd.h>
#include <math.h>
#include <opencv2/opencv.hpp>
#include <opencv2/tracking.hpp>
@@ -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<int>(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<int>(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<int>(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<int>(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