Skip to content

Commit caaf7b9

Browse files
committed
add guid
1 parent 21096b6 commit caaf7b9

File tree

6 files changed

+14
-4
lines changed

6 files changed

+14
-4
lines changed

examples/gym_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import gym_donkeycar
1212
import time
1313
import random
14+
import uuid
1415

1516
NUM_EPISODES = 3
1617
MAX_TIME_STEPS = 1000
@@ -75,6 +76,7 @@ def simulate(env):
7576
"racer_name" : "test",
7677
"country" : "USA",
7778
"bio" : "I am test client",
79+
"guid" : str(uuid.uuid4()),
7880

7981
"max_cte" : 20,
8082
}

examples/reinforcement_learning/ddqn.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import random
1010
import argparse
1111
import signal
12+
import uuid
1213

1314
import numpy as np
1415
import gym
@@ -233,6 +234,7 @@ def run_ddqn(args):
233234
"racer_name" : "DDQN",
234235
"country" : "USA",
235236
"bio" : "Learning to drive w DDQN RL",
237+
"guid" : str(uuid.uuid4()),
236238

237239
"max_cte" : 10,
238240
}

examples/reinforcement_learning/ppo_train.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import argparse
1010
import gym
1111
import gym_donkeycar
12+
import uuid
1213

1314
from stable_baselines.common.policies import MlpPolicy, CnnPolicy, CnnLstmPolicy
1415
from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv
@@ -72,6 +73,7 @@ def _init():
7273
"racer_name" : "PPO",
7374
"country" : "USA",
7475
"bio" : "Learning to drive w PPO RL",
76+
"guid" : str(uuid.uuid4()),
7577

7678
"max_cte" : 10,
7779
}

examples/test_cam_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import gym
77
import gym_donkeycar
88
import numpy as np
9+
import uuid
910

1011
if __name__ == "__main__":
1112

@@ -45,6 +46,7 @@
4546
"racer_name" : "test",
4647
"country" : "USA",
4748
"bio" : "I am test client",
49+
"guid" : str(uuid.uuid4()),
4850

4951
"cam_resolution" : cam,
5052
"img_w" : cam[0],

gym_donkeycar/core/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def proc_msg(self, sock):
9797
for s in readable:
9898
# print("waiting to recv")
9999
try:
100-
data = s.recv(1024 * 64)
100+
data = s.recv(1024 * 256)
101101
except ConnectionAbortedError:
102102
logger.warn("socket connection aborted")
103103
self.do_process_msgs = False

gym_donkeycar/envs/donkey_sim.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def set_car_config(self, conf):
150150
def set_racer_bio(self, conf):
151151
self.conf = conf
152152
if "bio" in conf :
153-
self.send_racer_bio(conf["racer_name"], conf["car_name"], conf["bio"], conf["country"])
153+
self.send_racer_bio(conf["racer_name"], conf["car_name"], conf["bio"], conf["country"], conf["guid"])
154154

155155
def on_recv_message(self, message):
156156
if 'msg_type' not in message:
@@ -357,15 +357,17 @@ def send_car_config(self, body_style, body_rgb, car_name, font_size):
357357
self.blocking_send(msg)
358358
time.sleep(0.1)
359359

360-
def send_racer_bio(self, racer_name, car_name, bio, country):
360+
def send_racer_bio(self, racer_name, car_name, bio, country, guid):
361361
# body_style = "donkey" | "bare" | "car01" choice of string
362362
# body_rgb = (128, 128, 128) tuple of ints
363363
# car_name = "string less than 64 char"
364+
# guid = "some random string"
364365
msg = {'msg_type': 'racer_info',
365366
'racer_name': racer_name,
366367
'car_name' : car_name,
367368
'bio' : bio,
368-
'country' : country }
369+
'country' : country,
370+
'guid' : guid }
369371
self.blocking_send(msg)
370372
time.sleep(0.1)
371373

0 commit comments

Comments
 (0)