forked from logzhan/RobotHardware-UESTC
38 lines
1.1 KiB
C++
38 lines
1.1 KiB
C++
|
/******************** (C) COPYRIGHT 2024 GeBot *********************************
|
||
|
* File Name : main.c
|
||
|
* Current Version : V1.0 & ST 3.5.0
|
||
|
* Author : zhanli 719901725@qq.com
|
||
|
* Date of Issued : 2024.01.23 zhanli: Create.
|
||
|
* Comments : Gebot硬件驱动
|
||
|
********************************************************************************/
|
||
|
#include "robot.h"
|
||
|
|
||
|
/**----------------------------------------------------------------------
|
||
|
* Function : main
|
||
|
* Description : Gebot入口函数
|
||
|
* Author : zhanli&719901725@qq.com
|
||
|
* Date : 2023/04/22 zhanli
|
||
|
*---------------------------------------------------------------------**/
|
||
|
int main(void)
|
||
|
{
|
||
|
//初始化
|
||
|
Robot::get()->Init();
|
||
|
|
||
|
while (1) {
|
||
|
// 检测接收的命令
|
||
|
Robot::get()->CheckCommand();
|
||
|
|
||
|
// 运动解算 把上位机下发的机器人的速度(线速度角速度)转为各个轮子的速度
|
||
|
Robot::get()->DoKinmatics();
|
||
|
|
||
|
// 根据轮子的编码器计算得到机器人的里程计
|
||
|
Robot::get()->CalcOdom();
|
||
|
|
||
|
// 读取imu的值
|
||
|
Robot::get()->GetImuData();
|
||
|
|
||
|
// 检测处理ps2的按键信息
|
||
|
Robot::get()->CheckJoystick();
|
||
|
}
|
||
|
}
|