From 62f0e1588149338f5fff8ca339dc093bd006bf00 Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 12 Jun 2023 17:19:35 +0200 Subject: [PATCH] functionality for random and regular complete cartpole experiments --- src/active_bo_ros/active_bo_ros/active_rl_topic.py | 6 +++--- src/active_bo_ros/active_bo_ros/interactive_bo.py | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/active_bo_ros/active_bo_ros/active_rl_topic.py b/src/active_bo_ros/active_bo_ros/active_rl_topic.py index 3d2aadf..782ceea 100644 --- a/src/active_bo_ros/active_bo_ros/active_rl_topic.py +++ b/src/active_bo_ros/active_bo_ros/active_rl_topic.py @@ -222,7 +222,7 @@ class ActiveRLService(Node): self.active_rl_pub.publish(rl_response) self.end_time = time.time() - self.get_logger().info(f'RL Time: {self.end_time-self.begin_time}, mode: {self.interactive_run}') + # self.get_logger().info(f'RL Time: {self.end_time-self.begin_time}, mode: {self.interactive_run}') self.begin_time = None self.end_time = None @@ -263,7 +263,7 @@ class ActiveRLService(Node): self.rl_pending = False self.end_time = time.time() - self.get_logger().info(f'RL Time: {self.end_time - self.begin_time}, mode: {self.interactive_run}') + # self.get_logger().info(f'RL Time: {self.end_time - self.begin_time}, mode: {self.interactive_run}') self.begin_time = None self.end_time = None @@ -278,7 +278,7 @@ class ActiveRLService(Node): self.active_rl_pub.publish(rl_response) self.end_time = time.time() - self.get_logger().info(f'RL Time: {self.end_time - self.begin_time}, mode: {self.interactive_run}') + # self.get_logger().info(f'RL Time: {self.end_time - self.begin_time}, mode: {self.interactive_run}') self.begin_time = None self.end_time = None diff --git a/src/active_bo_ros/active_bo_ros/interactive_bo.py b/src/active_bo_ros/active_bo_ros/interactive_bo.py index 70b8037..1c57c6b 100644 --- a/src/active_bo_ros/active_bo_ros/interactive_bo.py +++ b/src/active_bo_ros/active_bo_ros/interactive_bo.py @@ -123,6 +123,7 @@ class ActiveBOTopic(Node): self.seed_array = None self.env = None self.active_bo_pending = False + self.BO = None def active_bo_callback(self, msg): if not self.active_bo_pending: @@ -408,7 +409,7 @@ class ActiveBOTopic(Node): state_msg = ActiveBOState() state_msg.current_run = self.current_run + 1 if self.current_run < self.bo_runs else self.bo_runs - state_msg.current_episode = self.current_episode + 1 \ + state_msg.current_episode = self.current_episode \ if self.current_episode < self.bo_episodes else self.bo_episodes state_msg.best_reward = float(self.best_reward) state_msg.last_user_reward = self.last_user_reward