Skip to content

Commit ebf7d4e

Browse files
migrate mapping logic to strat runner for get_robot_responses
1 parent c804a28 commit ebf7d4e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

utama_core/team_controller/src/controllers/real/real_robot_controller.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ def __init__(
6262
self._vision_to_cmd_mapping = vision_to_cmd_mapping if vision_to_cmd_mapping is not None else {}
6363
cmd_to_vision_mapping = {v: k for k, v in self._vision_to_cmd_mapping.items()}
6464
if len(cmd_to_vision_mapping) != len(self._vision_to_cmd_mapping):
65-
raise ValueError(
66-
"vision_to_cmd_mapping must be one-to-one: duplicate command IDs are not allowed."
67-
)
65+
raise ValueError("vision_to_cmd_mapping must be one-to-one: duplicate command IDs are not allowed.")
6866
self._cmd_to_vision_mapping = cmd_to_vision_mapping
6967

7068
# track last kick time for each robot to transmit kick as HIGH for n timesteps after command
@@ -126,8 +124,7 @@ def get_robots_responses(self) -> List[RobotResponse]:
126124

127125
# Guard against IndexError just in case, though validated by 'length' check
128126
if len(data) >= 1:
129-
if robot_id in self._cmd_to_vision_mapping:
130-
robot_id = self._cmd_to_vision_mapping[robot_id]
127+
# remapping to vision ID done in strat runner
131128
if robot_id in responded_ids:
132129
warnings.warn(
133130
f"Received multiple responses for robot ID {robot_id} in the same cycle. Ignoring subsequent responses."

0 commit comments

Comments
 (0)