删除vofa内的usb发送

This commit is contained in:
sph 2024-03-17 13:47:22 +08:00 committed by shmily744
parent 280746a42d
commit 7d926dcd15
3 changed files with 14 additions and 10 deletions

View File

@ -143,7 +143,7 @@ static void DecodeVision(uint16_t recv_len)
{ {
if(VerifyCRC16CheckSum(vis_recv_buff,sizeof(recv_data))) if(VerifyCRC16CheckSum(vis_recv_buff,sizeof(recv_data)))
{ {
DaemonReload(vision_daemon_instance); DaemonReload(vision_daemon_instance); //喂狗
memcpy(&recv_data,vis_recv_buff,sizeof(recv_data)); memcpy(&recv_data,vis_recv_buff,sizeof(recv_data));
} }
} }
@ -180,8 +180,9 @@ void VisionSend()
static uint8_t send_buffer[24]={0}; static uint8_t send_buffer[24]={0};
send_data.header = 0x5A; send_data.header = 0x5A;
//VisionSetFlag(1); VisionSetFlag(COLOR_BLUE);
//VisionSetAim(recv_data.x,recv_data.y,recv_data.z);
VisionSetAim(0,0,0);
send_data.checksum = crc_16(&send_data.header,sizeof(send_data)-2); send_data.checksum = crc_16(&send_data.header,sizeof(send_data)-2);
memcpy(send_buffer,&send_data,sizeof(send_data)); memcpy(send_buffer,&send_data,sizeof(send_data));

View File

@ -45,8 +45,8 @@ typedef enum {
// COLOR_NONE = 0, // COLOR_NONE = 0,
// COLOR_BLUE = 1, // COLOR_BLUE = 1,
// COLOR_RED = 2, // COLOR_RED = 2,
ENEMY_COLOR_RED = 0, COLOR_RED = 0,
ENEMY_COLOR_BLUE = 1, COLOR_BLUE = 1,
} Enemy_Color_e; } Enemy_Color_e;
typedef enum { typedef enum {
@ -88,10 +88,12 @@ typedef struct {
typedef struct { typedef struct {
uint8_t header; //= 0xA5; uint8_t header; //= 0xA5;
uint8_t tracking: 1; uint8_t tracking: 1;
uint8_t id: 3; // 0-outpost 6-guard 7-base uint8_t id: 3; // 0-outpost 6-guard 7-base
uint8_t armors_num: 3; // 2-balance 3-outpost 4-normal uint8_t armors_num: 3; // 2-balance 3-outpost 4-normal
uint8_t reserved: 1; uint8_t reserved: 1;
// float x; // float x;
// float y; // float y;
// float z; // float z;
@ -103,9 +105,12 @@ typedef struct {
// float r1; // float r1;
// float r2; // float r2;
// float dz; // float dz;
//导航数据
float nav_vx; float nav_vx;
float nav_vy; float nav_vy;
float nav_wz; float nav_wz;
uint16_t checksum; uint16_t checksum;
} RecievePacket_t; } RecievePacket_t;
#pragma pack() #pragma pack()
@ -144,4 +149,4 @@ void VisionSetFlag(Enemy_Color_e enemy_color);
void VisionSetAltitude(float yaw, float pitch); void VisionSetAltitude(float yaw, float pitch);
void VisionSetAim(float aim_x, float aim_y,float aim_z); void VisionSetAim(float aim_x, float aim_y,float aim_z);
#endif // !MASTER_PROCESS_H #endif // !MASTER_PROCESS_H

View File

@ -79,8 +79,6 @@ void ANODT_SendF1(int32_t Angle,int32_t speed_rpm,int32_t Angle_target,int32_t s
DataSendBuf[cnt++]=sc; DataSendBuf[cnt++]=sc;
DataSendBuf[cnt++]=ac; DataSendBuf[cnt++]=ac;
// for(uint8_t i=0;i<cnt;i++) for(uint8_t i=0;i<cnt;i++)
// HAL_UART_Transmit(&huart6,&DataSendBuf[i],1,100); HAL_UART_Transmit(&huart6,&DataSendBuf[i],1,100);
CDC_Transmit_FS(DataSendBuf, cnt);
} }