This commit is contained in:
Glz
2024-03-23 17:44:28 +08:00
7 changed files with 19 additions and 30 deletions

View File

@@ -2,3 +2,6 @@
#include "gl_headfile.h" #include "gl_headfile.h"
enum state_type_e state_type =0; enum state_type_e state_type =0;
float cricle_aim=0.2f;
float cross_aim=0.49f;
float common_aim=0.35f;

View File

@@ -21,8 +21,8 @@ enum state_type_e {
}; };
extern enum state_type_e state_type; extern enum state_type_e state_type;
extern float cricle_aim;
#define CROSS_AIM (0.49f) extern float cross_aim;
#define COMMON_AIM (0.35f) extern float common_aim;
#endif /* STATE_H_ */ #endif /* STATE_H_ */

View File

@@ -25,13 +25,13 @@ void tracking()
void aim_distance_select(void) void aim_distance_select(void)
{ {
if (cross_type != CROSS_NONE) { if (cross_type != CROSS_NONE) {
aim_distance = 0.49f; aim_distance = cricle_aim;
} else if (circle_type != CIRCLE_NONE) { } else if (circle_type != CIRCLE_NONE) {
aim_distance = 0.2f; aim_distance = cross_aim;
} else if (barrier_type != BARRIER_NONE) { } else if (barrier_type != BARRIER_NONE) {
aim_distance = 0.3f; aim_distance = 0.3f;
} else { } else {
aim_distance = COMMON_AIM; aim_distance = common_aim;
} }
} }

View File

@@ -2,21 +2,13 @@
#include "./page/page_ui_widget.h" #include "./page/page_ui_widget.h"
#include "./page/page.h" #include "./page/page.h"
#include "gl_tracking.h" #include "gl_tracking.h"
#include "gl_state.h"
#include "zf_common_headfile.h" #include "zf_common_headfile.h"
PARAM_INFO Param_Data[DATA_NUM]; PARAM_INFO Param_Data[DATA_NUM];
soft_iic_info_struct eeprom_param; soft_iic_info_struct eeprom_param;
TYPE_UNION iic_buffer[DATA_IN_FLASH_NUM]; TYPE_UNION iic_buffer[DATA_IN_FLASH_NUM];
TYPE_UNION tiny_frame_param[20]; TYPE_UNION tiny_frame_param[20];
uint32_t *addre[2]; uint32_t *addre[2];
float data0 = 1.0f;
float data1 = 1.05f;
float data2 = 10.0f;
float data3 = 100.0f;
float data4 = 4.0f;
float data5 = 66.0f;
float data6 = 13.130f;
float data7 = 10.0f;
float data8 = 0.0f;
/** /**
* @brief 参数初始化注册 * @brief 参数初始化注册
* *
@@ -24,15 +16,10 @@ float data8 = 0.0f;
void jj_param_eeprom_init(void) void jj_param_eeprom_init(void)
{ {
soft_iic_init(&eeprom_param, K24C02_DEV_ADDR, K24C02_SOFT_IIC_DELAY, K24C02_SCL_PIN, K24C02_SDA_PIN); // eeprom初始化 soft_iic_init(&eeprom_param, K24C02_DEV_ADDR, K24C02_SOFT_IIC_DELAY, K24C02_SCL_PIN, K24C02_SDA_PIN); // eeprom初始化
PARAM_REG(angle_Kp, &data0, EFLOAT, 1, "an_P:"); // 注冊 PARAM_REG(aim_cross, &cross_aim, EFLOAT, 1, "cros:"); // 注冊
PARAM_REG(angle_Ki, &data1, EFLOAT, 1, "an_I:"); // 注冊 PARAM_REG(aim_cricle, &cricle_aim, EFLOAT, 1, "cric:"); // 注冊
PARAM_REG(angle_Kd, &data2, EFLOAT, 1, "an_D:"); // 注冊 PARAM_REG(aim_common, &common_aim, EFLOAT, 1, "comm:"); // 注冊
PARAM_REG(imgax_Kp, &data3, EFLOAT, 1, "im_P:"); // 注冊
PARAM_REG(imgax_Ki, &data4, EFLOAT, 1, "im_I:"); // 注冊
PARAM_REG(imgax_Kd, &data5, EFLOAT, 1, "im_D:");
PARAM_REG(other , &data6, EFLOAT, 1, "add:");
PARAM_REG(delta_x , &pure_angle, EFLOAT, 2, "far:");
PARAM_REG(delta_y , &dx_near, EFLOAT, 0, "near:");
jj_param_read(); // 注冊 jj_param_read(); // 注冊
} }
/** /**

View File

@@ -18,10 +18,9 @@ typedef enum {
Page1_head=0, Page1_head=0,
angle_Kp=Page1_head, aim_common=Page1_head,
angle_Ki, aim_cross,
angle_Kd, aim_cricle,
other,
Page2_head, Page2_head,
// 第二页参数 // 第二页参数

View File

@@ -129,7 +129,7 @@ void Page_Init(void)
{ {
PAGE_REG(page_menu, "main"); PAGE_REG(page_menu, "main");
PAGE_REG(page_rtcam, "rtcam"); PAGE_REG(page_rtcam, "rtcam");
PAGE_REG(page_param1, "Param1"); PAGE_REG(page_param1, "aim_param");
PAGE_REG(page_param2, "param2"); PAGE_REG(page_param2, "param2");
PAGE_REG(page_dparam, "dparam"); PAGE_REG(page_dparam, "dparam");
PAGE_REG(page_reset, "reset"); PAGE_REG(page_reset, "reset");

View File

@@ -29,7 +29,7 @@ static void Setup()
if (Get_new_page() == page_param1) { if (Get_new_page() == page_param1) {
pafrist = 0; pafrist = 0;
paend = Page2_head; paend = Page2_head;
ips200_show_string(0, 0, "Param1"); ips200_show_string(0, 0, "aim_param");
} else if (Get_new_page() == page_param2) { } else if (Get_new_page() == page_param2) {
pafrist = Page2_head; pafrist = Page2_head;
paend = Page3_head; paend = Page3_head;