Browse Source

注释掉MX_QUADSPI_Init();新增:在自动作业里实时调整补偿值

master
LIN\54376 1 month ago
parent
commit
6bf8ab7f1f
  1. 11
      .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project
  2. 2
      .metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs
  3. 4
      .settings/language.settings.xml
  4. 1
      Core/Protobuf/Proto/bsp_IV.proto
  5. 2
      Core/Protobuf/Proto/bsp_PV.proto
  6. 4
      Core/Src/FSM.c
  7. 2
      Core/Src/main.c
  8. 29
      Core/Src/robot_state.c

11
.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.project

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>.org.eclipse.egit.core.cmp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

2
.metadata/.plugins/org.eclipse.egit.core/.org.eclipse.egit.core.cmp/.settings/org.eclipse.core.resources.prefs

@ -1,2 +0,0 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

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="-48266367591953008" 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="1328381156250390778" 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>
@ -17,7 +17,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-48266367591953008" 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="1328381156250390778" 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>

1
Core/Protobuf/Proto/bsp_IV.proto

@ -14,6 +14,7 @@ message IV_struct_define{
int32 Robot_Current_Left= 9;
int32 Robot_Current_Right= 10;
int32 Robot_Error_Left= 11;
int32 Robot_Error_Right= 12;

2
Core/Protobuf/Proto/bsp_PV.proto

@ -2,6 +2,8 @@ syntax = "proto3";
message PV_struct_define{
int32 Robot_ChgLength= 1;
double Robot_AutoSpeedBase=2;
double Robot_ManualSpeedBase=3;
};

4
Core/Src/FSM.c

@ -450,11 +450,7 @@ void GF_Dispatch()//2ms调用一次 给车体速度等赋值
IV.Robot_CurrentState = CurrentMoveState;
action_perfrom(MoveTransitions, sizeof(MoveTransitions) / sizeof(transition_t), CurrentMoveState);//结构体数组/大小/当前状态
// action_perfrom(SwingTransitions,sizeof(SwingTransitions) / sizeof(transition_t), CurrentSwingState);
// action_perfrom(TiltTransitions, sizeof(TiltTransitions) / sizeof(transition_t), CurrentTiltState);
}

2
Core/Src/main.c

@ -143,7 +143,7 @@ int main(void)
MX_USART6_UART_Init();
MX_TIM8_Init();
MX_LWIP_Init();
MX_QUADSPI_Init();
//MX_QUADSPI_Init();
MX_LPUART1_UART_Init();
MX_ADC2_Init();
/* USER CODE BEGIN 2 */

29
Core/Src/robot_state.c

@ -215,6 +215,21 @@ void Auto()
}
break;
case 2:
//水平
if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135))
{
AM_Pa.ExpectationAngle = 90 - GV.Right_Compensation/100.0;
}
else if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45))
{
AM_Pa.ExpectationAngle = -90 + GV.Left_Compensation/100.0;
}
//垂直
else if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45))
{
AM_Pa.ExpectationAngle = 0 - GV.Left_Compensation/100.0 + GV.Right_Compensation/100.0;
}
VehicleAutoForward(angle,
GV.Left_Compensation/100.0, GV.Right_Compensation/100.0);//自动前进
break;
@ -247,6 +262,20 @@ void Auto()
}
break;
case 4:
if ((AM_Pa.ExpectationAngle >= 45 && AM_Pa.ExpectationAngle <= 135))
{
AM_Pa.ExpectationAngle = 90 + GV.Left_Compensation/100.0;
}
if ((AM_Pa.ExpectationAngle >= -135 && AM_Pa.ExpectationAngle <= -45))
{
AM_Pa.ExpectationAngle = - 90 - GV.Right_Compensation/100.0;
}
//垂直
if ((AM_Pa.ExpectationAngle > -45 && AM_Pa.ExpectationAngle < 45))
{
AM_Pa.ExpectationAngle = 0 - GV.Left_Compensation/100.0 + GV.Right_Compensation/100.0;
}
VehicleAutoBackward(angle,
GV.Left_Compensation/100.0, GV.Right_Compensation/100.0);//自动后退
break;

Loading…
Cancel
Save