Skip to content

Commit

Permalink
updated falconscoutcore
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingMaster121 committed Feb 22, 2025
1 parent 181da87 commit 833d37e
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 44 deletions.
8 changes: 4 additions & 4 deletions falconscoutcore/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@
"ClimbAlignmentSpeed",
"EndgameGeneralNotes"
],
"json_file": "./data/2024cur_match_data.json",
"qualitative_json_file": "./data/2024cur_qualitative_data.json",
"json_file": "./data/2025vapor_match_data.json",
"qualitative_json_file": "./data/2025vapor_qualitative_data.json",
"error_json": "./data/errors.json"
},
"repo_config": {
"repo": "team4099/ScoutingAppData",
"update_json": "2024cur_match_data.json",
"update_qualitative_json": "2024cur_qualitative_data.json"
"update_json": "2025vapor_match_data.json",
"update_qualitative_json": "2025vapor_qualitative_data.json"
}
}
37 changes: 37 additions & 0 deletions falconscoutcore/data/2025vapor_match_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
{
"ScoutId": "Ryan",
"MatchKey": "qm1",
"Alliance": "blue",
"DriverStation": 3,
"TeamNumber": 4099,
"StartingPosition": "Far Coral Station",
"AutoLeave": true,
"ScoringSide": "Far Coral Station",
"AutoCoralL1": 0,
"AutoCoralL2": 0,
"AutoCoralL3": 0,
"AutoCoralL4": 4,
"AutoBarge": 0,
"AutoProcessor": 0,
"AutoNotes": "",
"TeleopCoralL1": 0,
"TeleopCoralL2": 0,
"TeleopCoralL3": 5,
"TeleopCoralL4": 5,
"TeleopAlgaeBarge": 0,
"TeleopAlgaeProcessor": 1,
"TeleopAlgaeRemoval": true,
"TeleopNotes": "",
"Parked": false,
"ClimbStatus": "Deep Climb",
"ClimbSpeed": "Fast (<5 seconds)",
"EndgameNotes": "",
"Disabled": false,
"StabilityRating": "Stable",
"RobotStyleType": "Offensive",
"DriverRating": "Very Fluid",
"IntakeDefenseRating": "Never defended",
"RatingNotes": ""
}
]
2 changes: 2 additions & 0 deletions falconscoutcore/data/2025vapor_qualitative_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[
]
2 changes: 1 addition & 1 deletion falconscoutcore/data/errors.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[]
[]
2 changes: 1 addition & 1 deletion falconscoutcore/data/match_schedule.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
52 changes: 26 additions & 26 deletions falconscoutcore/data_validation/config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# core setup features
year: 2025
event_code: "mdowi"
event_code: "vapor"
run_with_tba: false
path_to_data: "data/2024cur_match_data.json"
path_to_data: "data/2025vapor_match_data.json"
path_to_output: "data/errors.json"

# required translation
Expand All @@ -16,30 +16,30 @@ driver_station": "DriverStation"
# not listed, the check will not run

# Reefscape 2025: hyper-specific parameters
auto_starting_position: "StartingPosition",
auto_leave: "AutoLeave",
auto_scoring_side: "ScoringSide",
auto_coral_l1: "AutoCoralL1",
auto_coral_l2: "AutoCoralL2",
auto_coral_l3: "AutoCoralL3",
auto_coral_l4: "AutoCoralL4",
auto_barge: "AutoBarge",
auto_processor: "AutoProcessor",
auto_centerline: "AutoCenterline",
teleop_coral_l1: "TeleopCoralL1",
teleop_coral_l2: "TeleopCoralL2",
teleop_coral_l3: "TeleopCoralL3",
teleop_coral_l4: "TeleopCoralL4",
teleop_algae_barge: "TeleopAlgaeBarge",
teleop_algae_processor: "TeleopAlgaeProcessor",
endgame_parked: "Parked",
endgame_climb_status: "ClimbStatus",
endgame_climb_speed: "ClimbSpeed",
disabled: "Disabled",
stability_rating: "StabilityRating",
robot_style_type: "RobotStyleType",
driver_rating: "DriverRating",
intake_defense_rating: "IntakeDefenseRating",
auto_starting_position: "StartingPosition"
auto_leave: "AutoLeave"
auto_scoring_side: "ScoringSide"
auto_coral_l1: "AutoCoralL1"
auto_coral_l2: "AutoCoralL2"
auto_coral_l3: "AutoCoralL3"
auto_coral_l4: "AutoCoralL4"
auto_barge: "AutoBarge"
auto_processor: "AutoProcessor"
auto_centerline: "AutoCenterline"
teleop_coral_l1: "TeleopCoralL1"
teleop_coral_l2: "TeleopCoralL2"
teleop_coral_l3: "TeleopCoralL3"
teleop_coral_l4: "TeleopCoralL4"
teleop_algae_barge: "TeleopAlgaeBarge"
teleop_algae_processor: "TeleopAlgaeProcessor"
endgame_parked: "Parked"
endgame_climb_status: "ClimbStatus"
endgame_climb_speed: "ClimbSpeed"
disabled: "Disabled"
stability_rating: "StabilityRating"
robot_style_type: "RobotStyleType"
driver_rating: "DriverRating"
intake_defense_rating: "IntakeDefenseRating"

