diff --git a/lerobot/common/robot_devices/control_context.py b/lerobot/common/robot_devices/control_context.py index 528b2a5ed..c3726a682 100644 --- a/lerobot/common/robot_devices/control_context.py +++ b/lerobot/common/robot_devices/control_context.py @@ -116,7 +116,7 @@ def _publish_config_update(self): "play_sounds": self.config.play_sounds, "assign_rewards": self.config.assign_rewards, "control_phase": self.config.control_phase, - "num_episodes": self.config.num_episodes, + "num_episodes": self.config.num_episodes - 1, "current_episode": self.current_episode_index, } @@ -150,7 +150,7 @@ def calculate_window_size(self, images: Dict[str, np.ndarray]): def draw_top_bar(self, window_width: int): top_text_str = f"Mode: {self.config.control_phase}" if self.config.control_phase == ControlPhase.RECORD: - top_text_str += f" | Episode: {self.current_episode_index}/{self.config.num_episodes}" + top_text_str += f" | Episode: {self.current_episode_index}/{self.config.num_episodes - 1}" if self.config.assign_rewards: next_reward = self.events["next_reward"] top_text_str += f" | Reward: {next_reward}" @@ -260,7 +260,7 @@ def publish_observations(self, observation: Dict[str, np.ndarray], log_items: li "play_sounds": self.config.play_sounds, "assign_rewards": self.config.assign_rewards, "control_phase": self.config.control_phase, - "num_episodes": self.config.num_episodes, + "num_episodes": self.config.num_episodes - 1, "current_episode": self.current_episode_index, } diff --git a/lerobot/scripts/control_robot.py b/lerobot/scripts/control_robot.py index 7082bdb7f..96fc7dd55 100644 --- a/lerobot/scripts/control_robot.py +++ b/lerobot/scripts/control_robot.py @@ -295,7 +295,7 @@ def record( if has_method(robot, "teleop_safety_stop"): robot.teleop_safety_stop() - recorded_episodes = 1 + recorded_episodes = 0 while True: if recorded_episodes >= num_episodes: break diff --git a/lerobot/templates/browser_ui.html b/lerobot/templates/browser_ui.html index 8ce618086..098ab51fd 100644 --- a/lerobot/templates/browser_ui.html +++ b/lerobot/templates/browser_ui.html @@ -169,7 +169,6 @@