7.6nuc通信正常
This commit is contained in:
parent
b7e4d04550
commit
4bc5997670
@ -183,22 +183,22 @@
|
|||||||
<Ww>
|
<Ww>
|
||||||
<count>5</count>
|
<count>5</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>\\R2\../User/task/chassis_task.c\chassis.sick_cali.sickparam</ItemText>
|
<ItemText>cmd,0x0A</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>6</count>
|
<count>6</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>cmd,0x0A</ItemText>
|
<ItemText>nucbuf,0x0A</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>7</count>
|
<count>7</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>nucbuf,0x0A</ItemText>
|
<ItemText>cmd_fromnuc</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
<Ww>
|
<Ww>
|
||||||
<count>8</count>
|
<count>8</count>
|
||||||
<WinNumber>1</WinNumber>
|
<WinNumber>1</WinNumber>
|
||||||
<ItemText>cmd_fromnuc</ItemText>
|
<ItemText>NUC_send,0x0A</ItemText>
|
||||||
</Ww>
|
</Ww>
|
||||||
</WatchWindow1>
|
</WatchWindow1>
|
||||||
<Tracepoint>
|
<Tracepoint>
|
||||||
|
Binary file not shown.
@ -99,7 +99,7 @@ int8_t Chassis_Control(Chassis_t *c, CMD_t *ctrl, CAN_Output_t *out) {
|
|||||||
|
|
||||||
/*初始数据*/
|
/*初始数据*/
|
||||||
|
|
||||||
c->NUC_send.send[0] = 0;
|
c->to_nuc.send = 0;
|
||||||
c->sick_cali.is_reach = 0;
|
c->sick_cali.is_reach = 0;
|
||||||
|
|
||||||
c->vofa_send[0]= KalmanFilter(&c->extKalman[0] , c->sick_cali.sick_dis[0]);
|
c->vofa_send[0]= KalmanFilter(&c->extKalman[0] , c->sick_cali.sick_dis[0]);
|
||||||
@ -111,6 +111,7 @@ int8_t Chassis_Control(Chassis_t *c, CMD_t *ctrl, CAN_Output_t *out) {
|
|||||||
|
|
||||||
switch (c->chassis_ctrl.ctrl) {
|
switch (c->chassis_ctrl.ctrl) {
|
||||||
case RCcontrol:
|
case RCcontrol:
|
||||||
|
c->to_nuc.send = 0;
|
||||||
switch (c->chassis_ctrl.mode) {
|
switch (c->chassis_ctrl.mode) {
|
||||||
case Normal:
|
case Normal:
|
||||||
c->move_vec.Vw = ctrl->Vw * 8000;
|
c->move_vec.Vw = ctrl->Vw * 8000;
|
||||||
@ -129,7 +130,7 @@ int8_t Chassis_Control(Chassis_t *c, CMD_t *ctrl, CAN_Output_t *out) {
|
|||||||
case Chassis_Adjust_Sick:
|
case Chassis_Adjust_Sick:
|
||||||
|
|
||||||
sick_calibration(c, ctrl, out);
|
sick_calibration(c, ctrl, out);
|
||||||
c->NUC_send.send[0] = (c->sick_cali.is_reach == 1) ? 1 : 0;
|
// c->to_nuc.send = (c->sick_cali.is_reach == 1) ? 1 : 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -138,13 +139,13 @@ int8_t Chassis_Control(Chassis_t *c, CMD_t *ctrl, CAN_Output_t *out) {
|
|||||||
case AUTO:
|
case AUTO:
|
||||||
switch (c->chassis_ctrl.mode) {
|
switch (c->chassis_ctrl.mode) {
|
||||||
case AUTO_MID360:
|
case AUTO_MID360:
|
||||||
c->move_vec.Vw = ctrl->cmd_MID360.posw * 1000;
|
// c->move_vec.Vw = ctrl->cmd_MID360.posw * 1000;
|
||||||
c->move_vec.Vy = -ctrl->cmd_MID360.posy * 1000;
|
// c->move_vec.Vy = -ctrl->cmd_MID360.posy * 1000;
|
||||||
c->move_vec.Vx = -ctrl->cmd_MID360.posx * 1000;
|
// c->move_vec.Vx = -ctrl->cmd_MID360.posx * 1000;
|
||||||
abs_limit_fp(&c->move_vec.Vx, 5000.0f);
|
// abs_limit_fp(&c->move_vec.Vx, 5000.0f);
|
||||||
abs_limit_fp(&c->move_vec.Vy, 5000.0f);
|
// abs_limit_fp(&c->move_vec.Vy, 5000.0f);
|
||||||
abs_limit_fp(&c->move_vec.Vw, 5000.0f);
|
// abs_limit_fp(&c->move_vec.Vw, 5000.0f);
|
||||||
// c->NUC_send.send[0] = 1;
|
|
||||||
break;
|
break;
|
||||||
case AUTO_MID360_Pitch:
|
case AUTO_MID360_Pitch:
|
||||||
c->move_vec.Vw = ctrl->cmd_MID360.posw * 1000;
|
c->move_vec.Vw = ctrl->cmd_MID360.posw * 1000;
|
||||||
@ -154,10 +155,8 @@ int8_t Chassis_Control(Chassis_t *c, CMD_t *ctrl, CAN_Output_t *out) {
|
|||||||
abs_limit_fp(&c->move_vec.Vy, 5000.0f);
|
abs_limit_fp(&c->move_vec.Vy, 5000.0f);
|
||||||
abs_limit_fp(&c->move_vec.Vw, 5000.0f);
|
abs_limit_fp(&c->move_vec.Vw, 5000.0f);
|
||||||
break;
|
break;
|
||||||
case AUTO_MID360_Adjust:
|
case REPOSITION:
|
||||||
c->move_vec.Vw = ctrl->Vw * 6000;
|
c->to_nuc.send = 1;
|
||||||
c->move_vec.Vx = ctrl->Vy * 6000;
|
|
||||||
c->move_vec.Vy = ctrl->Vx * 6000;
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -103,12 +103,6 @@ typedef struct
|
|||||||
fp32 Vw;
|
fp32 Vw;
|
||||||
fp32 mul;//油门倍率
|
fp32 mul;//油门倍率
|
||||||
}ChassisMove_Vec;
|
}ChassisMove_Vec;
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
|
|
||||||
fp32 send[4];
|
|
||||||
|
|
||||||
}NUC_send_t;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@ -184,9 +178,12 @@ typedef struct{
|
|||||||
int is_reach;
|
int is_reach;
|
||||||
}sick_cali;
|
}sick_cali;
|
||||||
|
|
||||||
NUC_send_t NUC_send;
|
struct {
|
||||||
|
fp32 send;
|
||||||
|
}to_nuc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}Chassis_t;
|
}Chassis_t;
|
||||||
|
|
||||||
int8_t Chassis_init(Chassis_t *c,const Chassis_Param_t *param,float target_freq);
|
int8_t Chassis_init(Chassis_t *c,const Chassis_Param_t *param,float target_freq);
|
||||||
|
@ -88,14 +88,15 @@ static const ConfigParam_t param ={
|
|||||||
.go_init = -50, //仅用在go上电,初始位置
|
.go_init = -50, //仅用在go上电,初始位置
|
||||||
.go_release_pos=-200,
|
.go_release_pos=-200,
|
||||||
.Pitch_angle =66,
|
.Pitch_angle =66,
|
||||||
|
.go_up_speed =12,
|
||||||
|
.go_down_speed =6,
|
||||||
},
|
},
|
||||||
.PassCfg={
|
.PassCfg={
|
||||||
.go_wait =-10,
|
.go_wait =-10,
|
||||||
.go_release_pos =-150,
|
.go_release_pos =-150,
|
||||||
.Pitch_angle=66,
|
.Pitch_angle=66,
|
||||||
.go_up_speed =12,
|
.go_up_speed =12,
|
||||||
.go_down_speed =5,
|
.go_down_speed =6,
|
||||||
},
|
},
|
||||||
.MID360Cfg={
|
.MID360Cfg={
|
||||||
|
|
||||||
|
@ -313,6 +313,10 @@ int8_t Pitch_Process(UP_t *u, CAN_Output_t *out,CMD_t *c)
|
|||||||
up_motor_target_t *target=&u->motor_target ;
|
up_motor_target_t *target=&u->motor_target ;
|
||||||
LaunchContext_t *LaunchContext = &u->LaunchContext;
|
LaunchContext_t *LaunchContext = &u->LaunchContext;
|
||||||
// 可根据实际需要传入不同的起始和末位置,起始:当前位置
|
// 可根据实际需要传入不同的起始和末位置,起始:当前位置
|
||||||
|
LaunchContext->LaunchCfg.go_up_speed= cfg->go_up_speed;
|
||||||
|
LaunchContext->LaunchCfg.go_down_speed= cfg->go_down_speed
|
||||||
|
;
|
||||||
|
|
||||||
Pitch_Launch_Sequence(u, LaunchContext, u->motorfeedback.go_data.Pos, cfg->go_release_pos, out);
|
Pitch_Launch_Sequence(u, LaunchContext, u->motorfeedback.go_data.Pos, cfg->go_release_pos, out);
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,6 +73,8 @@ typedef struct {
|
|||||||
fp32 go_init; // GO电机触发位置,初始位置,后续更改用于发射的位置
|
fp32 go_init; // GO电机触发位置,初始位置,后续更改用于发射的位置
|
||||||
fp32 Pitch_angle; //俯仰角度,以oid为准
|
fp32 Pitch_angle; //俯仰角度,以oid为准
|
||||||
fp32 go_release_pos;//go松开,发射位置
|
fp32 go_release_pos;//go松开,发射位置
|
||||||
|
fp32 go_up_speed;
|
||||||
|
fp32 go_down_speed;
|
||||||
|
|
||||||
} PitchCfg_t;
|
} PitchCfg_t;
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ int8_t CMD_DR16(CMD_t *cmd,const CMD_RC_t *rc) {
|
|||||||
|
|
||||||
if(rc->dr16.sw_r ==CMD_SW_MID) cmd ->CMD_mode =AUTO_MID360; //左中,右中,无模式
|
if(rc->dr16.sw_r ==CMD_SW_MID) cmd ->CMD_mode =AUTO_MID360; //左中,右中,无模式
|
||||||
|
|
||||||
if(rc->dr16.sw_r ==CMD_SW_DOWN) cmd ->CMD_mode =Normal; //左中,右下,视觉
|
if(rc->dr16.sw_r ==CMD_SW_DOWN) cmd ->CMD_mode =REPOSITION; //左中,右下,视觉
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(rc->dr16.sw_l==CMD_SW_DOWN)
|
else if(rc->dr16.sw_l==CMD_SW_DOWN)
|
||||||
@ -193,7 +193,7 @@ int8_t CMD_LD(CMD_t *cmd,const CMD_RC_t *rc){
|
|||||||
if(cmd ->CMD_CtrlType ==AUTO){
|
if(cmd ->CMD_CtrlType ==AUTO){
|
||||||
|
|
||||||
/*自动下的*/
|
/*自动下的*/
|
||||||
if (rc->LD.key_C ==CMD_SW_UP) cmd ->CMD_mode =AUTO_MID360_Adjust;
|
if (rc->LD.key_C ==CMD_SW_UP) cmd ->CMD_mode =Normal;
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(rc->LD.key_E ==CMD_SW_DOWN ) cmd ->CMD_mode =Normal;
|
if(rc->LD.key_E ==CMD_SW_DOWN ) cmd ->CMD_mode =Normal;
|
||||||
|
@ -26,7 +26,7 @@ typedef enum{
|
|||||||
|
|
||||||
AUTO_MID360,
|
AUTO_MID360,
|
||||||
AUTO_MID360_Pitch,
|
AUTO_MID360_Pitch,
|
||||||
AUTO_MID360_Adjust,//雷达调整
|
REPOSITION,//雷达调整
|
||||||
|
|
||||||
UP_Adjust,//上层调整
|
UP_Adjust,//上层调整
|
||||||
Chassis_Adjust_Sick,
|
Chassis_Adjust_Sick,
|
||||||
|
@ -40,33 +40,6 @@ int8_t NUC_StartReceiving()
|
|||||||
return DEVICE_OK;
|
return DEVICE_OK;
|
||||||
return DEVICE_ERR;
|
return DEVICE_ERR;
|
||||||
}
|
}
|
||||||
int8_t NUC_StartSending(fp32 *data)
|
|
||||||
{
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
float x[1];
|
|
||||||
char data[4];
|
|
||||||
} instance;
|
|
||||||
|
|
||||||
// for (int i = 0; i < 1; i++) {
|
|
||||||
instance.x[0] = data[0];
|
|
||||||
// }
|
|
||||||
|
|
||||||
SendBuffer[0] = 0xFC; // 帧头
|
|
||||||
SendBuffer[1] = 0x01; // 控制帧
|
|
||||||
for (int i = 2; i < 6; i++)
|
|
||||||
{
|
|
||||||
SendBuffer[i] = instance.data[i - 2];
|
|
||||||
}
|
|
||||||
SendBuffer[6] = 0xFD; // 帧尾
|
|
||||||
|
|
||||||
if (HAL_UART_Transmit_DMA(BSP_UART_GetHandle(BSP_UART_NUC),
|
|
||||||
(uint8_t *)SendBuffer,
|
|
||||||
sizeof(SendBuffer)) == HAL_OK)
|
|
||||||
return DEVICE_OK;
|
|
||||||
return DEVICE_ERR;
|
|
||||||
}
|
|
||||||
int8_t NUC_Restart(void)
|
int8_t NUC_Restart(void)
|
||||||
{
|
{
|
||||||
__HAL_UART_DISABLE(BSP_UART_GetHandle(BSP_UART_NUC));
|
__HAL_UART_DISABLE(BSP_UART_GetHandle(BSP_UART_NUC));
|
||||||
@ -179,7 +152,7 @@ int8_t NUC_HandleOffline(CMD_NUC_t *cmd, NUC_t *nuc)
|
|||||||
if (cmd == NULL)
|
if (cmd == NULL)
|
||||||
return DEVICE_ERR_NULL;
|
return DEVICE_ERR_NULL;
|
||||||
nuc->unc_online = false; // 设置为离线状态
|
nuc->unc_online = false; // 设置为离线状态
|
||||||
// memset(cmd, 0, sizeof(*cmd));
|
memset(cmd, 0, sizeof(*cmd));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,28 +170,34 @@ int8_t NUC_PackIMU(NUC_t *nuc, const AHRS_Quaternion_t *quat, const AHRS_Accl_t
|
|||||||
int8_t NUC_PackCMD(NUC_t *nuc, const NUC_send_t *send){
|
int8_t NUC_PackCMD(NUC_t *nuc, const NUC_send_t *send){
|
||||||
nuc->to_nuc.cmd.head = HEAD;
|
nuc->to_nuc.cmd.head = HEAD;
|
||||||
nuc->to_nuc.cmd.id = IMU_ID;
|
nuc->to_nuc.cmd.id = IMU_ID;
|
||||||
nuc->to_nuc.cmd.type = TYPE;
|
|
||||||
nuc->to_nuc.cmd.end = TAIL;
|
nuc->to_nuc.cmd.end = TAIL;
|
||||||
// memcpy((void *)&(nuc->to_nuc.cmd.package.status), (const void *)send,sizeof(*send));
|
memcpy((void *)&(nuc->to_nuc.cmd.package.status), (const void *)send,sizeof(*send));
|
||||||
/*在这里添加你们的控制命令*/
|
/*在这里添加你们的控制命令*/
|
||||||
return DEVICE_OK;
|
return DEVICE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t NUC_StartSend(NUC_t *nuc, bool cmd_update){
|
int8_t NUC_StartSend(NUC_t *nuc, bool cmd_update){
|
||||||
if (cmd_update) {
|
if (cmd_update) {
|
||||||
|
// if (HAL_UART_Transmit_DMA(
|
||||||
|
// BSP_UART_GetHandle(BSP_UART_NUC), (uint8_t *)&(nuc->to_nuc.cmd),
|
||||||
|
// sizeof(nuc->to_nuc.cmd) + sizeof(nuc->to_nuc.imu)) == HAL_OK)
|
||||||
|
/*仅发送cmd数据*/
|
||||||
if (HAL_UART_Transmit_DMA(
|
if (HAL_UART_Transmit_DMA(
|
||||||
BSP_UART_GetHandle(BSP_UART_NUC), (uint8_t *)&(nuc->to_nuc.cmd),
|
BSP_UART_GetHandle(BSP_UART_NUC), (uint8_t *)&(nuc->to_nuc.cmd),
|
||||||
sizeof(nuc->to_nuc.cmd) + sizeof(nuc->to_nuc.imu)) == HAL_OK)
|
sizeof(nuc->to_nuc.cmd) ) == HAL_OK)
|
||||||
|
|
||||||
|
|
||||||
return DEVICE_OK;
|
return DEVICE_OK;
|
||||||
else
|
else
|
||||||
return DEVICE_ERR;
|
return DEVICE_ERR;
|
||||||
} else {
|
}
|
||||||
if (HAL_UART_Transmit_DMA(BSP_UART_GetHandle(BSP_UART_NUC),
|
// else {
|
||||||
(uint8_t *)&(nuc->to_nuc.imu),
|
// if (HAL_UART_Transmit_DMA(BSP_UART_GetHandle(BSP_UART_NUC),
|
||||||
sizeof(nuc->to_nuc.imu)) == HAL_OK)
|
// (uint8_t *)&(nuc->to_nuc.imu),
|
||||||
return DEVICE_OK;
|
// sizeof(nuc->to_nuc.imu)) == HAL_OK)
|
||||||
else
|
// return DEVICE_OK;
|
||||||
return DEVICE_ERR;
|
// else
|
||||||
}
|
// return DEVICE_ERR;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,11 @@
|
|||||||
#include "Algorithm/ahrs.h"
|
#include "Algorithm/ahrs.h"
|
||||||
#include "Module/Chassis.h"
|
#include "Module/Chassis.h"
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
fp32 send;
|
||||||
|
|
||||||
|
}NUC_send_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
@ -25,7 +30,6 @@ typedef struct {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t head;
|
uint8_t head;
|
||||||
uint8_t type; // 0x01 控制帧
|
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
Protocol_UpDataCMD_t package;
|
Protocol_UpDataCMD_t package;
|
||||||
uint8_t end;
|
uint8_t end;
|
||||||
@ -51,7 +55,6 @@ typedef struct {
|
|||||||
|
|
||||||
int8_t NUC_Init(NUC_t *nuc);
|
int8_t NUC_Init(NUC_t *nuc);
|
||||||
int8_t NUC_StartReceiving(void);
|
int8_t NUC_StartReceiving(void);
|
||||||
int8_t NUC_StartSending(fp32 *data) ;
|
|
||||||
bool_t NUC_WaitDmaCplt(void);
|
bool_t NUC_WaitDmaCplt(void);
|
||||||
int8_t NUC_RawParse(CMD_NUC_t *n, NUC_t *nuc);
|
int8_t NUC_RawParse(CMD_NUC_t *n, NUC_t *nuc);
|
||||||
int8_t NUC_HandleOffline(CMD_NUC_t *cmd, NUC_t *nuc);
|
int8_t NUC_HandleOffline(CMD_NUC_t *cmd, NUC_t *nuc);
|
||||||
|
@ -88,7 +88,7 @@ void Task_Chassis(void *argument)
|
|||||||
osMessageQueueReset(task_runtime.msgq.can.output.chassis3508);//清空队列
|
osMessageQueueReset(task_runtime.msgq.can.output.chassis3508);//清空队列
|
||||||
osMessageQueuePut(task_runtime.msgq.can.output.chassis3508, &out.motor_CHASSIS3508, 0, 0); //发送数据
|
osMessageQueuePut(task_runtime.msgq.can.output.chassis3508, &out.motor_CHASSIS3508, 0, 0); //发送数据
|
||||||
osMessageQueueReset(task_runtime.msgq.cmd.raw.nuc_send);//清空队列
|
osMessageQueueReset(task_runtime.msgq.cmd.raw.nuc_send);//清空队列
|
||||||
osMessageQueuePut(task_runtime.msgq.cmd.raw.nuc_send, &chassis.NUC_send, 0, 0); //发送数据
|
osMessageQueuePut(task_runtime.msgq.cmd.raw.nuc_send, &chassis.to_nuc, 0, 0); //发送数据
|
||||||
vofa_send[0] = chassis.vofa_send[0];
|
vofa_send[0] = chassis.vofa_send[0];
|
||||||
vofa_send[1] = chassis.vofa_send[1];
|
vofa_send[1] = chassis.vofa_send[1];
|
||||||
vofa_send[2] = chassis.vofa_send[2];
|
vofa_send[2] = chassis.vofa_send[2];
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "task\user_task.h"
|
#include "task\user_task.h"
|
||||||
#include "can_use.h"
|
#include "can_use.h"
|
||||||
#include "cmd.h"
|
#include "cmd.h"
|
||||||
|
#include "nuc.h"
|
||||||
/* Private typedef ---------------------------------------------------------- */
|
/* Private typedef ---------------------------------------------------------- */
|
||||||
/* Private define ----------------------------------------------------------- */
|
/* Private define ----------------------------------------------------------- */
|
||||||
/* Private macro ------------------------------------------------------------ */
|
/* Private macro ------------------------------------------------------------ */
|
||||||
|
@ -21,6 +21,8 @@ NUC_send_t NUC_send;
|
|||||||
#endif
|
#endif
|
||||||
fp32 send[4]={11.0f,45.0,1.f,4.0f};
|
fp32 send[4]={11.0f,45.0,1.f,4.0f};
|
||||||
int a=0;
|
int a=0;
|
||||||
|
|
||||||
|
|
||||||
void Task_nuc(void *argument){
|
void Task_nuc(void *argument){
|
||||||
(void)argument; /**/
|
(void)argument; /**/
|
||||||
|
|
||||||
@ -34,10 +36,7 @@ void Task_nuc(void *argument){
|
|||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
task_runtime.stack_water_mark.nuc= osThreadGetStackSpace(osThreadGetId());
|
task_runtime.stack_water_mark.nuc= osThreadGetStackSpace(osThreadGetId());
|
||||||
task_runtime .freq.nuc = TASK_FREQ_NUC;
|
|
||||||
task_runtime.last_up_time.nuc= tick;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
a++;
|
a++;
|
||||||
NUC_StartReceiving();
|
NUC_StartReceiving();
|
||||||
@ -58,19 +57,19 @@ void Task_nuc(void *argument){
|
|||||||
osMessageQueueGet(task_runtime.msgq.nuc.accl, &(accl), NULL, 0);
|
osMessageQueueGet(task_runtime.msgq.nuc.accl, &(accl), NULL, 0);
|
||||||
osMessageQueueGet(task_runtime.msgq.nuc.gyro, &(gyro), NULL, 0);
|
osMessageQueueGet(task_runtime.msgq.nuc.gyro, &(gyro), NULL, 0);
|
||||||
|
|
||||||
// osMessageQueueGet(task_runtime.msgq.cmd.raw.nuc_send, &NUC_send, NULL, 0);
|
//osMessageQueueGet(task_runtime.msgq.cmd.raw.nuc_send, &NUC_send, NULL, 0);
|
||||||
|
|
||||||
bool cmd_update = (osMessageQueueGet(task_runtime.msgq.cmd.raw.nuc_send,
|
bool cmd_update = (osMessageQueueGet(task_runtime.msgq.cmd.raw.nuc_send,
|
||||||
&(NUC_send), NULL, 0) == osOK);
|
&(NUC_send), NULL, 0) == osOK);
|
||||||
|
|
||||||
NUC_PackIMU(&nuc_raw, &quat, &accl, &gyro);
|
// NUC_PackIMU(&nuc_raw, &quat, &accl, &gyro);
|
||||||
if (cmd_update) {
|
if (cmd_update) {
|
||||||
NUC_PackCMD(&nuc_raw,&NUC_send);
|
NUC_PackCMD(&nuc_raw,&NUC_send);
|
||||||
|
|
||||||
|
NUC_StartSend(&nuc_raw,cmd_update);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NUC_StartSend(&nuc_raw, cmd_update);
|
|
||||||
|
|
||||||
tick += delay_tick; /* 计算下一个唤醒时刄1ķ*/
|
tick += delay_tick; /* 计算下一个唤醒时刄1ķ*/
|
||||||
osDelayUntil(tick);
|
osDelayUntil(tick);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user