66 compute_preview_control_matrices ,
77 WalkingStateMachineParams ,
88 WalkingStateMachine ,
9- State ,
9+ WalkingState ,
1010)
1111
1212from numpy .linalg import eigvals
@@ -104,48 +104,48 @@ def setUp(self):
104104 self .steps = np .ones ([5 , 3 ]) # Five steps
105105
106106 def test_begin_init (self ):
107- wsm = WalkingStateMachine (self .params , initial_state = State .INIT )
107+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .INIT )
108108 wsm .update_steps (self .steps )
109109
110110 wsm .update (t = 0.0 , rf_contact_force = 100.0 , lf_contact_force = 100.0 )
111111
112- self .assertEqual (wsm .get_current_state (), State .INIT )
112+ self .assertEqual (wsm .get_current_state (), WalkingState .INIT )
113113
114114 def test_init_to_ds (self ):
115- wsm = WalkingStateMachine (self .params , initial_state = State .INIT )
115+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .INIT )
116116 wsm .update_steps (self .steps )
117117 wsm .update (t = 0.0 , rf_contact_force = 100.0 , lf_contact_force = 100.0 )
118118
119119 wsm .update (t = self .params .t_init + 0.1 , rf_contact_force = 0.0 , lf_contact_force = 100.0 )
120120
121- self .assertEqual (wsm .get_current_state (), State .SS_RIGHT )
121+ self .assertEqual (wsm .get_current_state (), WalkingState .SS_RIGHT )
122122
123123 def test_begin_double_support (self ):
124- wsm = WalkingStateMachine (self .params , initial_state = State .DS )
124+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .DS )
125125 wsm .update_steps (self .steps )
126126
127127 wsm .update (t = 0.0 , rf_contact_force = 100.0 , lf_contact_force = 100.0 )
128128
129- self .assertEqual (wsm .get_current_state (), State .DS )
129+ self .assertEqual (wsm .get_current_state (), WalkingState .DS )
130130
131131 def test_switch_to_single_support (self ):
132- wsm = WalkingStateMachine (self .params , initial_state = State .DS )
132+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .DS )
133133 wsm .update_steps (self .steps )
134134
135135 wsm .update (t = self .params .t_ds + 0.1 , rf_contact_force = 0.0 , lf_contact_force = 0.0 )
136136
137- self .assertEqual (wsm .get_current_state (), State .SS_RIGHT )
137+ self .assertEqual (wsm .get_current_state (), WalkingState .SS_RIGHT )
138138
139139 def test_do_not_switch_to_ds_if_beginning_of_phase (self ):
140- wsm = WalkingStateMachine (self .params , initial_state = State .SS_RIGHT )
140+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .SS_RIGHT )
141141 wsm .update_steps (self .steps )
142142
143143 wsm .update (t = 0.0 , rf_contact_force = 0.0 , lf_contact_force = self .params .force_threshold + 10 )
144144
145- self .assertEqual (wsm .get_current_state (), State .SS_RIGHT )
145+ self .assertEqual (wsm .get_current_state (), WalkingState .SS_RIGHT )
146146
147147 def test_do_not_switch_to_ds_if_force_too_low (self ):
148- wsm = WalkingStateMachine (self .params , initial_state = State .SS_RIGHT )
148+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .SS_RIGHT )
149149 wsm .update_steps (self .steps )
150150
151151 wsm .update (
@@ -154,10 +154,10 @@ def test_do_not_switch_to_ds_if_force_too_low(self):
154154 lf_contact_force = self .params .force_threshold - 10 ,
155155 )
156156
157- self .assertEqual (wsm .get_current_state (), State .SS_RIGHT )
157+ self .assertEqual (wsm .get_current_state (), WalkingState .SS_RIGHT )
158158
159159 def test_switch_to_ds_if_force_too_low_and_phase_close_to_end (self ):
160- wsm = WalkingStateMachine (self .params , initial_state = State .SS_LEFT )
160+ wsm = WalkingStateMachine (self .params , initial_state = WalkingState .SS_LEFT )
161161 wsm .update_steps (self .steps )
162162
163163 wsm .update (
@@ -166,7 +166,7 @@ def test_switch_to_ds_if_force_too_low_and_phase_close_to_end(self):
166166 lf_contact_force = 0.0 ,
167167 )
168168
169- self .assertEqual (wsm .get_current_state (), State .DS )
169+ self .assertEqual (wsm .get_current_state (), WalkingState .DS )
170170
171171
172172if __name__ == "__main__" :
0 commit comments