From 726882fa22fafb733cea428538b479ace001f473 Mon Sep 17 00:00:00 2001 From: Andrea Prestia <67275846+andreh1111@users.noreply.github.com> Date: Thu, 2 Jul 2026 18:15:57 -0400 Subject: [PATCH] fix act_id indexing --- robohive/robot/robot.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/robohive/robot/robot.py b/robohive/robot/robot.py index db8b7bd5..7b8faf65 100644 --- a/robohive/robot/robot.py +++ b/robohive/robot/robot.py @@ -555,13 +555,12 @@ def remap_space(self, input_vec, input_type:str, input_space:str, output_space:s # Normalize actions from absolute space to unit space - def normalize_actions(self, controls, out_space='sim', unnormalize=False): + def normalize_actions(self, controls, unnormalize=False): """ Normalize actions from absolute space to unit space Recover actions from unit space to absolute space; if unnormalize==True in_space for controls has to be 'sim' """ - act_id = -1 controls_out = controls.copy() for name, device in self.robot_config.items(): if name == "default_robot": @@ -573,10 +572,8 @@ def normalize_actions(self, controls, out_space='sim', unnormalize=False): raise TypeError("only pos act supported") else: for actuator in device['actuator']: - act_id += 1 in_id = actuator['sim_id'] - # output ordering is as per the config order for hdr - out_id = actuator['sim_id'] if out_space == 'sim' else act_id + out_id = actuator['sim_id'] if self._act_mode == "pos": act_mid = (actuator['pos_range'][1]+actuator['pos_range'][0])/2.0 @@ -606,7 +603,7 @@ def process_actuator(self, controls, step_duration, normalized=True, position_limits=True, velocity_limits=True, - out_space='sim'): + out_space='sim'): # out_space kept for API compatibility; output is always sim_id-indexed """ Process the actuation demands to (1) Remap provided controls to actuation space, @@ -614,7 +611,6 @@ def process_actuator(self, controls, step_duration, """ # last_obs = self.get_sensor_from_cache(-1) processed_controls = controls.copy() - act_id = -1 for name, device in self.robot_config.items(): if name == "default_robot": if self._act_mode == "pos": @@ -625,10 +621,8 @@ def process_actuator(self, controls, step_duration, raise TypeError("only pos act supported") else: for actuator in device['actuator']: - act_id += 1 in_id = actuator['sim_id'] - # output ordering is as per the config order for hdr - out_id = actuator['sim_id'] if out_space == 'sim' else act_id + out_id = actuator['sim_id'] control = controls[in_id] if self._act_mode == "pos":