Add shuttled and out of field and remove amp amplified.
Signed-off-by: Emily Markova <emily.markova@gmail.com>
Change-Id: I5dc1dc4c7e2b690b725d3b817e597dca5aa6f3c0
diff --git a/scouting/webserver/requests/messages/request_2024_data_scouting_response.fbs b/scouting/webserver/requests/messages/request_2024_data_scouting_response.fbs
index f450d38..7e4b58e 100644
--- a/scouting/webserver/requests/messages/request_2024_data_scouting_response.fbs
+++ b/scouting/webserver/requests/messages/request_2024_data_scouting_response.fbs
@@ -15,8 +15,10 @@
speaker:int (id:7);
amp:int (id:8);
speaker_amplified:int (id:9);
- amp_amplified:int (id:10);
+ amp_amplified:int (id:10, deprecated);
notes_dropped:int (id:11);
+ shuttled:int (id:24);
+ out_of_field:int (id:25);
penalties:int (id:12);
trap_note:bool (id:13);
diff --git a/scouting/webserver/requests/messages/submit_2024_actions.fbs b/scouting/webserver/requests/messages/submit_2024_actions.fbs
index e927b67..08ff012 100644
--- a/scouting/webserver/requests/messages/submit_2024_actions.fbs
+++ b/scouting/webserver/requests/messages/submit_2024_actions.fbs
@@ -6,10 +6,11 @@
enum ScoreType: short {
kAMP,
- kAMP_AMPLIFIED,
kSPEAKER,
kSPEAKER_AMPLIFIED,
kDROPPED,
+ kOUT_OF_FIELD,
+ kSHUTTLED,
}
table MobilityAction {
diff --git a/scouting/webserver/requests/requests.go b/scouting/webserver/requests/requests.go
index 7d6e98e..8b9c799 100644
--- a/scouting/webserver/requests/requests.go
+++ b/scouting/webserver/requests/requests.go
@@ -451,7 +451,7 @@
stat := db.Stats2024{
PreScouting: submit2024Actions.PreScouting(), TeamNumber: string(submit2024Actions.TeamNumber()), MatchNumber: submit2024Actions.MatchNumber(), SetNumber: submit2024Actions.SetNumber(), CompLevel: string(submit2024Actions.CompLevel()),
StartingQuadrant: 0, SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 0, SpeakerAmplified: 0, AmpAmplified: 0, NotesDropped: 0, Penalties: 0,
+ Speaker: 0, Amp: 0, SpeakerAmplified: 0, NotesDropped: 0, Shuttled: 0, OutOfField: 0, Penalties: 0,
TrapNote: false, Spotlight: false, AvgCycle: 0, Park: false, OnStage: false, Harmony: false, RobotDied: false, CollectedBy: "",
}
// Loop over all actions.
@@ -498,12 +498,11 @@
}
score_type := place_action.ScoreType()
auto := place_action.Auto()
+ count_in_cycle := true
if score_type == submit_2024_actions.ScoreTypekAMP && auto {
stat.AmpAuto += 1
} else if score_type == submit_2024_actions.ScoreTypekAMP && !auto {
stat.Amp += 1
- } else if score_type == submit_2024_actions.ScoreTypekAMP_AMPLIFIED && !auto {
- stat.AmpAmplified += 1
} else if score_type == submit_2024_actions.ScoreTypekSPEAKER && !auto {
stat.Speaker += 1
} else if score_type == submit_2024_actions.ScoreTypekSPEAKER && auto {
@@ -512,20 +511,32 @@
stat.SpeakerAmplified += 1
} else if score_type == submit_2024_actions.ScoreTypekDROPPED && auto {
stat.NotesDroppedAuto += 1
+ count_in_cycle = false
} else if score_type == submit_2024_actions.ScoreTypekDROPPED && !auto {
stat.NotesDropped += 1
+ count_in_cycle = false
+ } else if score_type == submit_2024_actions.ScoreTypekSHUTTLED {
+ stat.Shuttled += 1
+ count_in_cycle = false
+ } else if score_type == submit_2024_actions.ScoreTypekOUT_OF_FIELD {
+ stat.OutOfField += 1
+ count_in_cycle = false
} else {
return db.Stats2024{}, errors.New(fmt.Sprintf("Got unknown ObjectType/ScoreLevel/Auto combination"))
}
picked_up = false
- if lastPlacedTime != int64(0) {
- // If this is not the first time we place,
- // start counting cycle time. We define cycle
- // time as the time between placements.
- overall_time += int64(action.Timestamp()) - lastPlacedTime
+ if count_in_cycle {
+ // Assuming dropped, shuttled, and out of field
+ // notes are not counted in total cycle time.
+ if lastPlacedTime != int64(0) {
+ // If this is not the first time we place,
+ // start counting cycle time. We define cycle
+ // time as the time between placements.
+ overall_time += int64(action.Timestamp()) - lastPlacedTime
+ }
cycles += 1
+ lastPlacedTime = int64(action.Timestamp())
}
- lastPlacedTime = int64(action.Timestamp())
} else if action_type == submit_2024_actions.ActionTypeEndMatchAction {
var endMatchAction submit_2024_actions.EndMatchAction
endMatchAction.Init(actionTable.Bytes, actionTable.Pos)
@@ -586,8 +597,9 @@
Speaker: stat.Speaker,
Amp: stat.Amp,
SpeakerAmplified: stat.SpeakerAmplified,
- AmpAmplified: stat.AmpAmplified,
NotesDropped: stat.NotesDropped,
+ Shuttled: stat.Shuttled,
+ OutOfField: stat.OutOfField,
Penalties: stat.Penalties,
TrapNote: stat.TrapNote,
Spotlight: stat.Spotlight,
diff --git a/scouting/webserver/requests/requests_test.go b/scouting/webserver/requests/requests_test.go
index 26fad0f..609b09d 100644
--- a/scouting/webserver/requests/requests_test.go
+++ b/scouting/webserver/requests/requests_test.go
@@ -136,7 +136,7 @@
PreScouting: false, TeamNumber: "5",
MatchNumber: 1, SetNumber: 1, CompLevel: "qm", StartingQuadrant: 3,
SpeakerAuto: 2, AmpAuto: 4, NotesDroppedAuto: 1, MobilityAuto: true,
- Speaker: 0, Amp: 1, SpeakerAmplified: 2, AmpAmplified: 1,
+ Speaker: 0, Amp: 1, SpeakerAmplified: 2, Shuttled: 1, OutOfField: 2,
NotesDropped: 0, Penalties: 1, TrapNote: true, Spotlight: false, AvgCycle: 233,
Park: false, OnStage: true, Harmony: false, RobotDied: false, CollectedBy: "alex",
},
@@ -144,7 +144,7 @@
PreScouting: false, TeamNumber: "973",
MatchNumber: 3, SetNumber: 1, CompLevel: "qm", StartingQuadrant: 1,
SpeakerAuto: 0, AmpAuto: 2, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 4, SpeakerAmplified: 3, AmpAmplified: 1,
+ Speaker: 0, Amp: 4, SpeakerAmplified: 3, Shuttled: 0, OutOfField: 0,
NotesDropped: 0, Penalties: 1, TrapNote: true, Spotlight: false, AvgCycle: 120,
Park: true, OnStage: false, Harmony: false, RobotDied: true, CollectedBy: "bob",
},
@@ -213,7 +213,7 @@
PreScouting: false, TeamNumber: "342",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 4,
SpeakerAuto: 1, AmpAuto: 1, NotesDroppedAuto: 0, MobilityAuto: true,
- Speaker: 4, Amp: 2, SpeakerAmplified: 1, AmpAmplified: 0,
+ Speaker: 4, Amp: 2, SpeakerAmplified: 1, Shuttled: 0, OutOfField: 2,
NotesDropped: 2, Penalties: 2, TrapNote: true, Spotlight: true, AvgCycle: 0,
Park: true, OnStage: false, Harmony: false, RobotDied: false, CollectedBy: "alex",
},
@@ -221,7 +221,7 @@
PreScouting: false, TeamNumber: "982",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 2,
SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 2, SpeakerAmplified: 3, AmpAmplified: 2,
+ Speaker: 0, Amp: 2, SpeakerAmplified: 3, Shuttled: 1, OutOfField: 0,
NotesDropped: 1, Penalties: 0, TrapNote: false, Spotlight: true, AvgCycle: 0,
Park: false, OnStage: true, Harmony: false, RobotDied: false, CollectedBy: "george",
},
@@ -246,7 +246,7 @@
PreScouting: false, TeamNumber: "342",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 4,
SpeakerAuto: 1, AmpAuto: 1, NotesDroppedAuto: 0, MobilityAuto: true,
- Speaker: 4, Amp: 2, SpeakerAmplified: 1, AmpAmplified: 0,
+ Speaker: 4, Amp: 2, SpeakerAmplified: 1, Shuttled: 0, OutOfField: 2,
NotesDropped: 2, Penalties: 2, TrapNote: true, Spotlight: true, AvgCycle: 0,
Park: true, OnStage: false, Harmony: false, RobotDied: false, CollectedBy: "alex",
},
@@ -254,7 +254,7 @@
PreScouting: false, TeamNumber: "982",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 2,
SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 2, SpeakerAmplified: 3, AmpAmplified: 2,
+ Speaker: 0, Amp: 2, SpeakerAmplified: 3, Shuttled: 1, OutOfField: 0,
NotesDropped: 1, Penalties: 0, TrapNote: false, Spotlight: true, AvgCycle: 0,
Park: false, OnStage: true, Harmony: false, RobotDied: false, CollectedBy: "george",
},
@@ -376,15 +376,6 @@
Auto: true,
},
},
- Timestamp: 400,
- },
- {
- ActionTaken: &submit_2024_actions.ActionTypeT{
- Type: submit_2024_actions.ActionTypePickupNoteAction,
- Value: &submit_2024_actions.PickupNoteActionT{
- Auto: true,
- },
- },
Timestamp: 800,
},
{
@@ -428,7 +419,7 @@
ActionTaken: &submit_2024_actions.ActionTypeT{
Type: submit_2024_actions.ActionTypePlaceNoteAction,
Value: &submit_2024_actions.PlaceNoteActionT{
- ScoreType: submit_2024_actions.ScoreTypekAMP_AMPLIFIED,
+ ScoreType: submit_2024_actions.ScoreTypekSHUTTLED,
Auto: false,
},
},
@@ -516,8 +507,8 @@
PreScouting: false, TeamNumber: "4244",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 2,
SpeakerAuto: 0, AmpAuto: 1, NotesDroppedAuto: 0, MobilityAuto: true,
- Speaker: 0, Amp: 0, SpeakerAmplified: 1, AmpAmplified: 1,
- NotesDropped: 1, Penalties: 5, TrapNote: false, Spotlight: false, AvgCycle: 633,
+ Speaker: 0, Amp: 0, SpeakerAmplified: 1, Shuttled: 1, OutOfField: 0,
+ NotesDropped: 1, Penalties: 5, TrapNote: false, Spotlight: false, AvgCycle: 950,
Park: false, OnStage: false, Harmony: true, RobotDied: true, CollectedBy: "",
}
@@ -1237,7 +1228,7 @@
PreScouting: true, TeamNumber: "3421",
MatchNumber: 2, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 0,
SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 1, Amp: 0, SpeakerAmplified: 0, AmpAmplified: 0,
+ Speaker: 1, Amp: 0, SpeakerAmplified: 0, Shuttled: 0, OutOfField: 0,
NotesDropped: 0, Penalties: 0, TrapNote: false, Spotlight: false, AvgCycle: 0,
Park: false, OnStage: false, Harmony: false, RobotDied: false, CollectedBy: "debug_cli",
},
@@ -1483,7 +1474,7 @@
PreScouting: false, TeamNumber: "746",
MatchNumber: 3, SetNumber: 1, CompLevel: "quals", StartingQuadrant: 2,
SpeakerAuto: 0, AmpAuto: 1, NotesDroppedAuto: 1, MobilityAuto: true,
- Speaker: 0, Amp: 1, SpeakerAmplified: 1, AmpAmplified: 1,
+ Speaker: 0, Amp: 1, SpeakerAmplified: 1, Shuttled: 0, OutOfField: 2,
NotesDropped: 0, Penalties: 1, TrapNote: true, Spotlight: false, AvgCycle: 233,
Park: false, OnStage: false, Harmony: true, RobotDied: false, CollectedBy: "alek",
},
@@ -1491,7 +1482,7 @@
PreScouting: false, TeamNumber: "244",
MatchNumber: 5, SetNumber: 3, CompLevel: "quals", StartingQuadrant: 1,
SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 0, SpeakerAmplified: 3, AmpAmplified: 1,
+ Speaker: 0, Amp: 0, SpeakerAmplified: 3, Shuttled: 0, OutOfField: 0,
NotesDropped: 0, Penalties: 1, TrapNote: false, Spotlight: false, AvgCycle: 120,
Park: false, OnStage: true, Harmony: false, RobotDied: false, CollectedBy: "kacey",
},
@@ -1555,7 +1546,7 @@
PreScouting: false, TeamNumber: "244",
MatchNumber: 5, SetNumber: 3, CompLevel: "quals", StartingQuadrant: 1,
SpeakerAuto: 0, AmpAuto: 0, NotesDroppedAuto: 0, MobilityAuto: false,
- Speaker: 0, Amp: 0, SpeakerAmplified: 3, AmpAmplified: 1,
+ Speaker: 0, Amp: 0, SpeakerAmplified: 3, Shuttled: 0, OutOfField: 0,
NotesDropped: 0, Penalties: 1, TrapNote: false, Spotlight: false, AvgCycle: 120,
Park: false, OnStage: true, Harmony: false, RobotDied: false, CollectedBy: "kacey",
},