Skip to content

Commit

Permalink
use truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
jet-sony committed Sep 3, 2024
1 parent 72f2782 commit 231e3d4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PyFlyt/gym_envs/quadx_envs/quadx_ball_in_cup_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,15 +294,15 @@ def compute_term_trunc_reward(self) -> None:
self.drone_state_error[-1] < self.goal_reach_distance
and self.drone_state_error[-2] < self.goal_reach_velocity
):
self.reward = 10000.0
self.termination = True
# hack: use truncation here, otherwise we need a HUGE reward to end
self.truncation = True
self.info["env_complete"] = True
return

# if it's up, but we're not at the winning criteria yet,
# reward for approaching goal position
if not self.sparse_reward:
self.reward += 20.0 * (
self.reward += 50.0 * (
self.drone_state_prev_error[-1] - self.drone_state_error[-1]
)
self.reward += 10.0 / (self.drone_state_error[-1] + 0.1)
self.reward += 5.0 / (self.drone_state_error[-1] + 0.1)

0 comments on commit 231e3d4

Please sign in to comment.