Compare commits

...

No commits in common. 'FiveWheel3.2' and 'FW3.2' have entirely different histories.

  1. 4
      .settings/language.settings.xml
  2. 47
      Core/Src/FSM.c
  3. 8
      Core/Src/robot_state.c

4
.settings/language.settings.xml

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="907529818182249734" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1328381158025398140" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="907529818182249734" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="1328381158025398140" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

47
Core/Src/FSM.c

@ -164,7 +164,7 @@ void Off_AutoSpray()
//若自动喷漆启动,计数AutoSpray_Stop_Count*2ms后再停车
if(AutoSpray_Flag == 1)
{
if(AutoSpray_Stop_Count <= 600)
if(AutoSpray_Stop_Count <= 250)
{
AutoSpray_Flag = 0;
AutoSpray_Stop_Count = 0;
@ -284,23 +284,47 @@ void Dangerous_Test()
//--气压检测
void Dym_Test()
{
//计数,置位标志
//前进探边计数
if(GV.Robot_Ultrasonic.Dym_Value <= 10250 || GV.Robot_Ultrasonic.Dym_Value >= 11000)
if(Current_T_F4_Value.Test_On == 1)
{
GV.Robot_Ultrasonic.Dym_Value_Count ++;
if(GV.Robot_Ultrasonic.Dym_Value_Count >= 3)
//计数,置位标志
//前进探边计数
if(GV.Robot_Ultrasonic.Dym_Value <= 10300 || GV.Robot_Ultrasonic.Dym_Value >= 11000)
{
GV.Robot_Ultrasonic.Dym_Value_Count ++;
if(GV.Robot_Ultrasonic.Dym_Value_Count >= 3)
{
GV.Robot_Ultrasonic.Dym_Value_Count = 3;
GV.Robot_Ultrasonic.Dym_Value_Flag = 1;
GF_BSP_GPIO_SetIO(Light, 0);
}
}
else
{
GV.Robot_Ultrasonic.Dym_Value_Count = 3;
Current_T_F4_Value.AutoForWard = 0;
Current_T_F4_Value.AutoBackWard = 0;
GV.Robot_Ultrasonic.Dym_Value_Count = 0;
GF_BSP_GPIO_SetIO(Light, 1);
}
}
else
{
GV.Robot_Ultrasonic.Dym_Value_Count = 0;
GF_BSP_GPIO_SetIO(Light, 1);
}
//报警后,等自动程序都复位才能继续
if(GV.Robot_Ultrasonic.Dym_Value_Count < 3
&& Current_T_F4_Value.AutoForWard == 0
&& Current_T_F4_Value.AutoBackWard == 0
&& Current_T_F4_Value.ChgDown_Ver == 0
&& Current_T_F4_Value.ChgUp_Ver == 0
&& Current_T_F4_Value.ChgLeft_Hor == 0
&& Current_T_F4_Value.ChgRight_Hor == 0)
{
GV.Robot_Ultrasonic.Dym_Value_Flag = 0;
}
}
//--探边置位消除
void Dangerous_Flag_Delete()
{
@ -377,7 +401,7 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值
}
//--
//--气压判断
// Dym_Test();
Dym_Test();
//--
//运动部分 Move Region
if((Current_T_F4_Value.ChgDown_Ver == 1 || Current_T_F4_Value.ChgUp_Ver == 1
@ -386,7 +410,8 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值
&& (Current_T_F4_Value.robot_forward_backward_speed >= 0X7A
&& Current_T_F4_Value.robot_forward_backward_speed <= 0X84)
&& (Current_T_F4_Value.robot_left_right_turn_speed >= 0X7A
&& Current_T_F4_Value.robot_left_right_turn_speed <= 0X84))
&& Current_T_F4_Value.robot_left_right_turn_speed <= 0X84)
&& GV.Robot_Ultrasonic.Dym_Value_Flag != 1)
{
if((Current_T_F4_Value.AutoForWard == 1 || Current_T_F4_Value.AutoBackWard == 1)
&&(Current_T_F4_Value.ChgDown_Ver != 1 && Current_T_F4_Value.ChgUp_Ver != 1

8
Core/Src/robot_state.c

@ -20,8 +20,8 @@ ChgRoad_Parameters Chg_Pa =
.KP22 = 1.75,
.KP33 = 1.75,
.KP44 = 1.25,
.KPCR1 = 15,
.KDCR1 = 12,
.KPCR1 = 16,
.KDCR1 = 13,
.change_road_status_flag=0, //换道标志位
.change_road_straight_count=0,
.change_road_distance=12, //换道时的距离(执行换道前进程序的次数,可以理解为执行次数越多,机器人走的越远)
@ -346,9 +346,9 @@ void VehicleAutoTurn(double InclinometerAngle, double expectationAngle, double K
deltaAngle=-deltaAngle;
}
if(deltaSpeed >= 500)
if(deltaSpeed >= 400)
{
deltaSpeed = 500;
deltaSpeed = 400;
}
GV.LeftFrontMotor.Target_Velcity=0;

Loading…
Cancel
Save