仓库提交练习
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.5 KiB

3 weeks ago
/******************************************************************************
(C), 2018-2099, Radkil
******************************************************************************
: robot.c
: 稿
: radkil
: 2026414
:
:
:
1. : 2026414
: radkil
:
******************************************************************************/
#include "robot.h"
#include "wheel_if.h"
#include "swing_if.h"
#include "paint_if.h"
#include "controller_if.h"
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
/*----------------------------------------------*
* *
*----------------------------------------------*/
int RobotInit(void)
{
int iRet = 0;
iRet |= WheelMotorInit();
iRet |= ControllerInit();
iRet |= SwingArmInit();
iRet |= PaintInit();
return iRet;
}
void RobotProc(void)
{
ERobotCmd eRobotCmd = ControllerInputStateMachine();
switch (eRobotCmd)
{
case RB_STOP:
WheelMotorStop();
break;
case RB_MANUAL_FORWARD:
WheelMotorSetSpeed(10);
WheelMotorDirForward();
break;
case RB_MANUAL_BACKWARD:
WheelMotorSetSpeed(10);
WheelMotorDirBackward();
break;
case RB_PAINT:
PaintWork();
break;
default:
WheelMotorStop();
break;
}
}