Skip to content

Commit

Permalink
Silence warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
amacati committed May 24, 2024
1 parent 6510591 commit 2269115
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions safe_control_gym/envs/gym_pybullet_drones/quadrotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,9 +771,7 @@ def _set_action_space(self):
if self.NORMALIZED_RL_ACTION_SPACE:
# Normalized thrust (around hover thrust).
self.hover_thrust = self.GRAVITY_ACC * self.MASS / action_dim
self.action_space = spaces.Box(
low=-np.ones(action_dim), high=np.ones(action_dim), dtype=np.float32
)
self.action_space = spaces.Box(low=-1, high=1, shape=(action_dim,), dtype=np.float32)
else:
# Direct thrust control.
n_motors = 4 / action_dim
Expand Down Expand Up @@ -851,7 +849,8 @@ def _set_observation_space(self):
-np.finfo(np.float32).max,
-np.finfo(np.float32).max,
-np.finfo(np.float32).max,
]
],
np.float32,
)
high = np.array(
[
Expand All @@ -867,7 +866,8 @@ def _set_observation_space(self):
np.finfo(np.float32).max,
np.finfo(np.float32).max,
np.finfo(np.float32).max,
]
],
np.float32,
)
self.STATE_LABELS = [
"x",
Expand Down
6 changes: 4 additions & 2 deletions safe_control_gym/math_and_models/symbolic_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def setup_model(self):
"fd",
self.integration_algo,
{"x": self.x_sym, "p": self.u_sym, "ode": self.x_dot},
{"tf": self.dt},
0,
self.dt,
)
# Observation model.
self.g_func = cs.Function("g", [self.x_sym, self.u_sym], [self.y_sym], ["x", "u"], ["g"])
Expand Down Expand Up @@ -103,7 +104,8 @@ def setup_linearization(self):
"p": cs.vertcat(self.u_eval, self.x_sym, self.u_sym),
"ode": self.x_dot_linear,
},
{"tf": self.dt},
0,
self.dt,
)
# Linearized observation model.
self.y_linear = (
Expand Down

0 comments on commit 2269115

Please sign in to comment.