@@ -56,10 +56,7 @@ pub enum PrimaryState {
5656 /// State at the start of the match where the robots stand up
5757 Initial ,
5858 /// State in which robots walk to their legal positions
59- Ready {
60- referee_in_standby : bool ,
61- whistle_in_playing : bool ,
62- } ,
59+ Ready { referee_in_standby : bool } ,
6360 /// State in which the robots wait for a kick-off or penalty
6461 Set ,
6562 /// State in which the robots are playing soccer, with a bool to keep state after a whistle
@@ -179,19 +176,12 @@ pub fn next_primary_state(
179176 PS :: Playing {
180177 whistle_in_set: true
181178 }
182- ) || matches ! (
183- primary_state,
184- PS :: Ready {
185- referee_in_standby: false ,
186- whistle_in_playing: true
187- }
188179 ) || whistle. detected ( ) ;
189180
190181 let recognized_ready_pose = matches ! (
191182 primary_state,
192183 PS :: Ready {
193- referee_in_standby: true ,
194- whistle_in_playing: false
184+ referee_in_standby: true
195185 }
196186 ) || recognized_ready_pose;
197187
@@ -200,20 +190,14 @@ pub fn next_primary_state(
200190 GameState :: Initial => PS :: Initial ,
201191 GameState :: Standby if recognized_ready_pose => PS :: Ready {
202192 referee_in_standby : true ,
203- whistle_in_playing : false ,
204193 } ,
205194 GameState :: Ready => PS :: Ready {
206195 referee_in_standby : false ,
207- whistle_in_playing : false ,
208196 } ,
209197 GameState :: Set if heard_whistle => PS :: Playing {
210198 whistle_in_set : true ,
211199 } ,
212200 GameState :: Set => PS :: Set ,
213- GameState :: Playing if heard_whistle => PS :: Ready {
214- referee_in_standby : false ,
215- whistle_in_playing : true ,
216- } ,
217201 GameState :: Playing => PS :: Playing {
218202 whistle_in_set : false ,
219203 } ,
0 commit comments