From f81c8457a1a33df4af99c1a47f5beb326286c968 Mon Sep 17 00:00:00 2001 From: sergiopaniego Date: Wed, 20 Sep 2023 11:27:23 +0200 Subject: [PATCH] Brains separated between CARLA and gazebo --- ...rain_carla_bird_eye_deep_learning_torch.py | 2 +- ..._bird_eye_deep_learning_torch_optimized.py | 2 +- ..._eye_deep_learning_torch_tensorrt_float.py | 2 +- ..._eye_deep_learning_torch_tensorrt_int_8.py | 2 +- .../pytorch/utils}/__init__.py | 0 .../pytorch/utils}/convlstm.py | 0 .../utils}/deepest_lstm_tinypilotnet.py | 0 .../pytorch/utils}/pilotnet.py | 0 .../pytorch/utils}/pilotnetStacked.py | 0 .../brain_carla_bird_eye_deep_learning.py | 1 + .../{agents/f1 => gazebo/agents}/__init__.py | 0 .../brains/{ => gazebo}/agents/dqn.py | 0 .../brains/{ => gazebo}/agents/f1/.env | 0 .../brains/{ => gazebo}/agents/f1/.env.sample | 0 .../{car => gazebo/agents/f1}/__init__.py | 0 .../brains/{ => gazebo}/agents/f1/dqn.py | 0 .../agents/f1/f1_follow_line_camera_dqn.py | 0 .../agents/f1/f1_follow_line_qlearn.py | 0 .../brains/{ => gazebo}/agents/f1/liveplot.py | 0 .../brains/{ => gazebo}/agents/f1/memory.py | 0 .../brains/{ => gazebo}/agents/f1/qlearn.py | 0 .../{ => gazebo}/agents/f1/ros_gazebo_pose.py | 0 .../brains/{ => gazebo}/agents/f1/settings.py | 0 .../agents/f1_follow_line_camera_dqn.py | 0 .../agents/f1_follow_line_qlearn.py | 0 .../brains/{ => gazebo}/agents/liveplot.py | 0 .../brains/{ => gazebo}/agents/memory.py | 0 .../brains/{ => gazebo}/agents/qlearn.py | 0 .../{ => gazebo}/agents/ros_gazebo_pose.py | 0 .../agents/scripts/benchmark_runner | 0 .../brains/{ => gazebo}/agents/settings.py | 0 .../circuit2_turtlebot_lidar_qlearn.py | 0 .../circuit2c_turtlebot_camera_dqn.py | 0 .../{ => gazebo}/agents/turtlebot/deepq.py | 0 .../{ => gazebo}/agents/turtlebot/liveplot.py | 0 .../{ => gazebo}/agents/turtlebot/memory.py | 0 .../{ => gazebo}/agents/turtlebot/qlearn.py | 0 .../turtlebot/round_turtlebot_lidar_test.py | 0 ...untraining_dqn_circuit2_turtlebot_lidar.py | 0 .../{ => gazebo}/agents/turtlebot/sarsa.py | 0 .../agents/utilities/averaged_table.py | 0 .../agents/utilities/camera_visualizer.py | 0 .../agents/utilities/display_plot.py | 0 .../brains/{drone => gazebo/car}/__init__.py | 0 .../{ => gazebo}/car/brain_car_opencv2.py | 0 .../brains/{f1 => gazebo/drone}/__init__.py | 0 .../drone/brain_drone_explicit.py | 0 .../{f1/torch_utils => gazebo/f1}/__init__.py | 0 .../brains/{ => gazebo}/f1/brain_f1_dummy.py | 0 .../{ => gazebo}/f1/brain_f1_explicit.py | 0 .../f1/brain_f1_follow_line_dqn.py | 2 +- .../f1/brain_f1_follow_line_qlearn.py | 2 +- .../{ => gazebo}/f1/brain_f1_keras-lstm.py | 0 .../brains/{ => gazebo}/f1/brain_f1_keras.py | 0 .../f1/brain_f1_keras_classification-bw.py | 0 .../f1/brain_f1_keras_classification.py | 0 .../f1/brain_f1_keras_opencv_dataset.py | 0 .../f1/brain_f1_keras_preprocessed.py | 0 .../f1/brain_f1_keras_preprocessed_lstm.py | 0 ...eras_preprocessed_lstm_3_elements-60pts.py | 0 ...n_f1_keras_preprocessed_lstm_3_elements.py | 0 ...n_f1_keras_preprocessed_lstm_5_elements.py | 0 .../f1/brain_f1_keras_preprocessed_v_w.py | 0 .../f1/brain_f1_keras_scripting.py | 0 .../{ => gazebo}/f1/brain_f1_keras_seq_3.py | 0 .../f1/brain_f1_keras_seq_3_opencv_dataset.py | 0 .../brains/{ => gazebo}/f1/brain_f1_opencv.py | 0 .../{ => gazebo}/f1/brain_f1_torch-lstm.py | 0 .../brains/{ => gazebo}/f1/brain_f1_torch.py | 2 +- .../{ => gazebo}/f1/brain_f1_torchstacked.py | 0 .../f1/config/config_f1_qlearn.yaml | 0 ...ig_inference_followline_dqn_f1_gazebo.yaml | 0 .../f1/rl_utils/algorithms/__init__.py | 0 .../f1/rl_utils/algorithms/algorithms_type.py | 0 .../f1/rl_utils/algorithms/dqn_f1.py | 0 .../f1/rl_utils/algorithms/exceptions.py | 0 .../f1/rl_utils/algorithms/loaders.py | 0 .../f1/rl_utils/algorithms/qlearn_f1.py | 0 .../{ => gazebo}/f1/rl_utils/env_type.py | 0 .../{ => gazebo}/f1/rl_utils/exceptions.py | 0 .../{ => gazebo}/f1/rl_utils/gazebo_envs.py | 0 .../{ => gazebo}/f1/rl_utils/image_f1.py | 0 .../{ => gazebo}/f1/rl_utils/inference.py | 0 .../f1/rl_utils/models/__init__.py | 0 .../{ => gazebo}/f1/rl_utils/models/f1_env.py | 0 .../f1/rl_utils/models/f1_env_camera.py | 0 .../f1/rl_utils/models/followline_dqn_tf.py | 0 .../{ => gazebo}/f1/rl_utils/models/images.py | 0 .../{ => gazebo}/f1/rl_utils/models/reset.py | 0 .../f1/rl_utils/models/rewards.py | 0 .../f1/rl_utils/models/settings.py | 0 .../rl_utils/models/simplified_perception.py | 0 .../{ => gazebo}/f1/rl_utils/models/step.py | 0 .../{ => gazebo}/f1/rl_utils/models/utils.py | 0 .../{ => gazebo}/f1/rl_utils/settings.py | 0 .../f1/torch_utils}/__init__.py | 0 .../brains/gazebo/f1/torch_utils/convlstm.py | 195 ++++++++++++++++++ .../torch_utils/deepest_lstm_tinypilotnet.py | 45 ++++ .../brains/gazebo/f1/torch_utils/pilotnet.py | 58 ++++++ .../gazebo/f1/torch_utils/pilotnetStacked.py | 59 ++++++ .../{f1rl/utils => gazebo/f1rl}/__init__.py | 0 .../{ => gazebo}/f1rl/brain_f1_dummy.py | 0 .../f1rl/f1_follow_line_camera_dqn.py | 0 .../f1rl/f1_follow_line_qlearn.py | 0 .../f1rl/f1_follow_line_qlearn_laser.py | 0 .../brains/{ => gazebo}/f1rl/train.py | 0 .../f1rl/utils}/__init__.py | 0 .../brains/{ => gazebo}/f1rl/utils/dqn.py | 0 .../{ => gazebo}/f1rl/utils/liveplot.py | 0 .../brains/{ => gazebo}/f1rl/utils/memory.py | 0 .../brains/{ => gazebo}/f1rl/utils/qlearn.py | 0 .../f1rl/utils/ros_gazebo_pose.py | 0 .../{ => gazebo}/f1rl/utils/settings.py | 0 .../brains/gazebo/turtlebot/__init__.py | 0 .../turtlebot/brain_turtlebot_opencv2.py | 0 .../configs/gazebo/DL-tensorflow.yml | 2 +- .../configs/gazebo/DL-torch-lstm.yml | 2 +- .../configs/gazebo/DL-torch-stacked.yml | 2 +- behavior_metrics/configs/gazebo/DL-torch.yml | 2 +- .../configs/gazebo/default-multiple.yml | 2 +- .../configs/gazebo/default-rl-dqn.yml | 2 +- .../configs/gazebo/default-rl-qlearn.yml | 2 +- behavior_metrics/configs/gazebo/default.yml | 2 +- .../configs/gazebo/torch-multiple.yml | 2 +- behavior_metrics/profiles/default.yml | 2 +- behavior_metrics/robot/configurations/f1.yml | 2 +- .../robot/configurations/f1_laser.yml | 2 +- .../robot/configurations/turtlebot_laser.yml | 2 +- behavior_metrics/ui/tui/main_view.py | 2 +- 129 files changed, 379 insertions(+), 21 deletions(-) rename behavior_metrics/brains/{agents => CARLA/pytorch/utils}/__init__.py (100%) rename behavior_metrics/brains/{f1/torch_utils => CARLA/pytorch/utils}/convlstm.py (100%) rename behavior_metrics/brains/{f1/torch_utils => CARLA/pytorch/utils}/deepest_lstm_tinypilotnet.py (100%) rename behavior_metrics/brains/{f1/torch_utils => CARLA/pytorch/utils}/pilotnet.py (100%) rename behavior_metrics/brains/{f1/torch_utils => CARLA/pytorch/utils}/pilotnetStacked.py (100%) rename behavior_metrics/brains/{agents/f1 => gazebo/agents}/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/.env (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/.env.sample (100%) rename behavior_metrics/brains/{car => gazebo/agents/f1}/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/f1_follow_line_camera_dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/f1_follow_line_qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/liveplot.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/memory.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/ros_gazebo_pose.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1/settings.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1_follow_line_camera_dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/f1_follow_line_qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/liveplot.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/memory.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/ros_gazebo_pose.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/scripts/benchmark_runner (100%) rename behavior_metrics/brains/{ => gazebo}/agents/settings.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/circuit2_turtlebot_lidar_qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/circuit2c_turtlebot_camera_dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/deepq.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/liveplot.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/memory.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/round_turtlebot_lidar_test.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/runtraining_dqn_circuit2_turtlebot_lidar.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/turtlebot/sarsa.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/utilities/averaged_table.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/utilities/camera_visualizer.py (100%) rename behavior_metrics/brains/{ => gazebo}/agents/utilities/display_plot.py (100%) rename behavior_metrics/brains/{drone => gazebo/car}/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/car/brain_car_opencv2.py (100%) rename behavior_metrics/brains/{f1 => gazebo/drone}/__init__.py (100%) mode change 100755 => 100644 rename behavior_metrics/brains/{ => gazebo}/drone/brain_drone_explicit.py (100%) rename behavior_metrics/brains/{f1/torch_utils => gazebo/f1}/__init__.py (100%) mode change 100644 => 100755 rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_dummy.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_explicit.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_follow_line_dqn.py (98%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_follow_line_qlearn.py (98%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras-lstm.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_classification-bw.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_classification.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_opencv_dataset.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed_lstm.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed_lstm_3_elements-60pts.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed_lstm_3_elements.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed_lstm_5_elements.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_preprocessed_v_w.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_scripting.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_seq_3.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_keras_seq_3_opencv_dataset.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_opencv.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_torch-lstm.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_torch.py (98%) rename behavior_metrics/brains/{ => gazebo}/f1/brain_f1_torchstacked.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/config/config_f1_qlearn.yaml (100%) rename behavior_metrics/brains/{ => gazebo}/f1/config/config_inference_followline_dqn_f1_gazebo.yaml (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/algorithms_type.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/dqn_f1.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/exceptions.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/loaders.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/algorithms/qlearn_f1.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/env_type.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/exceptions.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/gazebo_envs.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/image_f1.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/inference.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/f1_env.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/f1_env_camera.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/followline_dqn_tf.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/images.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/reset.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/rewards.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/settings.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/simplified_perception.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/step.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/models/utils.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1/rl_utils/settings.py (100%) rename behavior_metrics/brains/{f1rl => gazebo/f1/torch_utils}/__init__.py (100%) create mode 100644 behavior_metrics/brains/gazebo/f1/torch_utils/convlstm.py create mode 100644 behavior_metrics/brains/gazebo/f1/torch_utils/deepest_lstm_tinypilotnet.py create mode 100644 behavior_metrics/brains/gazebo/f1/torch_utils/pilotnet.py create mode 100644 behavior_metrics/brains/gazebo/f1/torch_utils/pilotnetStacked.py rename behavior_metrics/brains/{f1rl/utils => gazebo/f1rl}/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/brain_f1_dummy.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/f1_follow_line_camera_dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/f1_follow_line_qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/f1_follow_line_qlearn_laser.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/train.py (100%) rename behavior_metrics/brains/{turtlebot => gazebo/f1rl/utils}/__init__.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/dqn.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/liveplot.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/memory.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/qlearn.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/ros_gazebo_pose.py (100%) rename behavior_metrics/brains/{ => gazebo}/f1rl/utils/settings.py (100%) create mode 100644 behavior_metrics/brains/gazebo/turtlebot/__init__.py rename behavior_metrics/brains/{ => gazebo}/turtlebot/brain_turtlebot_opencv2.py (100%) diff --git a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch.py b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch.py index aac2f4af..1c86fb03 100644 --- a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch.py +++ b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch.py @@ -1,5 +1,5 @@ from PIL import Image -from brains.f1.torch_utils.pilotnet import PilotNet +from brains.CARLA.pytorch.utils.pilotnet import PilotNet from utils.constants import PRETRAINED_MODELS_DIR, ROOT_PATH from os import path from albumentations import ( diff --git a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_optimized.py b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_optimized.py index 6bb5d10b..a7b6393d 100644 --- a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_optimized.py +++ b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_optimized.py @@ -1,5 +1,5 @@ from PIL import Image -from brains.f1.torch_utils.pilotnet import PilotNet +from brains.CARLA.pytorch.utils.pilotnet import PilotNet from utils.constants import PRETRAINED_MODELS_DIR, ROOT_PATH from os import path from albumentations import ( diff --git a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_float.py b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_float.py index 46459ea8..1be9db8c 100644 --- a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_float.py +++ b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_float.py @@ -1,5 +1,5 @@ from PIL import Image -from brains.f1.torch_utils.pilotnet import PilotNet +from brains.CARLA.pytorch.utils.pilotnet import PilotNet from utils.constants import PRETRAINED_MODELS_DIR, ROOT_PATH from os import path from albumentations import ( diff --git a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_int_8.py b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_int_8.py index dbc1b1be..d7d05a2d 100644 --- a/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_int_8.py +++ b/behavior_metrics/brains/CARLA/pytorch/brain_carla_bird_eye_deep_learning_torch_tensorrt_int_8.py @@ -1,5 +1,5 @@ from PIL import Image -from brains.f1.torch_utils.pilotnet import PilotNet +from brains.CARLA.pytorch.utils.pilotnet import PilotNet from utils.constants import PRETRAINED_MODELS_DIR, ROOT_PATH from os import path from albumentations import ( diff --git a/behavior_metrics/brains/agents/__init__.py b/behavior_metrics/brains/CARLA/pytorch/utils/__init__.py similarity index 100% rename from behavior_metrics/brains/agents/__init__.py rename to behavior_metrics/brains/CARLA/pytorch/utils/__init__.py diff --git a/behavior_metrics/brains/f1/torch_utils/convlstm.py b/behavior_metrics/brains/CARLA/pytorch/utils/convlstm.py similarity index 100% rename from behavior_metrics/brains/f1/torch_utils/convlstm.py rename to behavior_metrics/brains/CARLA/pytorch/utils/convlstm.py diff --git a/behavior_metrics/brains/f1/torch_utils/deepest_lstm_tinypilotnet.py b/behavior_metrics/brains/CARLA/pytorch/utils/deepest_lstm_tinypilotnet.py similarity index 100% rename from behavior_metrics/brains/f1/torch_utils/deepest_lstm_tinypilotnet.py rename to behavior_metrics/brains/CARLA/pytorch/utils/deepest_lstm_tinypilotnet.py diff --git a/behavior_metrics/brains/f1/torch_utils/pilotnet.py b/behavior_metrics/brains/CARLA/pytorch/utils/pilotnet.py similarity index 100% rename from behavior_metrics/brains/f1/torch_utils/pilotnet.py rename to behavior_metrics/brains/CARLA/pytorch/utils/pilotnet.py diff --git a/behavior_metrics/brains/f1/torch_utils/pilotnetStacked.py b/behavior_metrics/brains/CARLA/pytorch/utils/pilotnetStacked.py similarity index 100% rename from behavior_metrics/brains/f1/torch_utils/pilotnetStacked.py rename to behavior_metrics/brains/CARLA/pytorch/utils/pilotnetStacked.py diff --git a/behavior_metrics/brains/CARLA/tensorflow/brain_carla_bird_eye_deep_learning.py b/behavior_metrics/brains/CARLA/tensorflow/brain_carla_bird_eye_deep_learning.py index 7dbe5377..c58be794 100644 --- a/behavior_metrics/brains/CARLA/tensorflow/brain_carla_bird_eye_deep_learning.py +++ b/behavior_metrics/brains/CARLA/tensorflow/brain_carla_bird_eye_deep_learning.py @@ -136,6 +136,7 @@ def execute(self): self.update_pose(self.pose.getPose3d()) image_shape=(66, 200) + #image_shape=(50, 150) img_base = cv2.resize(bird_eye_view_1, image_shape) AUGMENTATIONS_TEST = Compose([ diff --git a/behavior_metrics/brains/agents/f1/__init__.py b/behavior_metrics/brains/gazebo/agents/__init__.py similarity index 100% rename from behavior_metrics/brains/agents/f1/__init__.py rename to behavior_metrics/brains/gazebo/agents/__init__.py diff --git a/behavior_metrics/brains/agents/dqn.py b/behavior_metrics/brains/gazebo/agents/dqn.py similarity index 100% rename from behavior_metrics/brains/agents/dqn.py rename to behavior_metrics/brains/gazebo/agents/dqn.py diff --git a/behavior_metrics/brains/agents/f1/.env b/behavior_metrics/brains/gazebo/agents/f1/.env similarity index 100% rename from behavior_metrics/brains/agents/f1/.env rename to behavior_metrics/brains/gazebo/agents/f1/.env diff --git a/behavior_metrics/brains/agents/f1/.env.sample b/behavior_metrics/brains/gazebo/agents/f1/.env.sample similarity index 100% rename from behavior_metrics/brains/agents/f1/.env.sample rename to behavior_metrics/brains/gazebo/agents/f1/.env.sample diff --git a/behavior_metrics/brains/car/__init__.py b/behavior_metrics/brains/gazebo/agents/f1/__init__.py similarity index 100% rename from behavior_metrics/brains/car/__init__.py rename to behavior_metrics/brains/gazebo/agents/f1/__init__.py diff --git a/behavior_metrics/brains/agents/f1/dqn.py b/behavior_metrics/brains/gazebo/agents/f1/dqn.py similarity index 100% rename from behavior_metrics/brains/agents/f1/dqn.py rename to behavior_metrics/brains/gazebo/agents/f1/dqn.py diff --git a/behavior_metrics/brains/agents/f1/f1_follow_line_camera_dqn.py b/behavior_metrics/brains/gazebo/agents/f1/f1_follow_line_camera_dqn.py similarity index 100% rename from behavior_metrics/brains/agents/f1/f1_follow_line_camera_dqn.py rename to behavior_metrics/brains/gazebo/agents/f1/f1_follow_line_camera_dqn.py diff --git a/behavior_metrics/brains/agents/f1/f1_follow_line_qlearn.py b/behavior_metrics/brains/gazebo/agents/f1/f1_follow_line_qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/f1/f1_follow_line_qlearn.py rename to behavior_metrics/brains/gazebo/agents/f1/f1_follow_line_qlearn.py diff --git a/behavior_metrics/brains/agents/f1/liveplot.py b/behavior_metrics/brains/gazebo/agents/f1/liveplot.py similarity index 100% rename from behavior_metrics/brains/agents/f1/liveplot.py rename to behavior_metrics/brains/gazebo/agents/f1/liveplot.py diff --git a/behavior_metrics/brains/agents/f1/memory.py b/behavior_metrics/brains/gazebo/agents/f1/memory.py similarity index 100% rename from behavior_metrics/brains/agents/f1/memory.py rename to behavior_metrics/brains/gazebo/agents/f1/memory.py diff --git a/behavior_metrics/brains/agents/f1/qlearn.py b/behavior_metrics/brains/gazebo/agents/f1/qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/f1/qlearn.py rename to behavior_metrics/brains/gazebo/agents/f1/qlearn.py diff --git a/behavior_metrics/brains/agents/f1/ros_gazebo_pose.py b/behavior_metrics/brains/gazebo/agents/f1/ros_gazebo_pose.py similarity index 100% rename from behavior_metrics/brains/agents/f1/ros_gazebo_pose.py rename to behavior_metrics/brains/gazebo/agents/f1/ros_gazebo_pose.py diff --git a/behavior_metrics/brains/agents/f1/settings.py b/behavior_metrics/brains/gazebo/agents/f1/settings.py similarity index 100% rename from behavior_metrics/brains/agents/f1/settings.py rename to behavior_metrics/brains/gazebo/agents/f1/settings.py diff --git a/behavior_metrics/brains/agents/f1_follow_line_camera_dqn.py b/behavior_metrics/brains/gazebo/agents/f1_follow_line_camera_dqn.py similarity index 100% rename from behavior_metrics/brains/agents/f1_follow_line_camera_dqn.py rename to behavior_metrics/brains/gazebo/agents/f1_follow_line_camera_dqn.py diff --git a/behavior_metrics/brains/agents/f1_follow_line_qlearn.py b/behavior_metrics/brains/gazebo/agents/f1_follow_line_qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/f1_follow_line_qlearn.py rename to behavior_metrics/brains/gazebo/agents/f1_follow_line_qlearn.py diff --git a/behavior_metrics/brains/agents/liveplot.py b/behavior_metrics/brains/gazebo/agents/liveplot.py similarity index 100% rename from behavior_metrics/brains/agents/liveplot.py rename to behavior_metrics/brains/gazebo/agents/liveplot.py diff --git a/behavior_metrics/brains/agents/memory.py b/behavior_metrics/brains/gazebo/agents/memory.py similarity index 100% rename from behavior_metrics/brains/agents/memory.py rename to behavior_metrics/brains/gazebo/agents/memory.py diff --git a/behavior_metrics/brains/agents/qlearn.py b/behavior_metrics/brains/gazebo/agents/qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/qlearn.py rename to behavior_metrics/brains/gazebo/agents/qlearn.py diff --git a/behavior_metrics/brains/agents/ros_gazebo_pose.py b/behavior_metrics/brains/gazebo/agents/ros_gazebo_pose.py similarity index 100% rename from behavior_metrics/brains/agents/ros_gazebo_pose.py rename to behavior_metrics/brains/gazebo/agents/ros_gazebo_pose.py diff --git a/behavior_metrics/brains/agents/scripts/benchmark_runner b/behavior_metrics/brains/gazebo/agents/scripts/benchmark_runner similarity index 100% rename from behavior_metrics/brains/agents/scripts/benchmark_runner rename to behavior_metrics/brains/gazebo/agents/scripts/benchmark_runner diff --git a/behavior_metrics/brains/agents/settings.py b/behavior_metrics/brains/gazebo/agents/settings.py similarity index 100% rename from behavior_metrics/brains/agents/settings.py rename to behavior_metrics/brains/gazebo/agents/settings.py diff --git a/behavior_metrics/brains/agents/turtlebot/circuit2_turtlebot_lidar_qlearn.py b/behavior_metrics/brains/gazebo/agents/turtlebot/circuit2_turtlebot_lidar_qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/circuit2_turtlebot_lidar_qlearn.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/circuit2_turtlebot_lidar_qlearn.py diff --git a/behavior_metrics/brains/agents/turtlebot/circuit2c_turtlebot_camera_dqn.py b/behavior_metrics/brains/gazebo/agents/turtlebot/circuit2c_turtlebot_camera_dqn.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/circuit2c_turtlebot_camera_dqn.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/circuit2c_turtlebot_camera_dqn.py diff --git a/behavior_metrics/brains/agents/turtlebot/deepq.py b/behavior_metrics/brains/gazebo/agents/turtlebot/deepq.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/deepq.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/deepq.py diff --git a/behavior_metrics/brains/agents/turtlebot/liveplot.py b/behavior_metrics/brains/gazebo/agents/turtlebot/liveplot.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/liveplot.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/liveplot.py diff --git a/behavior_metrics/brains/agents/turtlebot/memory.py b/behavior_metrics/brains/gazebo/agents/turtlebot/memory.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/memory.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/memory.py diff --git a/behavior_metrics/brains/agents/turtlebot/qlearn.py b/behavior_metrics/brains/gazebo/agents/turtlebot/qlearn.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/qlearn.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/qlearn.py diff --git a/behavior_metrics/brains/agents/turtlebot/round_turtlebot_lidar_test.py b/behavior_metrics/brains/gazebo/agents/turtlebot/round_turtlebot_lidar_test.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/round_turtlebot_lidar_test.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/round_turtlebot_lidar_test.py diff --git a/behavior_metrics/brains/agents/turtlebot/runtraining_dqn_circuit2_turtlebot_lidar.py b/behavior_metrics/brains/gazebo/agents/turtlebot/runtraining_dqn_circuit2_turtlebot_lidar.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/runtraining_dqn_circuit2_turtlebot_lidar.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/runtraining_dqn_circuit2_turtlebot_lidar.py diff --git a/behavior_metrics/brains/agents/turtlebot/sarsa.py b/behavior_metrics/brains/gazebo/agents/turtlebot/sarsa.py similarity index 100% rename from behavior_metrics/brains/agents/turtlebot/sarsa.py rename to behavior_metrics/brains/gazebo/agents/turtlebot/sarsa.py diff --git a/behavior_metrics/brains/agents/utilities/averaged_table.py b/behavior_metrics/brains/gazebo/agents/utilities/averaged_table.py similarity index 100% rename from behavior_metrics/brains/agents/utilities/averaged_table.py rename to behavior_metrics/brains/gazebo/agents/utilities/averaged_table.py diff --git a/behavior_metrics/brains/agents/utilities/camera_visualizer.py b/behavior_metrics/brains/gazebo/agents/utilities/camera_visualizer.py similarity index 100% rename from behavior_metrics/brains/agents/utilities/camera_visualizer.py rename to behavior_metrics/brains/gazebo/agents/utilities/camera_visualizer.py diff --git a/behavior_metrics/brains/agents/utilities/display_plot.py b/behavior_metrics/brains/gazebo/agents/utilities/display_plot.py similarity index 100% rename from behavior_metrics/brains/agents/utilities/display_plot.py rename to behavior_metrics/brains/gazebo/agents/utilities/display_plot.py diff --git a/behavior_metrics/brains/drone/__init__.py b/behavior_metrics/brains/gazebo/car/__init__.py similarity index 100% rename from behavior_metrics/brains/drone/__init__.py rename to behavior_metrics/brains/gazebo/car/__init__.py diff --git a/behavior_metrics/brains/car/brain_car_opencv2.py b/behavior_metrics/brains/gazebo/car/brain_car_opencv2.py similarity index 100% rename from behavior_metrics/brains/car/brain_car_opencv2.py rename to behavior_metrics/brains/gazebo/car/brain_car_opencv2.py diff --git a/behavior_metrics/brains/f1/__init__.py b/behavior_metrics/brains/gazebo/drone/__init__.py old mode 100755 new mode 100644 similarity index 100% rename from behavior_metrics/brains/f1/__init__.py rename to behavior_metrics/brains/gazebo/drone/__init__.py diff --git a/behavior_metrics/brains/drone/brain_drone_explicit.py b/behavior_metrics/brains/gazebo/drone/brain_drone_explicit.py similarity index 100% rename from behavior_metrics/brains/drone/brain_drone_explicit.py rename to behavior_metrics/brains/gazebo/drone/brain_drone_explicit.py diff --git a/behavior_metrics/brains/f1/torch_utils/__init__.py b/behavior_metrics/brains/gazebo/f1/__init__.py old mode 100644 new mode 100755 similarity index 100% rename from behavior_metrics/brains/f1/torch_utils/__init__.py rename to behavior_metrics/brains/gazebo/f1/__init__.py diff --git a/behavior_metrics/brains/f1/brain_f1_dummy.py b/behavior_metrics/brains/gazebo/f1/brain_f1_dummy.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_dummy.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_dummy.py diff --git a/behavior_metrics/brains/f1/brain_f1_explicit.py b/behavior_metrics/brains/gazebo/f1/brain_f1_explicit.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_explicit.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_explicit.py diff --git a/behavior_metrics/brains/f1/brain_f1_follow_line_dqn.py b/behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_dqn.py similarity index 98% rename from behavior_metrics/brains/f1/brain_f1_follow_line_dqn.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_dqn.py index b3ba8397..7583c4ef 100644 --- a/behavior_metrics/brains/f1/brain_f1_follow_line_dqn.py +++ b/behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_dqn.py @@ -154,7 +154,7 @@ def __init__(self, sensors, actuators, handler, config=None): 'algorithm': 'dqn', 'environment': 'simple', 'agent': 'f1', - 'filename': 'brains/f1/config/config_inference_followline_dqn_f1_gazebo.yaml' + 'filename': 'brains/gazebo/f1/config/config_inference_followline_dqn_f1_gazebo.yaml' } f = open(args['filename'], "r") diff --git a/behavior_metrics/brains/f1/brain_f1_follow_line_qlearn.py b/behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_qlearn.py similarity index 98% rename from behavior_metrics/brains/f1/brain_f1_follow_line_qlearn.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_qlearn.py index d79ca355..86e20b4a 100644 --- a/behavior_metrics/brains/f1/brain_f1_follow_line_qlearn.py +++ b/behavior_metrics/brains/gazebo/f1/brain_f1_follow_line_qlearn.py @@ -44,7 +44,7 @@ def __init__(self, sensors, actuators, handler, config=None): 'algorithm': 'qlearn', 'environment': 'simple', 'agent': 'f1', - 'filename': 'brains/f1/config/config_f1_qlearn.yaml' + 'filename': 'brains/gazebo/sf1/config/config_f1_qlearn.yaml' } f = open(args['filename'], "r") diff --git a/behavior_metrics/brains/f1/brain_f1_keras-lstm.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras-lstm.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras-lstm.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras-lstm.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_classification-bw.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_classification-bw.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_classification-bw.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_classification-bw.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_classification.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_classification.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_classification.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_classification.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_opencv_dataset.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_opencv_dataset.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_opencv_dataset.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_opencv_dataset.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_3_elements-60pts.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_3_elements-60pts.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_3_elements-60pts.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_3_elements-60pts.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_3_elements.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_3_elements.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_3_elements.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_3_elements.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_5_elements.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_5_elements.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed_lstm_5_elements.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_lstm_5_elements.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_preprocessed_v_w.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_v_w.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_preprocessed_v_w.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_preprocessed_v_w.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_scripting.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_scripting.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_scripting.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_scripting.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_seq_3.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_seq_3.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_seq_3.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_seq_3.py diff --git a/behavior_metrics/brains/f1/brain_f1_keras_seq_3_opencv_dataset.py b/behavior_metrics/brains/gazebo/f1/brain_f1_keras_seq_3_opencv_dataset.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_keras_seq_3_opencv_dataset.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_keras_seq_3_opencv_dataset.py diff --git a/behavior_metrics/brains/f1/brain_f1_opencv.py b/behavior_metrics/brains/gazebo/f1/brain_f1_opencv.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_opencv.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_opencv.py diff --git a/behavior_metrics/brains/f1/brain_f1_torch-lstm.py b/behavior_metrics/brains/gazebo/f1/brain_f1_torch-lstm.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_torch-lstm.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_torch-lstm.py diff --git a/behavior_metrics/brains/f1/brain_f1_torch.py b/behavior_metrics/brains/gazebo/f1/brain_f1_torch.py similarity index 98% rename from behavior_metrics/brains/f1/brain_f1_torch.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_torch.py index 82ed5bd2..7c063354 100644 --- a/behavior_metrics/brains/f1/brain_f1_torch.py +++ b/behavior_metrics/brains/gazebo/f1/brain_f1_torch.py @@ -17,7 +17,7 @@ import time import os from PIL import Image -from brains.f1.torch_utils.pilotnet import PilotNet +from brains.gazebo.f1.torch_utils.pilotnet import PilotNetss from utils.constants import PRETRAINED_MODELS_DIR, ROOT_PATH from os import path diff --git a/behavior_metrics/brains/f1/brain_f1_torchstacked.py b/behavior_metrics/brains/gazebo/f1/brain_f1_torchstacked.py similarity index 100% rename from behavior_metrics/brains/f1/brain_f1_torchstacked.py rename to behavior_metrics/brains/gazebo/f1/brain_f1_torchstacked.py diff --git a/behavior_metrics/brains/f1/config/config_f1_qlearn.yaml b/behavior_metrics/brains/gazebo/f1/config/config_f1_qlearn.yaml similarity index 100% rename from behavior_metrics/brains/f1/config/config_f1_qlearn.yaml rename to behavior_metrics/brains/gazebo/f1/config/config_f1_qlearn.yaml diff --git a/behavior_metrics/brains/f1/config/config_inference_followline_dqn_f1_gazebo.yaml b/behavior_metrics/brains/gazebo/f1/config/config_inference_followline_dqn_f1_gazebo.yaml similarity index 100% rename from behavior_metrics/brains/f1/config/config_inference_followline_dqn_f1_gazebo.yaml rename to behavior_metrics/brains/gazebo/f1/config/config_inference_followline_dqn_f1_gazebo.yaml diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/__init__.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/__init__.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/__init__.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/__init__.py diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/algorithms_type.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/algorithms_type.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/algorithms_type.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/algorithms_type.py diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/dqn_f1.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/dqn_f1.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/dqn_f1.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/dqn_f1.py diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/exceptions.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/exceptions.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/exceptions.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/exceptions.py diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/loaders.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/loaders.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/loaders.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/loaders.py diff --git a/behavior_metrics/brains/f1/rl_utils/algorithms/qlearn_f1.py b/behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/qlearn_f1.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/algorithms/qlearn_f1.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/algorithms/qlearn_f1.py diff --git a/behavior_metrics/brains/f1/rl_utils/env_type.py b/behavior_metrics/brains/gazebo/f1/rl_utils/env_type.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/env_type.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/env_type.py diff --git a/behavior_metrics/brains/f1/rl_utils/exceptions.py b/behavior_metrics/brains/gazebo/f1/rl_utils/exceptions.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/exceptions.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/exceptions.py diff --git a/behavior_metrics/brains/f1/rl_utils/gazebo_envs.py b/behavior_metrics/brains/gazebo/f1/rl_utils/gazebo_envs.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/gazebo_envs.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/gazebo_envs.py diff --git a/behavior_metrics/brains/f1/rl_utils/image_f1.py b/behavior_metrics/brains/gazebo/f1/rl_utils/image_f1.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/image_f1.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/image_f1.py diff --git a/behavior_metrics/brains/f1/rl_utils/inference.py b/behavior_metrics/brains/gazebo/f1/rl_utils/inference.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/inference.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/inference.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/__init__.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/__init__.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/__init__.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/__init__.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/f1_env.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/f1_env.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/f1_env.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/f1_env.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/f1_env_camera.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/f1_env_camera.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/f1_env_camera.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/f1_env_camera.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/followline_dqn_tf.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/followline_dqn_tf.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/followline_dqn_tf.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/followline_dqn_tf.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/images.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/images.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/images.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/images.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/reset.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/reset.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/reset.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/reset.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/rewards.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/rewards.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/rewards.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/rewards.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/settings.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/settings.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/settings.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/settings.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/simplified_perception.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/simplified_perception.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/simplified_perception.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/simplified_perception.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/step.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/step.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/step.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/step.py diff --git a/behavior_metrics/brains/f1/rl_utils/models/utils.py b/behavior_metrics/brains/gazebo/f1/rl_utils/models/utils.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/models/utils.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/models/utils.py diff --git a/behavior_metrics/brains/f1/rl_utils/settings.py b/behavior_metrics/brains/gazebo/f1/rl_utils/settings.py similarity index 100% rename from behavior_metrics/brains/f1/rl_utils/settings.py rename to behavior_metrics/brains/gazebo/f1/rl_utils/settings.py diff --git a/behavior_metrics/brains/f1rl/__init__.py b/behavior_metrics/brains/gazebo/f1/torch_utils/__init__.py similarity index 100% rename from behavior_metrics/brains/f1rl/__init__.py rename to behavior_metrics/brains/gazebo/f1/torch_utils/__init__.py diff --git a/behavior_metrics/brains/gazebo/f1/torch_utils/convlstm.py b/behavior_metrics/brains/gazebo/f1/torch_utils/convlstm.py new file mode 100644 index 00000000..678caa74 --- /dev/null +++ b/behavior_metrics/brains/gazebo/f1/torch_utils/convlstm.py @@ -0,0 +1,195 @@ +""" +This implementation of Convolutional LSTM has been adapted from https://github.com/ndrplz/ConvLSTM_pytorch. +""" + +import torch.nn as nn +import torch + + +class ConvLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, kernel_size, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: (int, int) + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + """ + + super(ConvLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + + self.kernel_size = kernel_size + self.padding = kernel_size[0] // 2, kernel_size[1] // 2 + self.bias = bias + + self.conv = nn.Conv2d(in_channels=self.input_dim + self.hidden_dim, + out_channels=4 * self.hidden_dim, + kernel_size=self.kernel_size, + padding=self.padding, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=1) # concatenate along channel axis + + combined_conv = self.conv(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_conv, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size, image_size): + height, width = image_size + return (torch.zeros(batch_size, self.hidden_dim, height, width, device=self.conv.weight.device), + torch.zeros(batch_size, self.hidden_dim, height, width, device=self.conv.weight.device)) + + +class ConvLSTM(nn.Module): + + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C, H, W or T, B, C, H, W + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64, 128, 128)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, kernel_size, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(ConvLSTM, self).__init__() + + self._check_kernel_size_consistency(kernel_size) + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + kernel_size = self._extend_for_multilayer(kernel_size, num_layers) + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(kernel_size) == len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.kernel_size = kernel_size + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append(ConvLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + kernel_size=self.kernel_size[i], + bias=self.bias)) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c, h, w) or (b, t, c, h, w) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + if not self.batch_first: + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2, 3, 4) + + b, _, _, h, w = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b, + image_size=(h, w)) + + layer_output_list = [] + last_state_list = [] + + seq_len = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(seq_len): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :, :, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size, image_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size, image_size)) + return init_states + + @staticmethod + def _check_kernel_size_consistency(kernel_size): + if not (isinstance(kernel_size, tuple) or + (isinstance(kernel_size, list) and all([isinstance(elem, tuple) for elem in kernel_size]))): + raise ValueError('`kernel_size` must be tuple or list of tuples') + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param \ No newline at end of file diff --git a/behavior_metrics/brains/gazebo/f1/torch_utils/deepest_lstm_tinypilotnet.py b/behavior_metrics/brains/gazebo/f1/torch_utils/deepest_lstm_tinypilotnet.py new file mode 100644 index 00000000..4affa175 --- /dev/null +++ b/behavior_metrics/brains/gazebo/f1/torch_utils/deepest_lstm_tinypilotnet.py @@ -0,0 +1,45 @@ +import torch +import torch.nn as nn +from .convlstm import ConvLSTM + +class DeepestLSTMTinyPilotNet(nn.Module): + def __init__(self, image_shape, num_labels): + super(DeepestLSTMTinyPilotNet, self).__init__() + self.num_channels = image_shape[2] + self.cn_1 = nn.Conv2d(self.num_channels, 8, kernel_size=3, stride=2) + self.relu_1 = nn.ReLU() + self.cn_2 = nn.Conv2d(8, 8, kernel_size=3, stride=2) + self.relu_2 = nn.ReLU() + self.cn_3 = nn.Conv2d(8, 8, kernel_size=3, stride=2) + self.relu_3 = nn.ReLU() + self.dropout_1 = nn.Dropout(0.2) + + self.clstm_n = ConvLSTM(8, 8, (5, 5), 3, batch_first=True, bias=True, return_all_layers=False) + + self.fc_1 = nn.Linear(8*11*5, 50) + self.relu_fc_1 = nn.ReLU() + self.fc_2 = nn.Linear(50, 10) + self.relu_fc_2 = nn.ReLU() + self.fc_3 = nn.Linear(10, num_labels) + + def forward(self, img): + out = self.cn_1(img) + out = self.relu_1(out) + out = self.cn_2(out) + out = self.relu_2(out) + out = self.cn_3(out) + out = self.relu_3(out) + out = self.dropout_1(out) + # add additional dimension at 1 + out = out.unsqueeze(1) + + _, last_states = self.clstm_n(out) + out = last_states[0][0] # 0 for layer index, 0 for h index + # flatten + out = out.reshape(out.size(0), -1) + out = self.fc_1(out) + out = self.relu_fc_1(out) + out = self.fc_2(out) + out = self.relu_fc_2(out) + out = self.fc_3(out) + return out diff --git a/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnet.py b/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnet.py new file mode 100644 index 00000000..153928ae --- /dev/null +++ b/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnet.py @@ -0,0 +1,58 @@ +import torch +import torch.nn as nn + + +class PilotNet(nn.Module): + def __init__(self, + image_shape, + num_labels): + super(PilotNet, self).__init__() + + self.img_height = image_shape[0] + self.img_width = image_shape[1] + self.num_channels = image_shape[2] + + self.output_size = num_labels + + self.ln_1 = nn.BatchNorm2d(self.num_channels, eps=1e-03) + + self.cn_1 = nn.Conv2d(self.num_channels, 24, kernel_size=5, stride=2) + self.cn_2 = nn.Conv2d(24, 36, kernel_size=5, stride=2) + self.cn_3 = nn.Conv2d(36, 48, kernel_size=5, stride=2) + self.cn_4 = nn.Conv2d(48, 64, kernel_size=3, stride=1) + self.cn_5 = nn.Conv2d(64, 64, kernel_size=3, stride=1) + + self.fc_1 = nn.Linear(1 * 18 * 64, 1164) + self.fc_2 = nn.Linear(1164, 100) + self.fc_3 = nn.Linear(100, 50) + self.fc_4 = nn.Linear(50, 10) + self.fc_5 = nn.Linear(10, self.output_size) + + def forward(self, img): + + out = self.ln_1(img) + + out = self.cn_1(out) + out = torch.relu(out) + out = self.cn_2(out) + out = torch.relu(out) + out = self.cn_3(out) + out = torch.relu(out) + out = self.cn_4(out) + out = torch.relu(out) + out = self.cn_5(out) + out = torch.relu(out) + + out = out.reshape(out.size(0), -1) + + out = self.fc_1(out) + out = torch.relu(out) + out = self.fc_2(out) + out = torch.relu(out) + out = self.fc_3(out) + out = torch.relu(out) + out = self.fc_4(out) + out = torch.relu(out) + out = self.fc_5(out) + + return out diff --git a/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnetStacked.py b/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnetStacked.py new file mode 100644 index 00000000..6d72e6bf --- /dev/null +++ b/behavior_metrics/brains/gazebo/f1/torch_utils/pilotnetStacked.py @@ -0,0 +1,59 @@ +import torch +import torch.nn as nn + + +class PilotNet(nn.Module): + def __init__(self, + image_shape, + num_labels, + horizon): + super(PilotNet, self).__init__() + + self.img_height = image_shape[0] + self.img_width = image_shape[1] + self.num_channels = horizon * image_shape[2] + + self.output_size = num_labels + + self.ln_1 = nn.BatchNorm2d(self.num_channels, eps=1e-03) + + self.cn_1 = nn.Conv2d(self.num_channels, 36, kernel_size=5, stride=2) + self.cn_2 = nn.Conv2d(36, 48, kernel_size=5, stride=2) + self.cn_3 = nn.Conv2d(48, 64, kernel_size=5, stride=2) + self.cn_4 = nn.Conv2d(64, 80, kernel_size=3, stride=1) + self.cn_5 = nn.Conv2d(80, 80, kernel_size=3, stride=1) + + self.fc_1 = nn.Linear(1 * 18 * 80, 1164) + self.fc_2 = nn.Linear(1164, 100) + self.fc_3 = nn.Linear(100, 50) + self.fc_4 = nn.Linear(50, 10) + self.fc_5 = nn.Linear(10, self.output_size) + + def forward(self, img): + + out = self.ln_1(img) + + out = self.cn_1(out) + out = torch.relu(out) + out = self.cn_2(out) + out = torch.relu(out) + out = self.cn_3(out) + out = torch.relu(out) + out = self.cn_4(out) + out = torch.relu(out) + out = self.cn_5(out) + out = torch.relu(out) + + out = out.reshape(out.size(0), -1) + + out = self.fc_1(out) + out = torch.relu(out) + out = self.fc_2(out) + out = torch.relu(out) + out = self.fc_3(out) + out = torch.relu(out) + out = self.fc_4(out) + out = torch.relu(out) + out = self.fc_5(out) + + return out \ No newline at end of file diff --git a/behavior_metrics/brains/f1rl/utils/__init__.py b/behavior_metrics/brains/gazebo/f1rl/__init__.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/__init__.py rename to behavior_metrics/brains/gazebo/f1rl/__init__.py diff --git a/behavior_metrics/brains/f1rl/brain_f1_dummy.py b/behavior_metrics/brains/gazebo/f1rl/brain_f1_dummy.py similarity index 100% rename from behavior_metrics/brains/f1rl/brain_f1_dummy.py rename to behavior_metrics/brains/gazebo/f1rl/brain_f1_dummy.py diff --git a/behavior_metrics/brains/f1rl/f1_follow_line_camera_dqn.py b/behavior_metrics/brains/gazebo/f1rl/f1_follow_line_camera_dqn.py similarity index 100% rename from behavior_metrics/brains/f1rl/f1_follow_line_camera_dqn.py rename to behavior_metrics/brains/gazebo/f1rl/f1_follow_line_camera_dqn.py diff --git a/behavior_metrics/brains/f1rl/f1_follow_line_qlearn.py b/behavior_metrics/brains/gazebo/f1rl/f1_follow_line_qlearn.py similarity index 100% rename from behavior_metrics/brains/f1rl/f1_follow_line_qlearn.py rename to behavior_metrics/brains/gazebo/f1rl/f1_follow_line_qlearn.py diff --git a/behavior_metrics/brains/f1rl/f1_follow_line_qlearn_laser.py b/behavior_metrics/brains/gazebo/f1rl/f1_follow_line_qlearn_laser.py similarity index 100% rename from behavior_metrics/brains/f1rl/f1_follow_line_qlearn_laser.py rename to behavior_metrics/brains/gazebo/f1rl/f1_follow_line_qlearn_laser.py diff --git a/behavior_metrics/brains/f1rl/train.py b/behavior_metrics/brains/gazebo/f1rl/train.py similarity index 100% rename from behavior_metrics/brains/f1rl/train.py rename to behavior_metrics/brains/gazebo/f1rl/train.py diff --git a/behavior_metrics/brains/turtlebot/__init__.py b/behavior_metrics/brains/gazebo/f1rl/utils/__init__.py similarity index 100% rename from behavior_metrics/brains/turtlebot/__init__.py rename to behavior_metrics/brains/gazebo/f1rl/utils/__init__.py diff --git a/behavior_metrics/brains/f1rl/utils/dqn.py b/behavior_metrics/brains/gazebo/f1rl/utils/dqn.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/dqn.py rename to behavior_metrics/brains/gazebo/f1rl/utils/dqn.py diff --git a/behavior_metrics/brains/f1rl/utils/liveplot.py b/behavior_metrics/brains/gazebo/f1rl/utils/liveplot.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/liveplot.py rename to behavior_metrics/brains/gazebo/f1rl/utils/liveplot.py diff --git a/behavior_metrics/brains/f1rl/utils/memory.py b/behavior_metrics/brains/gazebo/f1rl/utils/memory.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/memory.py rename to behavior_metrics/brains/gazebo/f1rl/utils/memory.py diff --git a/behavior_metrics/brains/f1rl/utils/qlearn.py b/behavior_metrics/brains/gazebo/f1rl/utils/qlearn.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/qlearn.py rename to behavior_metrics/brains/gazebo/f1rl/utils/qlearn.py diff --git a/behavior_metrics/brains/f1rl/utils/ros_gazebo_pose.py b/behavior_metrics/brains/gazebo/f1rl/utils/ros_gazebo_pose.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/ros_gazebo_pose.py rename to behavior_metrics/brains/gazebo/f1rl/utils/ros_gazebo_pose.py diff --git a/behavior_metrics/brains/f1rl/utils/settings.py b/behavior_metrics/brains/gazebo/f1rl/utils/settings.py similarity index 100% rename from behavior_metrics/brains/f1rl/utils/settings.py rename to behavior_metrics/brains/gazebo/f1rl/utils/settings.py diff --git a/behavior_metrics/brains/gazebo/turtlebot/__init__.py b/behavior_metrics/brains/gazebo/turtlebot/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/behavior_metrics/brains/turtlebot/brain_turtlebot_opencv2.py b/behavior_metrics/brains/gazebo/turtlebot/brain_turtlebot_opencv2.py similarity index 100% rename from behavior_metrics/brains/turtlebot/brain_turtlebot_opencv2.py rename to behavior_metrics/brains/gazebo/turtlebot/brain_turtlebot_opencv2.py diff --git a/behavior_metrics/configs/gazebo/DL-tensorflow.yml b/behavior_metrics/configs/gazebo/DL-tensorflow.yml index 84e4a0c6..9383c7cd 100644 --- a/behavior_metrics/configs/gazebo/DL-tensorflow.yml +++ b/behavior_metrics/configs/gazebo/DL-tensorflow.yml @@ -17,7 +17,7 @@ Behaviors: MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_keras.py' + BrainPath: 'brains/gazebo/f1/brain_f1_keras.py' PilotTimeCycle: 50 Parameters: Model: '[model_name].h5' diff --git a/behavior_metrics/configs/gazebo/DL-torch-lstm.yml b/behavior_metrics/configs/gazebo/DL-torch-lstm.yml index 8f7d639e..38c12de0 100644 --- a/behavior_metrics/configs/gazebo/DL-torch-lstm.yml +++ b/behavior_metrics/configs/gazebo/DL-torch-lstm.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_torch-lstm.py' + BrainPath: 'brains/gazebo/ssf1/brain_f1_torch-lstm.py' PilotTimeCycle: 50 Parameters: Model: 'model_lstm_pilotnet_torch.ckpt' diff --git a/behavior_metrics/configs/gazebo/DL-torch-stacked.yml b/behavior_metrics/configs/gazebo/DL-torch-stacked.yml index ec6432b1..87b7c122 100644 --- a/behavior_metrics/configs/gazebo/DL-torch-stacked.yml +++ b/behavior_metrics/configs/gazebo/DL-torch-stacked.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_torchstacked.py' + BrainPath: 'brains/gazebo/f1/brain_f1_torchstacked.py' PilotTimeCycle: 50 Parameters: Model: 'model_pilotnet_torch_h5_extreme.ckpt' diff --git a/behavior_metrics/configs/gazebo/DL-torch.yml b/behavior_metrics/configs/gazebo/DL-torch.yml index 6ddf6782..8b9f1ea6 100644 --- a/behavior_metrics/configs/gazebo/DL-torch.yml +++ b/behavior_metrics/configs/gazebo/DL-torch.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_torch.py' + BrainPath: 'brains/gazebo/f1/brain_f1_torch.py' PilotTimeCycle: 50 Parameters: Model: 'baseline.pth' diff --git a/behavior_metrics/configs/gazebo/default-multiple.yml b/behavior_metrics/configs/gazebo/default-multiple.yml index 58da4295..d8facdb9 100644 --- a/behavior_metrics/configs/gazebo/default-multiple.yml +++ b/behavior_metrics/configs/gazebo/default-multiple.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: ['brains/f1/brain_f1_follow_line_dqn.py', 'brains/f1/brain_f1_follow_line_qlearn.py'] + BrainPath: ['brains/gazebo/f1/brain_f1_follow_line_dqn.py', 'brains/gazebo/f1/brain_f1_follow_line_qlearn.py'] PilotTimeCycle: 50 Parameters: # Model: ['model_deepest_lstm_cropped_250_norm_max_pooling.h5', 'model_deepest_lstm_cropped_250_norm_test.h5'] diff --git a/behavior_metrics/configs/gazebo/default-rl-dqn.yml b/behavior_metrics/configs/gazebo/default-rl-dqn.yml index a9fa160c..60e51aa4 100644 --- a/behavior_metrics/configs/gazebo/default-rl-dqn.yml +++ b/behavior_metrics/configs/gazebo/default-rl-dqn.yml @@ -17,7 +17,7 @@ Behaviors: MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_follow_line_dqn.py' + BrainPath: 'brains/gazebo/f1/brain_f1_follow_line_dqn.py' PilotTimeCycle: 50 Parameters: ImageTranform: '' diff --git a/behavior_metrics/configs/gazebo/default-rl-qlearn.yml b/behavior_metrics/configs/gazebo/default-rl-qlearn.yml index 1f220904..43c1f04e 100644 --- a/behavior_metrics/configs/gazebo/default-rl-qlearn.yml +++ b/behavior_metrics/configs/gazebo/default-rl-qlearn.yml @@ -17,7 +17,7 @@ Behaviors: MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_follow_line_qlearn.py' + BrainPath: 'brains/gazebo/f1/brain_f1_follow_line_qlearn.py' PilotTimeCycle: 50 Parameters: ImageTranform: '' diff --git a/behavior_metrics/configs/gazebo/default.yml b/behavior_metrics/configs/gazebo/default.yml index ee29f3be..65e26565 100644 --- a/behavior_metrics/configs/gazebo/default.yml +++ b/behavior_metrics/configs/gazebo/default.yml @@ -17,7 +17,7 @@ Behaviors: MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_opencv.py' + BrainPath: 'brains/gazebo/f1/brain_f1_opencv.py' PilotTimeCycle: 50 Parameters: ImageTranform: '' diff --git a/behavior_metrics/configs/gazebo/torch-multiple.yml b/behavior_metrics/configs/gazebo/torch-multiple.yml index 8510feed..cf50acab 100644 --- a/behavior_metrics/configs/gazebo/torch-multiple.yml +++ b/behavior_metrics/configs/gazebo/torch-multiple.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: ['brains/f1/brain_f1_torch.py', 'brains/f1/brain_f1_torch.py', 'brains/f1/brain_f1_torch.py', 'brains/f1/brain_f1_torch.py', 'brains/f1/brain_f1_torch.py'] + BrainPath: ['brains/gazebo/f1/brain_f1_torch.py', 'brains/gazebo/f1/brain_f1_torch.py', 'brains/gazebo/f1/brain_f1_torch.py', 'brains/gazebo/f1/brain_f1_torch.py', 'brains/gazebo/f1/brain_f1_torch.py'] PilotTimeCycle: 50 Parameters: Model: ['model_pilotnet_torch.ckpt', 'model_pilotnet_torch.ckpt', 'model_pilotnet_torch.ckpt', 'model_pilotnet_torch.ckpt', 'model_pilotnet_torch.ckpt'] diff --git a/behavior_metrics/profiles/default.yml b/behavior_metrics/profiles/default.yml index 7e9f6644..d092cc9b 100644 --- a/behavior_metrics/profiles/default.yml +++ b/behavior_metrics/profiles/default.yml @@ -16,7 +16,7 @@ Behaviors: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_opencv.py' + BrainPath: 'brains/gazebo/f1/brain_f1_opencv.py' Type: 'f1' Simulation: World: /opt/jderobot/share/jderobot/gazebo/launch/simple_circuit.launch diff --git a/behavior_metrics/robot/configurations/f1.yml b/behavior_metrics/robot/configurations/f1.yml index da76327b..21454dd7 100644 --- a/behavior_metrics/robot/configurations/f1.yml +++ b/behavior_metrics/robot/configurations/f1.yml @@ -15,5 +15,5 @@ Robot: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_opencv.py' + BrainPath: 'brains/gazebo/f1/brain_f1_opencv.py' Type: 'formula1' \ No newline at end of file diff --git a/behavior_metrics/robot/configurations/f1_laser.yml b/behavior_metrics/robot/configurations/f1_laser.yml index 4c122006..591a3a93 100644 --- a/behavior_metrics/robot/configurations/f1_laser.yml +++ b/behavior_metrics/robot/configurations/f1_laser.yml @@ -19,5 +19,5 @@ Robot: Topic: '/F1ROS/cmd_vel' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_opencv.py' + BrainPath: 'brains/gazebo/f1/brain_f1_opencv.py' Type: 'formula1' \ No newline at end of file diff --git a/behavior_metrics/robot/configurations/turtlebot_laser.yml b/behavior_metrics/robot/configurations/turtlebot_laser.yml index 47e71a89..44f5c67d 100644 --- a/behavior_metrics/robot/configurations/turtlebot_laser.yml +++ b/behavior_metrics/robot/configurations/turtlebot_laser.yml @@ -22,5 +22,5 @@ Robot: Topic: '/turtlebotROS/mobile_base/commands/velocity' MaxV: 3 MaxW: 0.3 - BrainPath: 'brains/f1/brain_f1_opencv2.py' + BrainPath: 'brains/gazebo/f1/brain_f1_opencv2.py' Type: 'turtlebot' \ No newline at end of file diff --git a/behavior_metrics/ui/tui/main_view.py b/behavior_metrics/ui/tui/main_view.py index 669fceb1..ebd23136 100644 --- a/behavior_metrics/ui/tui/main_view.py +++ b/behavior_metrics/ui/tui/main_view.py @@ -12,7 +12,7 @@ # This application class serves as a wrapper for the initialization of curses # and also manages the actual forms of the application -brains_dir = ROOT_PATH + '/brains/f1/brain_f1_opencv.py' +brains_dir = ROOT_PATH + '/brains/gazebo/f1/brain_f1_opencv.py' dset_dir = ROOT_PATH + '/datasets/' logs_dir = ROOT_PATH + '/logs/' logs_path = ROOT_PATH + '/logs/log.log'