Browse Source

修改笔误

master
Lizongdi 8 hours ago
parent
commit
b02737d743
  1. 2
      RBcore/BHBF.c
  2. 1
      RBcore/drv_interface.c
  3. 36
      RBcore/include/BHBF.h
  4. 1
      motor/msp_motor_leisai.c
  5. 4
      project/paint_robot_new/paint_robot_new.c
  6. 2
      project/paint_robot_new/paint_robot_new_motors.c

2
RBcore/BHBF.c

@ -59,7 +59,7 @@ static void RBcore_ModuleHandler(const Msg_t *pstMsg)
static int aiMotorSpeed[2] = {0}; //0索引表示左,1索引表示右,多轮时到对应motor的MOTOR_CMD_SET_SPEED命令自行处理
switch (pstMsg->m_uiMsgID)
{
case CMD_STOP_ALL:
case RBCORE_CMD_STOP_ALL:
{
MsgCenter_SendTo(MODULE_NAME_MOTOR, pstMsg->m_uiMsgID, NULL, 0);
break;

1
RBcore/drv_interface.c

@ -265,6 +265,7 @@ extern void ground_manger_init(void);
extern void Custom_Task(void *argument);
void SendIV_Init(void);
void TL720D_Init(void);
void RBcore_Init(void);
void Drv_InterfaceInit(void)
{

36
RBcore/include/BHBF.h

@ -62,7 +62,6 @@ extern "C"{
#include "drv_interface.h"
#include "rd_time.h"
#include "cmsis_os.h"
#include "FreeRTOS.h"
#include <stdint.h>
/*==============================================*
@ -80,11 +79,14 @@ typedef enum {
MOTOR_GET_FAULT_CODE, // 获取错误码
MOTOR_CMD_END = 0x0100,
CMD_STOP_ALL, // 机器人停止
RBCORE_CMD_STOP_ALL, // 机器人停止
RBCORE_CMD_MANUAL_FORWARD, // 机器人手动前进
RBCORE_CMD_MANUAL_BACKWARD, // 机器人手动后退
RBCORE_CMD_MANUAL_TURNLEFT, // 机器人手动左转
RBCORE_CMD_MANUAL_TURNRIGHT, // 机器人手动右转
RBCORE_CMD_VERTICAL, // 机器人竖直前进(带PID)
RBCORE_CMD_HORIZONTAL_LEFT, // 机器人水平向左(带PID)
RBCORE_CMD_HORIZONTAL_RIGHT, // 机器人水平向右(带PID)
RBCORE_GET_VEHICLE_SPEED, // 获取机器人速度
RBCORE_CMD_END = 0x0200,
@ -96,39 +98,9 @@ typedef enum {
CUSTOM_CMD_END = 0x0300,
} BHBF_Cmd_e;
// 电机命令数据结构
typedef struct {
uint8_t m_ucMotorIndex; // 电机索引(0=左轮,1=右轮)
int32_t m_iValue; // 值(速度/位置等)
} Motor_CmdData_t;
// 电机状态数据结构
typedef struct {
uint8_t m_ucMotorIndex;
int32_t m_iPosition;
int32_t m_iVelocity;
uint32_t m_uiFaultCode;
} Motor_StatusData_t;
typedef enum {
GF_CMD_DEFAULT_NULL = 0,
GF_CMD_STOP_ALL,
GF_CMD_MANUAL_FORWARD,
GF_CMD_MANUAL_BACKWARD,
GF_CMD_AUTO_FORWARD
} GF_CMD;
typedef struct _GV_struct_define
{
int m_iWorkMode;
GF_CMD m_eGFCmd;
int32_t m_iMoveSpeed[2];//索引1对应左轮,索引2对应右轮
} GV_define;
/*==============================================*
* project-wide global variables *
*----------------------------------------------*/
void RBcore_Init(void);
/*==============================================*

1
motor/msp_motor_leisai.c

@ -18,7 +18,6 @@
******************************************************************************/
#include "msp_motor_leisai.h"
#include "rd_time.h"
#include "BHBF.h"
#include "msg_center.h"

4
project/paint_robot_new/paint_robot_new.c

@ -145,7 +145,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg)
if (abs(g_stMK32.CH2_LY_V) <= g_stCV.Joy_Sticker_Value_Allowance && abs(g_stMK32.CH3_LY_H) <= g_stCV.Joy_Sticker_Value_Allowance)
{
MsgCenter_SendTo(MODULE_NAME_RBCORE, CMD_STOP_ALL, NULL, 0);
MsgCenter_SendTo(MODULE_NAME_RBCORE, RBCORE_CMD_STOP_ALL, NULL, 0);
break;
}
@ -169,7 +169,7 @@ static void Custom_ModuleHandler(const Msg_t *pstMsg)
}
else
{
MsgCenter_SendTo(MODULE_NAME_RBCORE, CMD_STOP_ALL, NULL, 0);
MsgCenter_SendTo(MODULE_NAME_RBCORE, RBCORE_CMD_STOP_ALL, NULL, 0);
}
break;
}

2
project/paint_robot_new/paint_robot_new_motors.c

@ -72,7 +72,7 @@ static void Motor_ModuleHandler(const Msg_t *pstMsg)
g_aiMotorSpeed[1] = MotorMgr_SpeedConvert(g_apstMotors[1], aiMotorSpeed[1]);
break;
}
case CMD_STOP_ALL:
case RBCORE_CMD_STOP_ALL:
{
for (int i = 0; i < 2; i++)
{

Loading…
Cancel
Save