From e6230a42761602811446f7da31861224611814b3 Mon Sep 17 00:00:00 2001 From: Tarik Tamyurek Date: Tue, 29 Oct 2024 14:09:06 -0700 Subject: [PATCH] Fixed _step_entity_state() method to step entity state if actionable or non-platform Addressed the issue #22 to fix entity state stepping. The method now steps the entity state if it's an actionable platform or if it's a non-platform entity (such as chief, sun, etc.). --- safe_autonomy_sims/simulators/saferl_simulator.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/safe_autonomy_sims/simulators/saferl_simulator.py b/safe_autonomy_sims/simulators/saferl_simulator.py index 5bade5cd..9ff7c76f 100644 --- a/safe_autonomy_sims/simulators/saferl_simulator.py +++ b/safe_autonomy_sims/simulators/saferl_simulator.py @@ -392,10 +392,8 @@ def _step_entity_state(self, step_size: float, platforms_to_action: typing.Set[s for entity_name, entity in self.sim_entities.items(): action = entity_actions.get(entity_name, None) - if action is not None: - entity.add_control(action) - - entity.step(step_size=step_size) + if entity_name in platforms_to_action or not entity_name in self.platforms: + entity.step(action=action, step_size=step_size) def _step_get_entity_actions( self,