Skip to content

Commit

Permalink
update protocol in fortress and steering, need to update firmware of …
Browse files Browse the repository at this point in the history
…old vehicle
  • Loading branch information
rickxu2 committed Jul 28, 2024
1 parent d07a487 commit bded598
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
12 changes: 6 additions & 6 deletions vehicles/Fortress/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -440,17 +440,17 @@ void shooterTask(void* arg) {

if (referee->game_robot_status.mains_power_shooter_output &&
referee->power_heat_data.shooter_id1_17mm_cooling_heat <
referee->game_robot_status.shooter_id1_17mm_cooling_limit - 20 &&
referee->game_robot_status.shooter_barrel_cooling_value - 20 &&
(dbus->mouse.l || dbus->swr == remote::UP))
shooter->LoadNext();
if (!referee->game_robot_status.mains_power_shooter_output || dbus->keyboard.bit.Q ||
dbus->swr == remote::DOWN) {
flywheelFlag = false;
shooter->SetFlywheelSpeed(0);
} else if (referee->game_robot_status.shooter_id1_17mm_speed_limit == 15) {
} else if (referee->game_robot_status.shooter_barrel_heat_limit == 15) {
flywheelFlag = true;
shooter->SetFlywheelSpeed(440); // 445 MAX
} else if (referee->game_robot_status.shooter_id1_17mm_speed_limit >= 18) {
} else if (referee->game_robot_status.shooter_barrel_heat_limit >= 18) {
flywheelFlag = true;
shooter->SetFlywheelSpeed(485); // 490 MAX
} else {
Expand Down Expand Up @@ -1219,13 +1219,13 @@ void RM_RTOS_Default_Task(const void* arg) {
print("\r\n");

print("Shooter Heat: %hu / %d\r\n", referee->power_heat_data.shooter_id1_17mm_cooling_heat,
referee->game_robot_status.shooter_id1_17mm_cooling_limit);
referee->game_robot_status.shooter_barrel_cooling_value);
print("Bullet Speed: %.3f / %d\r\n", referee->shoot_data.bullet_speed,
referee->game_robot_status.shooter_id1_17mm_speed_limit);
referee->game_robot_status.shooter_barrel_heat_limit);
print("Bullet Frequency: %hhu\r\n", referee->shoot_data.bullet_freq);

if (referee->shoot_data.bullet_speed >
referee->game_robot_status.shooter_id1_17mm_speed_limit)
referee->game_robot_status.shooter_barrel_heat_limit)
pass = false;
print("\r\nSpeed Limit Test: %s\r\n", pass ? "PASS" : "FAIL");
}
Expand Down
11 changes: 2 additions & 9 deletions vehicles/Steering/chassis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -341,19 +341,12 @@ void chassisTask(void* arg) {
receive->TransmitOutput();

receive->cmd.id = bsp::COOLING_LIMIT1;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_id1_17mm_cooling_limit;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_barrel_cooling_value;
receive->TransmitOutput();

receive->cmd.id = bsp::COOLING_LIMIT2;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_id2_17mm_cooling_limit;
receive->TransmitOutput();

receive->cmd.id = bsp::SPEED_LIMIT1;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_id1_17mm_speed_limit;
receive->TransmitOutput();

receive->cmd.id = bsp::SPEED_LIMIT2;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_id2_17mm_speed_limit;
receive->cmd.data_float = (float)referee->game_robot_status.shooter_barrel_heat_limit;
receive->TransmitOutput();

osDelay(CHASSIS_TASK_DELAY);
Expand Down

0 comments on commit bded598

Please sign in to comment.