From 2b3d3ff6bed4e3179b7b104d52edc4e98306b955 Mon Sep 17 00:00:00 2001 From: jyh <1579823519@qq.com> Date: Tue, 29 Oct 2024 16:37:34 +0800 Subject: [PATCH] Potential BugFix: Fix issue #37 --- envs/JSBSim/termination_conditions/unreach_heading.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/envs/JSBSim/termination_conditions/unreach_heading.py b/envs/JSBSim/termination_conditions/unreach_heading.py index bf05f54..c99fbbc 100644 --- a/envs/JSBSim/termination_conditions/unreach_heading.py +++ b/envs/JSBSim/termination_conditions/unreach_heading.py @@ -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)