Skip to content

Commit

Permalink
bump version, example
Browse files Browse the repository at this point in the history
  • Loading branch information
tawnkramer committed Aug 25, 2020
1 parent 7e7fa1f commit 004b8b4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
10 changes: 6 additions & 4 deletions examples/gym_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@


def select_action(env):
return env.action_space.sample()
#return [0.0, 0.1] # enable this to test checkpoint failure
#return env.action_space.sample()
return [0.0, 0.1] # enable this to test checkpoint failure


def simulate(env):
Expand Down Expand Up @@ -57,15 +57,17 @@ def simulate(env):
parser = argparse.ArgumentParser(description='gym_test')
parser.add_argument('--sim', type=str, default="sim_path",
help='path to unity simulator. maybe be left at default if you would like to start the sim on your own.')
parser.add_argument('--host', type=str, default="127.0.0.1",
help='host to use for tcp')
parser.add_argument('--port', type=int, default=9091,
help='port to use for websockets')
help='port to use for tcp')
parser.add_argument('--env_name', type=str, default='donkey-mountain-track-v0',
help='name of donkey sim environment', choices=env_list)

args = parser.parse_args()

conf = {"exe_path" : args.sim,
"host" : "127.0.0.1",
"host" : args.host,
"port" : args.port,

"body_style" : "donkey",
Expand Down
2 changes: 1 addition & 1 deletion gym_donkeycar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

__author__ = """Tawn Kramer"""
__email__ = '[email protected]'
__version__ = '1.0.15'
__version__ = '1.0.16'

from gym.envs.registration import register
from .envs.donkey_env import GeneratedRoadsEnv, WarehouseEnv, AvcSparkfunEnv, GeneratedTrackEnv, MountainTrackEnv
Expand Down
9 changes: 5 additions & 4 deletions gym_donkeycar/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ def proc_msg(self, sock):
j = json.loads(m)
self.on_msg_recv(j)
except Exception as e:
print("Exception:", e)
print("json:", m)
logger.error("Exception:" + str(e))
logger.error("json: " + m)
else:
partial.append(m)
# logger.info("partial packet:" + m)
if last_char == '}':
if partial[0][0] == "{":
assembled_packet = "".join(partial)
Expand All @@ -137,8 +138,8 @@ def proc_msg(self, sock):
j = json.loads(assembled_packet)
self.on_msg_recv(j)
except Exception as e:
print(e)
print("json:", assembled_packet)
logger.error("Exception:" + str(e))
logger.error("partial json: " + assembled_packet)
else:
logger.error("failed packet.")
partial.clear()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/tawnkramer/gym-donkeycar',
version='1.0.15',
version='1.0.16',
zip_safe=False,
)

0 comments on commit 004b8b4

Please sign in to comment.