gym_donkeycar.core package

Submodules

gym_donkeycar.core.fps module

class gym_donkeycar.core.fps.FPSTimer[source]

Bases: object

on_frame()[source]
reset()[source]

gym_donkeycar.core.tcp_server module

author: Tawn Kramer date: 16 October 2018 file: tcp_server.py notes: a tcp socket server to talk to the unity donkey simulator

class gym_donkeycar.core.tcp_server.IMesgHandler[source]

Bases: object

on_close()[source]
on_connect(socketHandler)[source]
on_disconnect()[source]
on_recv_message(message)[source]
class gym_donkeycar.core.tcp_server.SimHandler(sock, chunk_size=16384, msg_handler=None)[source]

Bases: asyncore.dispatcher

Handles messages from a single TCP client.

handle_close()[source]
handle_json_message(chunk)[source]

We are expecing a json object

handle_read()[source]

Read an incoming message from the client and put it into our outgoing queue. handle_read should only be called when the given socket has data ready to be processed.

handle_write()[source]

Write as much as possible of the most recent message we have received. This is only called by async manager when the socket is in a writable state and when self.writable return true, that yes, we have data to send.

queue_message(msg)[source]
writable()[source]

We want to write if we have received data.

class gym_donkeycar.core.tcp_server.SimServer(address, msg_handler)[source]

Bases: asyncore.dispatcher

Receives network connections and establishes handlers for each client. Each client connection is handled by a new instance of the SteeringHandler class.

handle_accept()[source]
handle_close()[source]
gym_donkeycar.core.tcp_server.replace_float_notation(string)[source]

Replace unity float notation for languages like French or German that use comma instead of dot. This convert the json sent by Unity to a valid one. Ex: “test”: 1,2, “key”: 2 -> “test”: 1.2, “key”: 2

Parameters:string – (str) The incorrect json string
Returns:(str) Valid JSON string

Module contents