gimbal/User/module/remote_cmd.c
2026-01-02 23:20:17 +08:00

34 lines
576 B
C

#include "remote_cmd.h"
#include <string.h>
#include "bsp\uart.h"
#include "component\crc16.h"
#include "component\crc8.h"
#include "component\user_math.h"
#include "gimbal.h"
#include "remote_control.h"
int8_t remote_ParseHost(Gimbal_CMD_t *g_cmd,RC_ctrl_t *rc_ctrl,Gimbal_IMU_t*imu)
{
if(rc_ctrl->sw[1]==306){
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[1]==1694)
{
g_cmd->mode=GIMBAL_MODE_RELAX;
}
}