From 28bafb367f5034cd2d2f69aae9f6226c0943f7c2 Mon Sep 17 00:00:00 2001 From: Spencer Teetaert Date: Wed, 8 Jun 2022 17:33:27 -0400 Subject: [PATCH] Fixed circular imports by moving enums to separate file. Removed unecessary imports --- assignments/aer1216_fall2020_hw2_sim.py | 2 +- examples/compare.py | 2 +- examples/downwash.py | 2 +- examples/fly.py | 2 +- examples/groundeffect.py | 2 +- examples/velocity.py | 2 +- experiments/learning/multiagent.py | 2 +- experiments/learning/test_multiagent.py | 2 +- experiments/performance/script.py | 2 +- gym_pybullet_drones/control/BaseControl.py | 6 +--- gym_pybullet_drones/control/DSLPIDControl.py | 2 +- .../control/SimplePIDControl.py | 3 +- gym_pybullet_drones/envs/BaseAviary.py | 31 +----------------- gym_pybullet_drones/envs/CtrlAviary.py | 3 +- gym_pybullet_drones/envs/DynAviary.py | 3 +- gym_pybullet_drones/envs/VelocityAviary.py | 3 +- gym_pybullet_drones/envs/VisionAviary.py | 3 +- .../multi_agent_rl/BaseMultiagentAviary.py | 6 ++-- .../envs/multi_agent_rl/FlockAviary.py | 6 +--- .../multi_agent_rl/LeaderFollowerAviary.py | 7 +--- .../envs/multi_agent_rl/MeetupAviary.py | 7 +--- .../single_agent_rl/BaseSingleAgentAviary.py | 5 ++- .../envs/single_agent_rl/FlyThruGateAviary.py | 3 +- .../envs/single_agent_rl/HoverAviary.py | 3 +- .../envs/single_agent_rl/TakeoffAviary.py | 3 +- .../envs/single_agent_rl/TuneAviary.py | 3 +- gym_pybullet_drones/utils/Logger.py | 1 - gym_pybullet_drones/utils/enums.py | 32 +++++++++++++++++++ .../aviary_wrapper.py | 2 +- 29 files changed, 66 insertions(+), 84 deletions(-) create mode 100644 gym_pybullet_drones/utils/enums.py diff --git a/assignments/aer1216_fall2020_hw2_sim.py b/assignments/aer1216_fall2020_hw2_sim.py index f1fd59d2d..e28ada76b 100644 --- a/assignments/aer1216_fall2020_hw2_sim.py +++ b/assignments/aer1216_fall2020_hw2_sim.py @@ -21,7 +21,7 @@ from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.utils.Logger import Logger from gym_pybullet_drones.utils.utils import sync -from gym_pybullet_drones.envs.BaseAviary import DroneModel +from gym_pybullet_drones.utils.enums import DroneModel from aer1216_fall2020_hw2_ctrl import HW2Control DURATION = 10 diff --git a/examples/compare.py b/examples/compare.py index d335697bb..58c680081 100644 --- a/examples/compare.py +++ b/examples/compare.py @@ -20,7 +20,7 @@ import numpy as np from gym_pybullet_drones.utils.utils import sync, str2bool -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl from gym_pybullet_drones.utils.Logger import Logger diff --git a/examples/downwash.py b/examples/downwash.py index 012ef0b0c..deaefd421 100644 --- a/examples/downwash.py +++ b/examples/downwash.py @@ -16,7 +16,7 @@ import numpy as np from gym_pybullet_drones.utils.utils import sync, str2bool -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl from gym_pybullet_drones.utils.Logger import Logger diff --git a/examples/fly.py b/examples/fly.py index c415e6899..a56fcb181 100644 --- a/examples/fly.py +++ b/examples/fly.py @@ -26,7 +26,7 @@ import pybullet as p import matplotlib.pyplot as plt -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.envs.VisionAviary import VisionAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl diff --git a/examples/groundeffect.py b/examples/groundeffect.py index 57143dcd5..f1cde0843 100644 --- a/examples/groundeffect.py +++ b/examples/groundeffect.py @@ -24,7 +24,7 @@ import pybullet as p import matplotlib.pyplot as plt -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.envs.VisionAviary import VisionAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl diff --git a/examples/velocity.py b/examples/velocity.py index 40dae67e8..17c957d8a 100644 --- a/examples/velocity.py +++ b/examples/velocity.py @@ -24,7 +24,7 @@ import pybullet as p import matplotlib.pyplot as plt -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.envs.VisionAviary import VisionAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl diff --git a/experiments/learning/multiagent.py b/experiments/learning/multiagent.py index 66b606089..2ae74f620 100644 --- a/experiments/learning/multiagent.py +++ b/experiments/learning/multiagent.py @@ -48,7 +48,7 @@ from ray.rllib.policy.sample_batch import SampleBatch from ray.rllib.env.multi_agent_env import ENV_STATE -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.multi_agent_rl.FlockAviary import FlockAviary from gym_pybullet_drones.envs.multi_agent_rl.LeaderFollowerAviary import LeaderFollowerAviary from gym_pybullet_drones.envs.multi_agent_rl.MeetupAviary import MeetupAviary diff --git a/experiments/learning/test_multiagent.py b/experiments/learning/test_multiagent.py index 0e9a438d6..781ea9152 100644 --- a/experiments/learning/test_multiagent.py +++ b/experiments/learning/test_multiagent.py @@ -38,7 +38,7 @@ from ray.rllib.models import ModelCatalog from ray.rllib.policy.sample_batch import SampleBatch -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.multi_agent_rl.FlockAviary import FlockAviary from gym_pybullet_drones.envs.multi_agent_rl.LeaderFollowerAviary import LeaderFollowerAviary from gym_pybullet_drones.envs.multi_agent_rl.MeetupAviary import MeetupAviary diff --git a/experiments/performance/script.py b/experiments/performance/script.py index f78ba1e13..ade75fd3f 100644 --- a/experiments/performance/script.py +++ b/experiments/performance/script.py @@ -14,7 +14,7 @@ import pybullet as p import matplotlib.pyplot as plt -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary from gym_pybullet_drones.envs.VisionAviary import VisionAviary from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl diff --git a/gym_pybullet_drones/control/BaseControl.py b/gym_pybullet_drones/control/BaseControl.py index e571d54e3..44ae6f7ef 100644 --- a/gym_pybullet_drones/control/BaseControl.py +++ b/gym_pybullet_drones/control/BaseControl.py @@ -1,12 +1,8 @@ import os -import math import numpy as np -import pybullet as p -from enum import Enum import xml.etree.ElementTree as etxml -from scipy.spatial.transform import Rotation -from gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel class BaseControl(object): """Base class for control. diff --git a/gym_pybullet_drones/control/DSLPIDControl.py b/gym_pybullet_drones/control/DSLPIDControl.py index 64a291c2a..e8265f918 100644 --- a/gym_pybullet_drones/control/DSLPIDControl.py +++ b/gym_pybullet_drones/control/DSLPIDControl.py @@ -4,7 +4,7 @@ from scipy.spatial.transform import Rotation from gym_pybullet_drones.control.BaseControl import BaseControl -from gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel class DSLPIDControl(BaseControl): """PID control class for Crazyflies. diff --git a/gym_pybullet_drones/control/SimplePIDControl.py b/gym_pybullet_drones/control/SimplePIDControl.py index 3dfcc125a..776ab137e 100644 --- a/gym_pybullet_drones/control/SimplePIDControl.py +++ b/gym_pybullet_drones/control/SimplePIDControl.py @@ -1,9 +1,8 @@ -import math import numpy as np import pybullet as p from gym_pybullet_drones.control.BaseControl import BaseControl -from gym_pybullet_drones.envs.BaseAviary import DroneModel, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel from gym_pybullet_drones.utils.utils import nnlsRPM class SimplePIDControl(BaseControl): diff --git a/gym_pybullet_drones/envs/BaseAviary.py b/gym_pybullet_drones/envs/BaseAviary.py index 045ce3b14..711eacfc7 100644 --- a/gym_pybullet_drones/envs/BaseAviary.py +++ b/gym_pybullet_drones/envs/BaseAviary.py @@ -3,7 +3,6 @@ import time import collections from datetime import datetime -from enum import Enum import xml.etree.ElementTree as etxml from PIL import Image # import pkgutil @@ -12,37 +11,9 @@ import pybullet as p import pybullet_data import gym +from gym_pybullet_drones.utils.enums import DroneModel, Physics, ImageType -class DroneModel(Enum): - """Drone models enumeration class.""" - CF2X = "cf2x" # Bitcraze Craziflie 2.0 in the X configuration - CF2P = "cf2p" # Bitcraze Craziflie 2.0 in the + configuration - HB = "hb" # Generic quadrotor (with AscTec Hummingbird inertial properties) - -################################################################################ - -class Physics(Enum): - """Physics implementations enumeration class.""" - - PYB = "pyb" # Base PyBullet physics update - DYN = "dyn" # Update with an explicit model of the dynamics - PYB_GND = "pyb_gnd" # PyBullet physics update with ground effect - PYB_DRAG = "pyb_drag" # PyBullet physics update with drag - PYB_DW = "pyb_dw" # PyBullet physics update with downwash - PYB_GND_DRAG_DW = "pyb_gnd_drag_dw" # PyBullet physics update with ground effect, drag, and downwash - -################################################################################ - -class ImageType(Enum): - """Camera capture image type enumeration class.""" - - RGB = 0 # Red, green, blue (and alpha) - DEP = 1 # Depth - SEG = 2 # Segmentation by object id - BW = 3 # Black and white - -################################################################################ class BaseAviary(gym.Env): """Base class for "drone aviary" Gym environments.""" diff --git a/gym_pybullet_drones/envs/CtrlAviary.py b/gym_pybullet_drones/envs/CtrlAviary.py index 0581e9982..1a409f1dc 100644 --- a/gym_pybullet_drones/envs/CtrlAviary.py +++ b/gym_pybullet_drones/envs/CtrlAviary.py @@ -1,7 +1,8 @@ import numpy as np from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics class CtrlAviary(BaseAviary): """Multi-drone environment class for control applications.""" diff --git a/gym_pybullet_drones/envs/DynAviary.py b/gym_pybullet_drones/envs/DynAviary.py index c0f9552b9..d12a3e1bc 100644 --- a/gym_pybullet_drones/envs/DynAviary.py +++ b/gym_pybullet_drones/envs/DynAviary.py @@ -1,7 +1,8 @@ import numpy as np from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.utils.utils import nnlsRPM class DynAviary(BaseAviary): diff --git a/gym_pybullet_drones/envs/VelocityAviary.py b/gym_pybullet_drones/envs/VelocityAviary.py index 36759a13b..fb021cc7a 100644 --- a/gym_pybullet_drones/envs/VelocityAviary.py +++ b/gym_pybullet_drones/envs/VelocityAviary.py @@ -2,7 +2,8 @@ import numpy as np from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl from gym_pybullet_drones.control.SimplePIDControl import SimplePIDControl diff --git a/gym_pybullet_drones/envs/VisionAviary.py b/gym_pybullet_drones/envs/VisionAviary.py index f6cf9da45..f121f6c93 100644 --- a/gym_pybullet_drones/envs/VisionAviary.py +++ b/gym_pybullet_drones/envs/VisionAviary.py @@ -2,7 +2,8 @@ import numpy as np from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, ImageType, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics, ImageType class VisionAviary(BaseAviary): """Multi-drone environment class for control applications using vision.""" diff --git a/gym_pybullet_drones/envs/multi_agent_rl/BaseMultiagentAviary.py b/gym_pybullet_drones/envs/multi_agent_rl/BaseMultiagentAviary.py index 44c087774..719da5421 100644 --- a/gym_pybullet_drones/envs/multi_agent_rl/BaseMultiagentAviary.py +++ b/gym_pybullet_drones/envs/multi_agent_rl/BaseMultiagentAviary.py @@ -1,11 +1,11 @@ import os -from datetime import datetime import numpy as np import pybullet as p from gym import spaces -from ray.rllib.env.multi_agent_env import MultiAgentEnv, ENV_STATE +from ray.rllib.env.multi_agent_env import MultiAgentEnv -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType from gym_pybullet_drones.utils.utils import nnlsRPM from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl diff --git a/gym_pybullet_drones/envs/multi_agent_rl/FlockAviary.py b/gym_pybullet_drones/envs/multi_agent_rl/FlockAviary.py index f3b63218b..c83b20093 100644 --- a/gym_pybullet_drones/envs/multi_agent_rl/FlockAviary.py +++ b/gym_pybullet_drones/envs/multi_agent_rl/FlockAviary.py @@ -1,11 +1,7 @@ import math import numpy as np -from gym import spaces -from ray.rllib.env.multi_agent_env import MultiAgentEnv, ENV_STATE -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary - -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType from gym_pybullet_drones.envs.multi_agent_rl.BaseMultiagentAviary import BaseMultiagentAviary diff --git a/gym_pybullet_drones/envs/multi_agent_rl/LeaderFollowerAviary.py b/gym_pybullet_drones/envs/multi_agent_rl/LeaderFollowerAviary.py index 3943b6b46..cd5b73938 100644 --- a/gym_pybullet_drones/envs/multi_agent_rl/LeaderFollowerAviary.py +++ b/gym_pybullet_drones/envs/multi_agent_rl/LeaderFollowerAviary.py @@ -1,11 +1,6 @@ -import math import numpy as np -from gym import spaces -from ray.rllib.env.multi_agent_env import MultiAgentEnv, ENV_STATE -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary - -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType from gym_pybullet_drones.envs.multi_agent_rl.BaseMultiagentAviary import BaseMultiagentAviary diff --git a/gym_pybullet_drones/envs/multi_agent_rl/MeetupAviary.py b/gym_pybullet_drones/envs/multi_agent_rl/MeetupAviary.py index 01f9f92b7..5535f4756 100644 --- a/gym_pybullet_drones/envs/multi_agent_rl/MeetupAviary.py +++ b/gym_pybullet_drones/envs/multi_agent_rl/MeetupAviary.py @@ -1,11 +1,6 @@ -import math import numpy as np -from gym import spaces -from ray.rllib.env.multi_agent_env import MultiAgentEnv, ENV_STATE -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary - -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType from gym_pybullet_drones.envs.multi_agent_rl.BaseMultiagentAviary import BaseMultiagentAviary diff --git a/gym_pybullet_drones/envs/single_agent_rl/BaseSingleAgentAviary.py b/gym_pybullet_drones/envs/single_agent_rl/BaseSingleAgentAviary.py index c008e5d7e..3f1b9534d 100644 --- a/gym_pybullet_drones/envs/single_agent_rl/BaseSingleAgentAviary.py +++ b/gym_pybullet_drones/envs/single_agent_rl/BaseSingleAgentAviary.py @@ -1,12 +1,11 @@ import os -from datetime import datetime from enum import Enum import numpy as np from gym import spaces import pybullet as p -import pybullet_data -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, ImageType, BaseAviary +from gym_pybullet_drones.envs.BaseAviary import BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics, ImageType from gym_pybullet_drones.utils.utils import nnlsRPM from gym_pybullet_drones.control.DSLPIDControl import DSLPIDControl from gym_pybullet_drones.control.SimplePIDControl import SimplePIDControl diff --git a/gym_pybullet_drones/envs/single_agent_rl/FlyThruGateAviary.py b/gym_pybullet_drones/envs/single_agent_rl/FlyThruGateAviary.py index 939ed78d4..ad0173424 100644 --- a/gym_pybullet_drones/envs/single_agent_rl/FlyThruGateAviary.py +++ b/gym_pybullet_drones/envs/single_agent_rl/FlyThruGateAviary.py @@ -1,9 +1,8 @@ import os import numpy as np -from gym import spaces import pybullet as p -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType, BaseSingleAgentAviary diff --git a/gym_pybullet_drones/envs/single_agent_rl/HoverAviary.py b/gym_pybullet_drones/envs/single_agent_rl/HoverAviary.py index cbd71b26d..ccc2fd0c8 100644 --- a/gym_pybullet_drones/envs/single_agent_rl/HoverAviary.py +++ b/gym_pybullet_drones/envs/single_agent_rl/HoverAviary.py @@ -1,7 +1,6 @@ import numpy as np -from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType, BaseSingleAgentAviary class HoverAviary(BaseSingleAgentAviary): diff --git a/gym_pybullet_drones/envs/single_agent_rl/TakeoffAviary.py b/gym_pybullet_drones/envs/single_agent_rl/TakeoffAviary.py index 4ed0da2a0..64ea99401 100644 --- a/gym_pybullet_drones/envs/single_agent_rl/TakeoffAviary.py +++ b/gym_pybullet_drones/envs/single_agent_rl/TakeoffAviary.py @@ -1,7 +1,6 @@ import numpy as np -from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType, BaseSingleAgentAviary class TakeoffAviary(BaseSingleAgentAviary): diff --git a/gym_pybullet_drones/envs/single_agent_rl/TuneAviary.py b/gym_pybullet_drones/envs/single_agent_rl/TuneAviary.py index 30173f781..5a45a7983 100644 --- a/gym_pybullet_drones/envs/single_agent_rl/TuneAviary.py +++ b/gym_pybullet_drones/envs/single_agent_rl/TuneAviary.py @@ -1,7 +1,6 @@ import numpy as np -from gym import spaces -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics, BaseAviary +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.single_agent_rl.BaseSingleAgentAviary import ActionType, ObservationType, BaseSingleAgentAviary class TuneAviary(BaseSingleAgentAviary): diff --git a/gym_pybullet_drones/utils/Logger.py b/gym_pybullet_drones/utils/Logger.py index baeddfcc8..6b09ee7c1 100644 --- a/gym_pybullet_drones/utils/Logger.py +++ b/gym_pybullet_drones/utils/Logger.py @@ -1,5 +1,4 @@ import os -import time from datetime import datetime from cycler import cycler import numpy as np diff --git a/gym_pybullet_drones/utils/enums.py b/gym_pybullet_drones/utils/enums.py new file mode 100644 index 000000000..4634835be --- /dev/null +++ b/gym_pybullet_drones/utils/enums.py @@ -0,0 +1,32 @@ +from enum import Enum + +class DroneModel(Enum): + """Drone models enumeration class.""" + + CF2X = "cf2x" # Bitcraze Craziflie 2.0 in the X configuration + CF2P = "cf2p" # Bitcraze Craziflie 2.0 in the + configuration + HB = "hb" # Generic quadrotor (with AscTec Hummingbird inertial properties) + +################################################################################ + +class Physics(Enum): + """Physics implementations enumeration class.""" + + PYB = "pyb" # Base PyBullet physics update + DYN = "dyn" # Update with an explicit model of the dynamics + PYB_GND = "pyb_gnd" # PyBullet physics update with ground effect + PYB_DRAG = "pyb_drag" # PyBullet physics update with drag + PYB_DW = "pyb_dw" # PyBullet physics update with downwash + PYB_GND_DRAG_DW = "pyb_gnd_drag_dw" # PyBullet physics update with ground effect, drag, and downwash + +################################################################################ + +class ImageType(Enum): + """Camera capture image type enumeration class.""" + + RGB = 0 # Red, green, blue (and alpha) + DEP = 1 # Depth + SEG = 2 # Segmentation by object id + BW = 3 # Black and white + +################################################################################ \ No newline at end of file diff --git a/ros2/src/ros2_gym_pybullet_drones/ros2_gym_pybullet_drones/aviary_wrapper.py b/ros2/src/ros2_gym_pybullet_drones/ros2_gym_pybullet_drones/aviary_wrapper.py index ff387c1d8..a9e401758 100644 --- a/ros2/src/ros2_gym_pybullet_drones/ros2_gym_pybullet_drones/aviary_wrapper.py +++ b/ros2/src/ros2_gym_pybullet_drones/ros2_gym_pybullet_drones/aviary_wrapper.py @@ -13,7 +13,7 @@ from rclpy.node import Node from std_msgs.msg import Float32MultiArray -from gym_pybullet_drones.envs.BaseAviary import DroneModel, Physics +from gym_pybullet_drones.utils.enums import DroneModel, Physics from gym_pybullet_drones.envs.CtrlAviary import CtrlAviary class AviaryWrapper(Node):