Skip to content

Commit

Permalink
Potential BugFix: Fix issue #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackory committed Oct 29, 2024
1 parent ff9fbcf commit 2b3d3ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions envs/JSBSim/termination_conditions/unreach_heading.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ def get_termination(self, task, env, agent_id, info={}):
new_heading = env.agents[agent_id].get_property_value(c.target_heading_deg) + delta_heading
new_heading = (new_heading + 360) % 360
new_altitude = env.agents[agent_id].get_property_value(c.target_altitude_ft) + delta_altitude
new_altitude = max(new_altitude, 15000) # assert the value in safe region
new_velocities_u = env.agents[agent_id].get_property_value(c.target_velocities_u_mps) + delta_velocities_u
new_velocities_u = max(new_velocities_u, 120.) # assert the value in safe region
env.agents[agent_id].set_property_value(c.target_heading_deg, new_heading)
env.agents[agent_id].set_property_value(c.target_altitude_ft, new_altitude)
env.agents[agent_id].set_property_value(c.target_velocities_u_mps, new_velocities_u)
Expand Down

0 comments on commit 2b3d3ff

Please sign in to comment.