From 6a99f584f731f40d43dabb38ea8ef7036771556d Mon Sep 17 00:00:00 2001 From: Maxime Ellerbach Date: Wed, 21 Apr 2021 13:00:18 +0200 Subject: [PATCH 1/2] trying to fix CI checks failing --- docs/conf.py | 4 +-- gym_donkeycar/__init__.py | 50 +++++++------------------------ gym_donkeycar/envs/donkey_env.py | 4 +-- gym_donkeycar/test/client.test.py | 5 +--- 4 files changed, 14 insertions(+), 49 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 84c34d22b..ce05d0be1 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -125,7 +125,7 @@ # (source start file, target name, title, author, documentclass # [howto, manual, or own class]). latex_documents = [ - (master_doc, "gym_donkeycar.tex", u"OpenAI Gym Environments for Donkey CarDocumentation", u"Leigh Johnson", "manual"), + (master_doc, "gym_donkeycar.tex", u"OpenAI Gym Environments for Donkey CarDocumentation", u"Leigh Johnson", "manual") ] @@ -150,5 +150,5 @@ "gym_donkeycar", "One line description of project.", "Miscellaneous", - ), + ) ] diff --git a/gym_donkeycar/__init__.py b/gym_donkeycar/__init__.py index 3b00516ea..84b28e612 100644 --- a/gym_donkeycar/__init__.py +++ b/gym_donkeycar/__init__.py @@ -27,52 +27,22 @@ __email__ = "tawnkramer@gmail.com" __version__ = __version__ -register( - id="donkey-generated-roads-v0", - entry_point="gym_donkeycar.envs.donkey_env:GeneratedRoadsEnv", -) +register(id="donkey-generated-roads-v0", entry_point="gym_donkeycar.envs.donkey_env:GeneratedRoadsEnv") -register( - id="donkey-warehouse-v0", - entry_point="gym_donkeycar.envs.donkey_env:WarehouseEnv", -) +register(id="donkey-warehouse-v0", entry_point="gym_donkeycar.envs.donkey_env:WarehouseEnv") -register( - id="donkey-avc-sparkfun-v0", - entry_point="gym_donkeycar.envs.donkey_env:AvcSparkfunEnv", -) +register(id="donkey-avc-sparkfun-v0", entry_point="gym_donkeycar.envs.donkey_env:AvcSparkfunEnv") -register( - id="donkey-generated-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:GeneratedTrackEnv", -) +register(id="donkey-generated-track-v0", entry_point="gym_donkeycar.envs.donkey_env:GeneratedTrackEnv") -register( - id="donkey-mountain-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:MountainTrackEnv", -) +register(id="donkey-mountain-track-v0", entry_point="gym_donkeycar.envs.donkey_env:MountainTrackEnv") -register( - id="donkey-roboracingleague-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:RoboRacingLeagueTrackEnv", -) +register(id="donkey-roboracingleague-track-v0", entry_point="gym_donkeycar.envs.donkey_env:RoboRacingLeagueTrackEnv") -register( - id="donkey-waveshare-v0", - entry_point="gym_donkeycar.envs.donkey_env:WaveshareEnv", -) +register(id="donkey-waveshare-v0", entry_point="gym_donkeycar.envs.donkey_env:WaveshareEnv") -register( - id="donkey-minimonaco-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:MiniMonacoEnv", -) +register(id="donkey-minimonaco-track-v0", entry_point="gym_donkeycar.envs.donkey_env:MiniMonacoEnv") -register( - id="donkey-warren-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:WarrenTrackEnv", -) +register(id="donkey-warren-track-v0", entry_point="gym_donkeycar.envs.donkey_env:WarrenTrackEnv") -register( - id="donkey-thunderhill-track-v0", - entry_point="gym_donkeycar.envs.donkey_env:ThunderhillTrackEnv", -) +register(id="donkey-thunderhill-track-v0", entry_point="gym_donkeycar.envs.donkey_env:ThunderhillTrackEnv") diff --git a/gym_donkeycar/envs/donkey_env.py b/gym_donkeycar/envs/donkey_env.py index a1d80f168..c9f7223a7 100755 --- a/gym_donkeycar/envs/donkey_env.py +++ b/gym_donkeycar/envs/donkey_env.py @@ -39,9 +39,7 @@ class DonkeyEnv(gym.Env): OpenAI Gym Environment for Donkey """ - metadata = { - "render.modes": ["human", "rgb_array"], - } + metadata = {"render.modes": ["human", "rgb_array"]} ACTION_NAMES = ["steer", "throttle"] STEER_LIMIT_LEFT = -1.0 diff --git a/gym_donkeycar/test/client.test.py b/gym_donkeycar/test/client.test.py index d0b4603df..b49a6e4e4 100644 --- a/gym_donkeycar/test/client.test.py +++ b/gym_donkeycar/test/client.test.py @@ -61,10 +61,7 @@ def loop(self): class SUT(SDClient): - def __init__( - self, - address, - ): + def __init__(self, address): super().__init__(*address, poll_socket_sleep_time=0.01) self.receivedMsg = None self.receivedCount = 0 From 02102ed5198645eaa1a2a8b9f31c129fed9084ba Mon Sep 17 00:00:00 2001 From: Maxime Ellerbach Date: Sat, 24 Jul 2021 22:22:46 +0200 Subject: [PATCH 2/2] added circuit launch track --- README.md | 1 + examples/genetic_alg/simple_gen_driver.py | 1 + examples/gym_test.py | 1 + examples/reinforcement_learning/ddqn.py | 1 + examples/reinforcement_learning/ppo_train.py | 1 + examples/test_cam_config.py | 1 + gym_donkeycar/__init__.py | 3 +++ gym_donkeycar/envs/donkey_env.py | 5 +++++ tests/test_gym_donkeycar.py | 1 + 9 files changed, 15 insertions(+) diff --git a/README.md b/README.md index e15b3954f..9640bbdcc 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ Example info: - "donkey-minimonaco-track-v0" - "donkey-warren-track-v0" - "donkey-thunderhill-track-v0" +- "donkey-circuit-launch-track-v0" ## Codestyle diff --git a/examples/genetic_alg/simple_gen_driver.py b/examples/genetic_alg/simple_gen_driver.py index ca1dda971..c65b18528 100755 --- a/examples/genetic_alg/simple_gen_driver.py +++ b/examples/genetic_alg/simple_gen_driver.py @@ -192,6 +192,7 @@ def on_agents_finished(self): "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ] parser = argparse.ArgumentParser(description="simple_gen_driver") diff --git a/examples/gym_test.py b/examples/gym_test.py index 0ca1b152a..6eecade19 100755 --- a/examples/gym_test.py +++ b/examples/gym_test.py @@ -71,6 +71,7 @@ def exit_scene(env): "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ] parser = argparse.ArgumentParser(description="gym_test") diff --git a/examples/reinforcement_learning/ddqn.py b/examples/reinforcement_learning/ddqn.py index 4bb4bd100..87c74f00a 100755 --- a/examples/reinforcement_learning/ddqn.py +++ b/examples/reinforcement_learning/ddqn.py @@ -340,6 +340,7 @@ def signal_handler(signal, frame): "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ] parser = argparse.ArgumentParser(description="ddqn") diff --git a/examples/reinforcement_learning/ppo_train.py b/examples/reinforcement_learning/ppo_train.py index 8a38efda5..edf4a2fc6 100644 --- a/examples/reinforcement_learning/ppo_train.py +++ b/examples/reinforcement_learning/ppo_train.py @@ -49,6 +49,7 @@ def _init(): "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ] parser = argparse.ArgumentParser(description="ppo_train") diff --git a/examples/test_cam_config.py b/examples/test_cam_config.py index 43dbc37e2..0eddfa3b4 100644 --- a/examples/test_cam_config.py +++ b/examples/test_cam_config.py @@ -20,6 +20,7 @@ "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ] parser = argparse.ArgumentParser(description="gym_test") diff --git a/gym_donkeycar/__init__.py b/gym_donkeycar/__init__.py index 84b28e612..bace1796b 100644 --- a/gym_donkeycar/__init__.py +++ b/gym_donkeycar/__init__.py @@ -7,6 +7,7 @@ from gym_donkeycar.envs.donkey_env import ( AvcSparkfunEnv, + CircuitLaunchEnv, GeneratedRoadsEnv, GeneratedTrackEnv, MiniMonacoEnv, @@ -46,3 +47,5 @@ register(id="donkey-warren-track-v0", entry_point="gym_donkeycar.envs.donkey_env:WarrenTrackEnv") register(id="donkey-thunderhill-track-v0", entry_point="gym_donkeycar.envs.donkey_env:ThunderhillTrackEnv") + +register(id="donkey-circuit-launch-track-v0", entry_point="gym_donkeycar.envs.donkey_env:CircuitLaunchEnv") diff --git a/gym_donkeycar/envs/donkey_env.py b/gym_donkeycar/envs/donkey_env.py index c9f7223a7..ab732e914 100755 --- a/gym_donkeycar/envs/donkey_env.py +++ b/gym_donkeycar/envs/donkey_env.py @@ -191,3 +191,8 @@ def __init__(self, *args, **kwargs): class ThunderhillTrackEnv(DonkeyEnv): def __init__(self, *args, **kwargs): super(ThunderhillTrackEnv, self).__init__(level="thunderhill", *args, **kwargs) + + +class CircuitLaunchEnv(DonkeyEnv): + def __init__(self, *args, **kwargs): + super(CircuitLaunchEnv, self).__init__(level="circuit_launch", *args, **kwargs) diff --git a/tests/test_gym_donkeycar.py b/tests/test_gym_donkeycar.py index d9494952b..527bcfd27 100644 --- a/tests/test_gym_donkeycar.py +++ b/tests/test_gym_donkeycar.py @@ -15,6 +15,7 @@ "donkey-minimonaco-track-v0", "donkey-warren-track-v0", "donkey-thunderhill-track-v0", + "donkey-circuit-launch-track-v0", ]