Skip to content

Commit 2d9e350

Browse files
hadiTabshalinmehtalgsvl
authored andcommitted
Allow some sim.xxx functions to accept arguments of type(None)
1 parent faa502d commit 2d9e350

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lgsvl/simulator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _process(self, cmd, args):
125125
break
126126
j = self.remote.command("simulator/continue")
127127

128-
@accepts(str, AgentType, AgentState, Vector)
128+
@accepts(str, AgentType, (AgentState, type(None)), (Vector, type(None)))
129129
def add_agent(self, name, agent_type, state=None, color=None):
130130
if state is None: state = AgentState()
131131
if color is None: color = Vector(-1, -1, -1)
@@ -265,7 +265,7 @@ def raycast_batch(self, args):
265265

266266
return results
267267

268-
@accepts(str, ObjectState)
268+
@accepts(str, (ObjectState, type(None)))
269269
def controllable_add(self, name, object_state=None):
270270
if object_state is None: object_state = ObjectState()
271271
args = {"name": name, "state": object_state.to_json()}

0 commit comments

Comments
 (0)