From 31758485195e14bb279191b01f31f810666755e3 Mon Sep 17 00:00:00 2001 From: jvogt23 Date: Sun, 19 Jan 2025 20:15:01 -0500 Subject: [PATCH] Removed LENGTH enum value --- .../soccer/strategy/agent/position/overriding_positions.hpp | 4 +--- .../soccer/strategy/agent/position/robot_factory_position.cpp | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/soccer/src/soccer/strategy/agent/position/overriding_positions.hpp b/soccer/src/soccer/strategy/agent/position/overriding_positions.hpp index 4be6585a31c..9e6cd60c884 100644 --- a/soccer/src/soccer/strategy/agent/position/overriding_positions.hpp +++ b/soccer/src/soccer/strategy/agent/position/overriding_positions.hpp @@ -7,7 +7,7 @@ namespace Strategy { /* OverridingPositions refers to the positions that can be manually set in the UI. Normally, all robots are set to Auto. If you want to add a new position, add a new value - to this enum before LENGTH, add a string to the overriding_position_labels vector in + to this enum, add a string to the overriding_position_labels vector in main_window.hpp, and add a case to the check_for_position_override method in RobotFactoryPosition. */ @@ -22,8 +22,6 @@ enum OverridingPositions { SMART_IDLE, ZONER, IDLE, - LENGTH, // Do not remove - Placeholder to act as the "length" of the enum, or the number of - // elements it contains. Should always be at end of enum }; } // namespace Strategy diff --git a/soccer/src/soccer/strategy/agent/position/robot_factory_position.cpp b/soccer/src/soccer/strategy/agent/position/robot_factory_position.cpp index 1eab1fbbfdf..9ebb49470f1 100644 --- a/soccer/src/soccer/strategy/agent/position/robot_factory_position.cpp +++ b/soccer/src/soccer/strategy/agent/position/robot_factory_position.cpp @@ -351,8 +351,7 @@ std::string RobotFactoryPosition::get_current_state() { void RobotFactoryPosition::test_play_callback( const rj_msgs::msg::OverridePosition::SharedPtr message) { - if (message->robot_id == this->robot_id_ && - message->overriding_position < Strategy::OverridingPositions::LENGTH) { + if (message->robot_id == this->robot_id_) { override_play_position_ = static_cast(message->overriding_position); }