Initial commit from DCSP - 2026/1/15 15:11:58
This commit is contained in:
163
sensor/include/sensor_tx2.h
Normal file
163
sensor/include/sensor_tx2.h
Normal file
@@ -0,0 +1,163 @@
|
||||
#ifndef _SENSOR_TX2_H_
|
||||
#define _SENSOR_TX2_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
|
||||
#define VISION_Info_Length 164+6 //164字节数据+5字节头+1字节校验
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
uint16_t ext;
|
||||
struct
|
||||
{
|
||||
uint8_t VISION_state1_data7 : 3; //输出单帧图像中点的检测数量,范围[0~5]。
|
||||
uint8_t VISION_state1_data6 : 3; //预留
|
||||
uint8_t VISION_state1_data5 : 2; //00:第一个簇是目标;
|
||||
//01:第一个簇识别错误;
|
||||
//10:第一个簇识别错误;
|
||||
//11:第一个簇是恒星
|
||||
uint8_t VISION_state1_data4 : 2; //00:第二个簇是目标;
|
||||
//01:第二个簇识别错误;
|
||||
//10:第二个簇识别错误;
|
||||
//11:第二个簇是恒星
|
||||
uint8_t VISION_state1_data3 : 2; //00:第三个簇是目标;
|
||||
//01:第三个簇识别错误;
|
||||
//10:第三个簇识别错误;
|
||||
//11:第三个簇是恒星
|
||||
uint8_t VISION_state1_data2 : 2; //00:第四个簇是目标;
|
||||
//01:第四个簇识别错误;
|
||||
//10:第四个簇识别错误;
|
||||
//11:第四个簇是恒星
|
||||
uint8_t VISION_state1_data1 : 2; //00:第五个簇是目标;
|
||||
//01:第五个簇识别错误;
|
||||
//10:第五个簇识别错误;
|
||||
//11:第五个簇是恒星
|
||||
};
|
||||
} Star_Removal_Brightness_Rec_State;
|
||||
|
||||
|
||||
typedef union
|
||||
{
|
||||
uint8_t ext;
|
||||
struct
|
||||
{
|
||||
uint8_t Flag0 : 4; //远距标志
|
||||
uint8_t Flag1 : 4; //近距标志
|
||||
};
|
||||
}TX2_Image_Flag;
|
||||
|
||||
|
||||
typedef struct __attribute__((__packed__))
|
||||
{
|
||||
uint8_t recog_Valid; //识别结果,0b00:数据无效; 0b11:数据有效
|
||||
float recog_Alpha ; //计算俯仰角α1
|
||||
float recog_Beta ; //计算俯仰角α1
|
||||
}RecResult;
|
||||
|
||||
typedef struct __attribute__((__packed__))
|
||||
{
|
||||
uint16_t FRAME_HEAD; //帧头 0xEB90
|
||||
uint8_t Type_Code; //类型码 0xF0
|
||||
uint16_t Code_Length; //帧长度
|
||||
uint16_t FRAME_RESERVE1; //预留-1 0x8AA1
|
||||
uint8_t star_Q_flag;
|
||||
uint8_t Image_flag;
|
||||
uint8_t Telemetry_Counter; //遥测帧计数器
|
||||
Star_Removal_Brightness_Rec_State SRBRS_State_data; //远距恒星剔除和亮度识别算法检测情况
|
||||
|
||||
float TARGET_Horizontal; //图像中目标点的横向坐标
|
||||
float TARGET_Vertical ; //图像中目标点的横向坐标
|
||||
float TARGET_Brightness ; //图像中目标点的亮度信息
|
||||
uint8_t Target_Capture_Flag; //目标稳定捕获标志(0b01:已稳定捕获,进入跟踪阶段;0b00:未稳定捕获)
|
||||
uint8_t Image_Number; //目标识别阶段已识别到目标的图像数量
|
||||
float frame_noise_ratio ; //图像的信噪比
|
||||
float frame_contrast; //图像对比度
|
||||
uint8_t Area_Number_far; //远距相机检测到的区域数量
|
||||
uint8_t Area_Number_close; //近距相机检测到的区域数量
|
||||
uint8_t far_Core_Size_far; //远距相机存储开运算核的尺寸
|
||||
uint8_t far_Core_Size_close; //近距相机存储开运算核的尺寸
|
||||
uint8_t Area_Brightness_far; //远距相机图像平均亮度
|
||||
uint8_t Area_Brightness_close; //近距相机图像平均亮度
|
||||
uint8_t Target_Edge_Integrity_Flag_far; //远距相机完整性标志;0b00:完整;0b11:不完整
|
||||
uint8_t Target_Edge_Integrity_Flag_close; //近距相机完整性标志;0b00:完整;0b11:不完整
|
||||
|
||||
uint8_t Missed_Number; //跟踪目标脱靶次数
|
||||
uint8_t line_of_sight_flag_far; //远距相机视线距可靠标志位;0b00:不可靠;0b11:可靠
|
||||
uint8_t line_of_sight_flag_close; //近距相机视线距可靠标志位;0b00:不可靠;0b11:可靠
|
||||
|
||||
float Line_Distance_far; //远距相机视线距离
|
||||
float Line_Distance_close; //近距相机视线距离
|
||||
uint32_t Image_time_sec; //照片时间戳整秒
|
||||
uint16_t Image_time_ms; //照片时间戳毫秒
|
||||
|
||||
RecResult Left_Sail_far; //远距相机左帆板
|
||||
RecResult Right_Sail_far; //远距相机右帆板
|
||||
RecResult Self_plat_far; //远距相机本体
|
||||
|
||||
RecResult Left_Sail_close; //近距相机左帆板
|
||||
RecResult Right_Sail_close; //近距相机右帆板
|
||||
RecResult Self_plat_close; //近距相机本体
|
||||
|
||||
|
||||
uint8_t Corrosion_size_far_cmd; //远距相机腐蚀核尺寸指令执行结果
|
||||
uint8_t Corrosion_size_far; //远距相机腐蚀核尺寸
|
||||
|
||||
uint8_t Corrosion_size_close_cmd; //近距相机腐蚀核尺寸指令执行结果
|
||||
uint8_t Corrosion_size_close; //近距相机腐蚀核尺寸
|
||||
|
||||
uint8_t removal_match_radius_cmd; //恒星剔除匹配半径指令执行结果
|
||||
uint8_t removal_match_radius; //恒星剔除匹配半径
|
||||
|
||||
uint8_t Capture_flag_cmd; //捕获标志位指令执行结果
|
||||
uint8_t Capture_flag; //捕获标志位
|
||||
|
||||
uint8_t Target_Stable_Threshold_cmd; //目标稳定捕获判定阈值指令执行结果
|
||||
uint8_t Target_Stable_Threshold; //目标稳定捕获判定阈值
|
||||
|
||||
uint8_t alg_Threshold_far_cmd; //远距相机算法阈值分割系数指令执行结果
|
||||
float alg_Threshold_far; //远距相机算法阈值分割系数
|
||||
|
||||
uint8_t target_track_cmd; //追踪目标信息遥控指令接收结果
|
||||
uint8_t target_track_fan_flag; //追踪目标信息帆板单双侧标志
|
||||
float target_track_fan_coef; //追踪目标信息帆板比例系数
|
||||
float target_track_target_length; //追踪目标信息目标整体长度
|
||||
float target_track_target_width; //追踪目标信息目标帆板宽度
|
||||
|
||||
uint8_t far_alg_change_cmd; //远距相机远近距算法切换阈值指令
|
||||
uint8_t far_alg_change_Threshold; //远距相机远近距算法切换阈值
|
||||
|
||||
uint8_t far_camera_Threshold_cmd; //远距相机依据像素大小判断目标阈值指令
|
||||
uint8_t far_camera_Threshold; //远距相机依据像素大小判断目标阈值
|
||||
|
||||
|
||||
uint8_t moon_exist_cmd; //月亮存在标志指令
|
||||
uint8_t moon_exist; //月亮存在标志
|
||||
|
||||
uint8_t close_alg_change_cmd; //近距相机远近距算法切换阈值指令
|
||||
uint8_t close_alg_change_Threshold; //近距相机远近距算法切换阈值
|
||||
|
||||
uint8_t close_camera_Threshold_cmd; //近距相机依据像素大小判断目标阈值指令
|
||||
uint8_t close_camera_Threshold; //近距相机依据像素大小判断目标阈值
|
||||
|
||||
uint32_t Identification_time_sec; //识别结果时间整秒
|
||||
uint16_t Identification_time_ms; //识别结果时间毫秒
|
||||
|
||||
TX2_Image_Flag image_exist_flag; //图像无目标标志
|
||||
TX2_Image_Flag far_close_alg_change_flag; //远近距算法切换标志
|
||||
TX2_Image_Flag target_edge_flag; //目标边缘标志
|
||||
// uint8_t image_exist_flag;
|
||||
// uint8_t far_close_alg_change_flag; //远近距算法切换标志
|
||||
// uint8_t target_edge_flag; //目标边缘标志
|
||||
|
||||
float frame_noise_ratio_close ; //近距图像的信噪比
|
||||
float frame_contrast_close; //近距图像对比度
|
||||
uint8_t checksum;
|
||||
}VISION_TLM_STRUCT; //视觉遥测数据包
|
||||
|
||||
|
||||
uint8_t generate_tx2_frame(uint8_t *frame, double LOS_Remote[9], double R_Plane[2], double TarRVECI[6], double ChaRVECI[6], double ChaMtxVVLH2Body[3][3], double ChaMtxECI2VVLH[3][3], int TargetFLAG);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user