diff --git a/Core/Inc/kicker_chipper_board/main.h b/Core/Inc/kicker_chipper_board/main.h index 17a20f8f..61a0acbe 100644 --- a/Core/Inc/kicker_chipper_board/main.h +++ b/Core/Inc/kicker_chipper_board/main.h @@ -31,7 +31,7 @@ extern "C" { /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ - +#include "kicker_board.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ diff --git a/Core/Inc/power_board/main.h b/Core/Inc/power_board/main.h index 682909f7..723cfb89 100644 --- a/Core/Inc/power_board/main.h +++ b/Core/Inc/power_board/main.h @@ -31,6 +31,7 @@ extern "C" { /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ +#include "power_board.h" extern CAN_HandleTypeDef hcan; extern I2C_HandleTypeDef hi2c1; extern IWDG_HandleTypeDef hiwdg; diff --git a/Core/Inc/top_board/Wireless/Wireless.h b/Core/Inc/top_board/Wireless/Wireless.h index 96a75f1a..782ea830 100644 --- a/Core/Inc/top_board/Wireless/Wireless.h +++ b/Core/Inc/top_board/Wireless/Wireless.h @@ -14,18 +14,17 @@ #include #include "SX1280_Constants.h" #include "SX1280.h" -#include "main.h" #define WIRELESS_YELLOW_CHANNELS 0 #define WIRELESS_BLUE_CHANNELS 1 /* Frequency steps in MHz, starting at 2.4GHz, going up to 2.5GHz */ -/* Frequencies for the TIGERs Invites (BuGa 2023) */ -#define WIRELESS_CHANNEL_YELLOW_ROBOT_TO_BASESTATION 86 -#define WIRELESS_CHANNEL_BLUE_ROBOT_TO_BASESTATION 87 -#define WIRELESS_CHANNEL_YELLOW_BASESTATION_TO_ROBOT 88 -#define WIRELESS_CHANNEL_BLUE_BASESTATION_TO_ROBOT 89 +/* Frequencies for the RoboCup 2024 */ +#define WIRELESS_CHANNEL_YELLOW_ROBOT_TO_BASESTATION 65 +#define WIRELESS_CHANNEL_BLUE_ROBOT_TO_BASESTATION 83 +#define WIRELESS_CHANNEL_YELLOW_BASESTATION_TO_ROBOT 85 +#define WIRELESS_CHANNEL_BLUE_BASESTATION_TO_ROBOT 87 /* Frequencies below 2.4GHz to avoid WiFi. Officially not supported by documentation, but according to TIGERs it works */ /* diff --git a/Core/Inc/top_board/main.h b/Core/Inc/top_board/main.h index bf171750..0b42a2fb 100644 --- a/Core/Inc/top_board/main.h +++ b/Core/Inc/top_board/main.h @@ -31,7 +31,7 @@ extern "C" { /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ - +#include "robot.h" /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ diff --git a/Core/Inc/top_board/robot.h b/Core/Inc/top_board/robot.h index 530b1f5a..bb42fecd 100644 --- a/Core/Inc/top_board/robot.h +++ b/Core/Inc/top_board/robot.h @@ -4,28 +4,8 @@ #include #include "main.h" -#include "control_util.h" -#include "gpio_util.h" -#include "tim_util.h" -#include "peripheral_util.h" -#include "wheels.h" -#include "stateControl.h" -#include "stateEstimation.h" -#include "sdcard.h" -#include "Wireless.h" -#include "buzzer.h" -#include "speaker.h" -#include "MTi.h" -#include "yawCalibration.h" -#include "iwdg.h" -#include "logging.h" -#include "SX1280_Constants.h" -#include "AssuredPacketManager.h" #include "drivers.h" #include "pages.h" -#include "system_test.h" -#include "drain_battery.h" -#include "mcp_page.h" #include "rem.h" diff --git a/Core/Src/kicker_chipper_board/main.c b/Core/Src/kicker_chipper_board/main.c index dd12352b..d3f61215 100644 --- a/Core/Src/kicker_chipper_board/main.c +++ b/Core/Src/kicker_chipper_board/main.c @@ -21,7 +21,6 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "kicker_board.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ diff --git a/Core/Src/power_board/main.c b/Core/Src/power_board/main.c index e43a82cf..3b822b5e 100644 --- a/Core/Src/power_board/main.c +++ b/Core/Src/power_board/main.c @@ -21,7 +21,6 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "power_board.h" /* USER CODE END Includes */ diff --git a/Core/Src/top_board/main.c b/Core/Src/top_board/main.c index f1ae9e74..b14ef879 100644 --- a/Core/Src/top_board/main.c +++ b/Core/Src/top_board/main.c @@ -22,8 +22,6 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ -#include "robot.h" -#include "MCP_Driver.h" /* USER CODE END Includes */ diff --git a/Core/Src/top_board/robot.c b/Core/Src/top_board/robot.c index 2ac978f6..996d999b 100644 --- a/Core/Src/top_board/robot.c +++ b/Core/Src/top_board/robot.c @@ -1,5 +1,27 @@ #include "robot.h" +#include "control_util.h" +#include "gpio_util.h" +#include "tim_util.h" +#include "peripheral_util.h" +#include "wheels.h" +#include "stateControl.h" +#include "stateEstimation.h" +#include "sdcard.h" +#include "Wireless.h" +#include "buzzer.h" +#include "speaker.h" +#include "MTi.h" +#include "yawCalibration.h" +#include "iwdg.h" +#include "logging.h" +#include "SX1280_Constants.h" +#include "AssuredPacketManager.h" +#include "system_test.h" +#include "drain_battery.h" +#include "mcp_page.h" + + /* ============================================================ */ /* ======================= VARIABLES ========================== */ /* ============================================================ */ @@ -873,9 +895,9 @@ void loop(void){ } // reset yaw calibration if robot has not been receiving camera yaw packet for the last 3 minutes - if ((current_time - timestamp_last_packet_with_camera_yaw) > 3 * 60 * 1000) { - yaw_ResetCalibration(); - } + // if ((current_time - timestamp_last_packet_with_camera_yaw) > 3 * 60 * 1000) { + // yaw_ResetCalibration(); + // } // Toggle liveliness LED toggle_Pin(LED0_pin); @@ -1165,7 +1187,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { robotFeedback.yaw = localState[yaw]; robotFeedback.theta = atan2(vv, vu); - if (dribblerAlive.ballsensorWorking) { + if (powerAlive.sensorWorking && powerVoltage.voltagePowerBoard > 15.1f) { robotFeedback.batteryLevel = powerVoltage.voltagePowerBoard; } else { robotFeedback.batteryLevel = REM_PACKET_RANGE_REM_ROBOT_FEEDBACK_BATTERY_LEVEL_MIN;