Skip to content
Snippets Groups Projects
Commit c7f3c569 authored by chsieh16's avatar chsieh16
Browse files

is_positive_example w/o considering state bound

parent 9a2eeba3
No related branches found
No related tags found
No related merge requests found
......@@ -108,14 +108,9 @@ class GEMStanleyGurobiTeacher(GurobiTeacherBase):
super().__init__(name=name,
state_dim=3, perc_dim=2, ctrl_dim=1, norm_ord=norm_ord)
def is_positive_example(self, ex) -> Optional[bool]:
def is_positive_example(self, ex) -> bool:
assert len(ex) == self.state_dim + self.perc_dim
state_arr = np.asfarray(ex[0:self.state_dim])
if not (np.all(self._old_state.lb <= state_arr) and
np.all(state_arr <= self._old_state.ub)):
return None
def g(cte, phi):
error = phi + np.arctan(K_P*cte/FORWARD_VEL)
steer = np.clip(error, -STEERING_LIM, STEERING_LIM)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment