增加了额外的注释

This commit is contained in:
NeoZng
2023-01-02 23:50:04 +08:00
parent bfaae13b59
commit f37d813bcd
11 changed files with 37 additions and 17 deletions

View File

@@ -2,7 +2,7 @@
#define CHASSIS_H
/**
* @brief 底盘应用初始化,请在开启rtos之前调用
* @brief 底盘应用初始化,请在开启rtos之前调用(目前会被RobotInit()调用)
*
*/
void ChassisInit();

View File

@@ -134,7 +134,7 @@ static void RemoteControlSet()
; // 弹舱舵机控制,待添加servo_motor模块,关闭
// 摩擦轮控制,拨轮向上打为负,向下为正
if (rc_data[TEMP].rc.dial < -100)
if (rc_data[TEMP].rc.dial < -100) // 向上超过100,打开摩擦轮
shoot_cmd_send.friction_mode = FRICTION_ON;
else
shoot_cmd_send.friction_mode = FRICTION_OFF;

View File

@@ -1,8 +1,16 @@
#ifndef GIMBAL_CMD_H
#define GIMBAL_CMD_H
/**
* @brief 机器人核心控制任务初始化,会被RobotInit()调用
*
*/
void RobotCMDInit();
/**
* @brief 机器人核心控制任务,200Hz频率运行(必须高于视觉发送频率)
*
*/
void RobotCMDTask();
#endif // !GIMBAL_CMD_H

View File

@@ -2,7 +2,7 @@
#define GIMBAL_H
/**
* @brief 初始化云台
* @brief 初始化云台,会被RobotInit()调用
*
*/
void GimbalInit();

View File

@@ -5,6 +5,7 @@
#if defined(ONE_BOARD) || defined(CHASSIS_BOARD)
#include "chassis.h"
#endif
#if defined(ONE_BOARD) || defined(GIMBAL_BOARD)
#include "gimbal.h"
#include "shoot.h"

View File

@@ -1,8 +1,18 @@
#ifndef ROBOT_H
#define ROBOT_H
/* Robot利用robot_def.h中的宏对不同的机器人进行了大量的兼容,同时兼容了两个开发板(云台板和底盘板)的配置 */
/**
* @brief 机器人初始化,请在开启rtos之前调用.这也是唯一需要放入main函数的函数
*
*/
void RobotInit();
/**
* @brief 机器人任务,放入实时系统以一定频率运行,内部会调用各个应用的任务
*
*/
void RobotTask();
#endif

View File

@@ -21,6 +21,7 @@
// #define CHASSIS_BOARD //底盘板
// #define GIMBAL_BOARD //云台板
// @todo: 增加机器人类型定义,后续是否要兼容所有机器人?(只兼容步兵英雄哨兵似乎就够了)
/* 机器人类型定义 */
// #define ROBOT_HERO 1 // 英雄机器人
// #define ROBOT_ENINEER 2 // 工程机器人
@@ -46,11 +47,11 @@
#define RADIUS_WHEEL 60 // 轮子半径
#define REDUCTION_RATIO_WHEEL 19.0f // 电机减速比,因为编码器量测的是转子的速度而不是输出轴的速度故需进行转换
// 检查是否出现定义冲突
// 检查是否出现定义冲突,只允许一个开发板定义存在,否则编译会自动报错
#if (defined(ONE_BOARD) && defined(CHASSIS_BOARD)) || \
(defined(ONE_BOARD) && defined(GIMBAL_BOARD)) || \
(defined(CHASSIS_BOARD) && defined(GIMBAL_BOARD))
#error Conflict board definition! You can only define one type.
#error Conflict board definition! You can only define one board type.
#endif
#pragma pack(1) // 压缩结构体,取消字节对齐

View File

@@ -205,7 +205,7 @@ void ShootTask()
DJIMotorSetRef(friction_l, 0);
DJIMotorSetRef(friction_r, 0);
break;
default: // 当前为了调试设定的4000,因为还没有加入裁判系统无法读取弹速.后续修改为while(1);表明模式错误
default: // 当前为了调试设定的默认值4000,因为还没有加入裁判系统无法读取弹速.
DJIMotorSetRef(friction_l, 4000);
DJIMotorSetRef(friction_r, 4000);
break;

View File

@@ -2,7 +2,7 @@
#define SHOOT_H
/**
* @brief 发射初始化
* @brief 发射初始化,会被RobotInit()调用
*
*/
void ShootInit();