Skip to content

Commit

Permalink
Merge pull request #40 from RoboTeamTwente/frequenciesRoboCup2024
Browse files Browse the repository at this point in the history
Frequencies robo cup2024
  • Loading branch information
JWillegers authored Jul 14, 2024
2 parents 10892eb + 755029f commit 8a0a8af
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Core/Inc/kicker_chipper_board/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C" {

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

#include "kicker_board.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
Expand Down
1 change: 1 addition & 0 deletions Core/Inc/power_board/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 5 additions & 6 deletions Core/Inc/top_board/Wireless/Wireless.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@
#include <stdint.h>
#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 */
/*
Expand Down
2 changes: 1 addition & 1 deletion Core/Inc/top_board/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C" {

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

#include "robot.h"
/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
Expand Down
20 changes: 0 additions & 20 deletions Core/Inc/top_board/robot.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,8 @@
#include <unistd.h>
#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"

Expand Down
1 change: 0 additions & 1 deletion Core/Src/kicker_chipper_board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "kicker_board.h"
/* USER CODE END Includes */

/* Private typedef -----------------------------------------------------------*/
Expand Down
1 change: 0 additions & 1 deletion Core/Src/power_board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "power_board.h"

/* USER CODE END Includes */

Expand Down
2 changes: 0 additions & 2 deletions Core/Src/top_board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "robot.h"
#include "MCP_Driver.h"

/* USER CODE END Includes */

Expand Down
30 changes: 26 additions & 4 deletions Core/Src/top_board/robot.c
Original file line number Diff line number Diff line change
@@ -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 ========================== */
/* ============================================================ */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 8a0a8af

Please sign in to comment.