Compare commits

...

2 Commits

Author SHA1 Message Date
shmily744 60cdc7c07c Merge remote-tracking branch 'origin/master'
# Conflicts:
#	application/cmd/robot_cmd.c
#	sentry_left.jdebug.user
2024-05-30 22:33:48 +08:00
shmily744 954942466a 2024超级对抗赛版本 2024-05-30 22:31:42 +08:00
4 changed files with 36 additions and 40 deletions

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4" />

View File

@ -21,7 +21,8 @@
#define PITCH_SCAN 20.0f //扫描阶段PITCH固定角度 寻找前哨站
#define SHOOT_RATE 18.0f //射频
#define SHOOT_RATE 15.0f //射频
#define MIN_SHOOT_RATE 5.0f //热量过高降低射频射频
/* cmd应用包含的模块实例指针和交互信息存储*/
#ifdef GIMBAL_BOARD // 对双板的兼容,条件编译
@ -297,15 +298,11 @@ static void AutoControlSet() {
//小云台扫描
if (gimbal_scan_flag == 1) {
// if(sentry_state != 1){ //为一时进攻前哨站
// gimbal_cmd_send.pitch = 0;
// }else{
// gimbal_cmd_send.pitch = PITCH_SCAN;
// }
if(sentry_state <= 1) //准备阶段 进攻前哨站阶段
gimbal_cmd_send.pitch = PITCH_SCAN;
else
gimbal_cmd_send.pitch = 0;
if(sentry_state != 1){ //为一时进攻前哨站
gimbal_cmd_send.pitch = 0;
}else{
gimbal_cmd_send.pitch = PITCH_SCAN;
}
if (yaw_dir == 1) gimbal_cmd_send.yaw += 0.06f;
@ -417,6 +414,7 @@ uint8_t sentry_behave();
uint8_t sentry_behave_RMUC();
/* 机器人核心控制任务,200Hz频率运行(必须高于视觉发送频率) */
static uint8_t cool_down;
void RobotCMDTask() {
// 从其他应用获取回传数据
@ -461,6 +459,15 @@ void RobotCMDTask() {
if (referee_data->PowerHeatData.shooter_17mm_1_barrel_heat > 350)
shoot_cmd_send.load_mode = LOAD_STOP;
if (referee_data->PowerHeatData.shooter_17mm_1_barrel_heat > 350){
cool_down = 1; //进入冷却状态
}else if(referee_data->PowerHeatData.shooter_17mm_1_barrel_heat < 100){
cool_down = 0; //退出冷却状态
}
if(cool_down){
shoot_cmd_send.shoot_rate = MIN_SHOOT_RATE;
}
// chassis_feedback_data.enemy_color = !referee_data->referee_id.Robot_Color;

View File

@ -4,9 +4,9 @@
* www.segger.com *
**********************************************************************
File :
Created : 27 Jan 2024 16:20
Ozone Version : V3.30d
File : C:/Users/sph/Desktop/sentry_left5.21/sentry_left.jdebug
Created : 22 May 2024 17:45
Ozone Version : V3.32a
*/
/*********************************************************************
@ -22,18 +22,17 @@ void OnProjectLoad (void) {
//
// Dialog-generated settings
//
Project.AddPathSubstitute ("C:/Users/sph/Desktop/sentry_left5.21", "$(ProjectDir)");
Project.AddPathSubstitute ("c:/users/sph/desktop/sentry_left5.21", "$(ProjectDir)");
Project.SetDevice ("STM32F407IG");
Project.SetHostIF ("USB", "17935099");
Project.SetHostIF ("USB", "");
Project.SetTargetIF ("SWD");
Project.SetTIFSpeed ("4 MHz");
Project.AddPathSubstitute ("D:/CLion/Project/sentry_left", "$(ProjectDir)");
Project.AddPathSubstitute ("d:/clion/project/sentry_left", "$(ProjectDir)");
Project.AddSvdFile ("$(InstallDir)/Config/CPU/Cortex-M4F.svd");
Project.AddSvdFile ("$(InstallDir)/Config/Peripherals/STM32F407IG.svd");
Project.AddSvdFile ("C:/SEGGER/Ozone/Config/Peripherals/STM32F407IG.svd");
//
// User settings
//
Edit.SysVar (VAR_HSS_SPEED, FREQ_200_HZ);
File.Open ("$(ProjectDir)/cmake-build-debug/sentry_left.elf");
Project.SetOSPlugin ("FreeRTOSPlugin_CM4");
}

View File

@ -1,27 +1,19 @@
OpenDocument="robot_cmd.c", FilePath="D:/CLion/Project/sentry_left5.21/application/cmd/robot_cmd.c", Line=196
OpenDocument="main.c", FilePath="D:/CLion/Project/sentry_left5.21/Src/main.c", Line=72
OpenDocument="main.c", FilePath="C:/Users/sph/Desktop/sentry_left5.21/Src/main.c", Line=0
OpenToolbar="Debug", Floating=0, x=0, y=0
OpenWindow="Source Files", DockArea=LEFT, x=0, y=0, w=410, h=372, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Memory 1", DockArea=BOTTOM, x=2, y=0, w=294, h=281, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x20008C00
OpenWindow="Watched Data 1", DockArea=LEFT, x=0, y=1, w=410, h=270, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Terminal", DockArea=BOTTOM, x=0, y=0, w=828, h=281, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Data Sampling", DockArea=RIGHT, x=0, y=1, w=654, h=240, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0
OpenWindow="Timeline", DockArea=RIGHT, x=0, y=0, w=654, h=402, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=0, CodePaneShown=0, PinCursor="Cursor Movable", TimePerDiv="5 s / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="0;0", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=0, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="452;0", CodeGraphLegendShown=0, CodeGraphLegendPosition="466;0"
OpenWindow="Console", DockArea=BOTTOM, x=1, y=0, w=796, h=281, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Source Files", DockArea=LEFT, x=0, y=1, w=482, h=881, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
OpenWindow="Break & Tracepoints", DockArea=LEFT, x=0, y=0, w=482, h=185, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VectorCatchIndexMask=254
OpenWindow="Memory 1", DockArea=BOTTOM, x=1, y=0, w=135, h=170, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, EditorAddress=0x20008C00
OpenWindow="Data Sampling", DockArea=RIGHT, x=0, y=1, w=591, h=153, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0, VisibleTab=0, UniformSampleSpacing=0
OpenWindow="Timeline", DockArea=RIGHT, x=0, y=0, w=591, h=913, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=1, DataPaneShown=1, PowerPaneShown=1, CodePaneShown=1, PinCursor="Cursor Movable", TimePerDiv="1 ns / Div", TimeStampFormat="Time", DataGraphDrawAsPoints=0, DataGraphLegendShown=1, DataGraphUniformSampleSpacing=0, DataGraphLegendPosition="364;0", DataGraphShowNamesAtCursor=0, PowerGraphDrawAsPoints=0, PowerGraphLegendShown=1, PowerGraphAvgFilterTime=Off, PowerGraphAvgFilterLen=Off, PowerGraphUniformSampleSpacing=0, PowerGraphLegendPosition="364;-69", CodeGraphLegendShown=1, CodeGraphLegendPosition="380;0"
OpenWindow="Console", DockArea=BOTTOM, x=0, y=0, w=2318, h=170, FilterBarShown=0, TotalValueBarShown=0, ToolBarShown=0
SmartViewPlugin="", Page="", Toolbar="Hidden", Window="SmartView 1"
TableHeader="Source Files", SortCol="File", SortOrder="DESCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[263;100;100;100;770]
TableHeader="Vector Catches", SortCol="", SortOrder="ASCENDING", VisibleCols=["";"Vector Catch";"Description"], ColWidths=[50;300;500]
TableHeader="Break & Tracepoints", SortCol="", SortOrder="ASCENDING", VisibleCols=["";"Type";"Location";"Extras"], ColWidths=[100;100;102;180]
TableHeader="Source Files", SortCol="File", SortOrder="ASCENDING", VisibleCols=["File";"Status";"Size";"#Insts";"Path"], ColWidths=[263;100;100;100;894]
TableHeader="Data Sampling Table", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time"], ColWidths=[100;100]
TableHeader="Data Sampling Setup", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Type";"Value";"Min";"Max";"Average";"# Changes";"Min. Change";"Max. Change"], ColWidths=[438;100;100;100;100;100;100;107;107]
TableHeader="Data Sampling Setup", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Type";"Value";"Min";"Max";"Average";"# Changes";"Min. Change";"Max. Change"], ColWidths=[438;144;100;100;100;100;110;126;126]
TableHeader="Power Sampling", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Index";"Time";"Ch 0"], ColWidths=[100;100;100]
TableHeader="Task List", SortCol="None", SortOrder="ASCENDING", VisibleCols=["Name";"Run Count";"Priority";"Status";"Timeout";"Stack Info";"ID";"Mutex Count";"Notified Value";"Notify State"], ColWidths=[110;110;110;110;110;110;110;110;110;110]
TableHeader="Watched Data 1", SortCol="Expression", SortOrder="ASCENDING", VisibleCols=["Expression";"Value";"Refresh"], ColWidths=[226;178;100]
TableHeader="RegisterSelectionDialog", SortCol="None", SortOrder="ASCENDING", VisibleCols=[], ColWidths=[]
TableHeader="TargetExceptionDialog", SortCol="Name", SortOrder="ASCENDING", VisibleCols=["Name";"Value";"Address";"Description"], ColWidths=[200;100;100;351]
WatchedExpression="chassis_cmd_recv", RefreshRate=2, DisplayFormat=DISPLAY_FORMAT_HEX, Window=Watched Data 1
WatchedExpression="yaw_motor", RefreshRate=2, Window=Watched Data 1
WatchedExpression="yaw_dir", RefreshRate=2, Window=Watched Data 1
WatchedExpression="gimbal_cmd_send", RefreshRate=2, Window=Watched Data 1
WatchedExpression="sentry_state", Window=Watched Data 1
WatchedExpression="referee_data", Window=Watched Data 1
TableHeader="RegisterSelectionDialog", SortCol="None", SortOrder="ASCENDING", VisibleCols=[], ColWidths=[]