#include "remote_cmd.h" #include #include "bsp\uart.h" #include "component\crc16.h" #include "component\crc8.h" #include "component\user_math.h" #include "gimbal.h" #include "remote_control.h" #include "shoot.h" int8_t remote_ParseHost(Gimbal_CMD_t *g_cmd,RC_ctrl_t *rc_ctrl,Gimbal_IMU_t*imu) { if(rc_ctrl->sw[5]==200){ g_cmd->mode=GIMBAL_MODE_ABSOLUTE; // g_cmd->delta_pit=((rc_ctrl->ch[1]-114)*(0.1/758));//806~-780,0.473~-0.71 // g_cmd->delta_yaw=((rc_ctrl->ch[0]+84)*(1.8/781));//400~-397 } else if(rc_ctrl->sw[5]==1800) { g_cmd->mode=GIMBAL_MODE_RELAX; } } int8_t shoot_remote_cmd(Shoot_CMD_t *s_cmd,RC_ctrl_t *rc_ctrl,Remote_Mode *mode) { // if(rc_ctrl!=NULL){ // s_cmd->online=true; // } if(rc_ctrl->sw[3]==1800){ s_cmd->firecmd=false; s_cmd->ready=false; } if(rc_ctrl->sw[3]==1000){ s_cmd->firecmd=false; s_cmd->ready=true; } if(rc_ctrl->sw[3]==200) { s_cmd->firecmd=true; s_cmd->ready=true; } if(rc_ctrl->sw[4]==1800){ mode->S_Mode= SHOOT_MODE_SAFE ; /* 安全模式 */ } if(rc_ctrl->sw[4]==1000) { mode->S_Mode= SHOOT_MODE_SINGLE ; /* 安全模式 */ } if(rc_ctrl->sw[4]==200) { mode->S_Mode= SHOOT_MODE_CONTINUE ; /* 安全模式 */ } }