# parameters for notes
auto_notes: "AutoNotes"
Expand Down
21 changes: 9 additions & 12 deletions falconscoutcore/data_validation/data_val_2025.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import json
from itertools import chain

from falconscoutcore.data_validation.base_data_val import BaseDataValidation
from falconscoutcore.data_validation.config.constants import ChargedUp
from falconscoutcore.data_validation.config.utils import (ErrorType, get_intersection_of_n_series)
from data_validation.base_data_val import BaseDataValidation
from data_validation.config.utils import (ErrorType, get_intersection_of_n_series)
from numpy import logical_or
from pandas import DataFrame, Series, concat, isna, notna

Expand Down Expand Up @@ -144,15 +143,15 @@ def tba_validate_total_auto_cycles(self, scouting_data: DataFrame):
"No matches to retrieve data from OR invalid match key, check scouting data."
) from e

# TODO: Find the TBA keys for these stats
actual_auto_coral = score_breakdown[""]
actual_auto_coral = score_breakdown["autoCoralCount"]
scouted_auto_coral_l1 = submissions_by_alliance[self.config["auto_coral_l1"]].sum()
scouted_auto_coral_l2 = submissions_by_alliance[self.config["auto_coral_l2"]].sum()
scouted_auto_coral_l3 = submissions_by_alliance[self.config["auto_coral_l3"]].sum()
scouted_auto_coral_l4 = submissions_by_alliance[self.config["auto_coral_l4"]].sum()
scouted_auto_coral = scouted_auto_coral_l1 + scouted_auto_coral_l2 + scouted_auto_coral_l3 + scouted_auto_coral_l4

actual_auto_algae = score_breakdown[""]
# 0 for now since the field in tba is net algae count (most likely because robots won't score algae during auto)
actual_auto_algae = 0
scouted_auto_algae_processor = submissions_by_alliance[self.config["auto_processor"]].sum()
scouted_auto_algae_barge = submissions_by_alliance[self.config["auto_barge"]].sum()
scouted_auto_algae = scouted_auto_algae_barge + scouted_auto_algae_processor
Expand Down Expand Up @@ -225,15 +224,14 @@ def tba_validate_total_teleop_cycles(self, scouting_data: DataFrame):
"No matches to retrieve data from OR invalid match key, check scouting data."
) from e

# TODO: Find the TBA keys for these stats
actual_teleop_coral = score_breakdown[""]
actual_teleop_coral = score_breakdown["teleopCoralCount"]
scouted_teleop_coral_l1 = submissions_by_alliance[self.config["teleop_coral_l1"]].sum()
scouted_teleop_coral_l2 = submissions_by_alliance[self.config["teleop_coral_l2"]].sum()
scouted_teleop_coral_l3 = submissions_by_alliance[self.config["teleop_coral_l3"]].sum()
scouted_teleop_coral_l4 = submissions_by_alliance[self.config["teleop_coral_l4"]].sum()
scouted_teleop_coral = scouted_teleop_coral_l1 + scouted_teleop_coral_l2 + scouted_teleop_coral_l3 + scouted_teleop_coral_l4

actual_teleop_algae = score_breakdown[""]
actual_teleop_algae = score_breakdown["netAlgaeCount"]
scouted_teleop_algae_barge = submissions_by_alliance[self.config["teleop_algae_barge"]].sum()
scouted_teleop_algae_processor = submissions_by_alliance[self.config["teleop_algae_processor"]].sum()
scouted_teleop_algae = scouted_teleop_algae_processor + scouted_teleop_algae_barge
Expand Down Expand Up @@ -274,8 +272,7 @@ def tba_validata_climb_state(
"No matches to retrieve data from OR invalid match key, check scouting data."
) from e

# TODO: Find the TBA Key for this stat
tba_climb_status = score_breakdown[""]
tba_climb_status = score_breakdown[f"endGameRobot{driver_station}"]

if tba_climb_status == "Parked" and not parked:
self.add_error(
Expand All @@ -285,7 +282,7 @@ def tba_validata_climb_state(
team_number,
)

if tba_climb_status != climb_level and not parked:
if tba_climb_status != climb_level.replace(" ", "") and not parked:
self.add_error(
f"In {match_key}, {team_number} was said to have a climbing status of {climb_level.upper()} despite TBA marking them as {tba_climb_status.upper()}.",
ErrorType.INCORRECT_DATA,
Expand Down

0 comments on commit 833d37e

Please sign in to comment.