Skip to content

Commit a1d1524

Browse files
KarBychadiTab
authored andcommitted
Added new parameter path type to the follow waypoints command.
1 parent cd4c850 commit a1d1524

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lgsvl/agent.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ class NpcVehicle(Vehicle):
216216
def __init__(self, uid, simulator):
217217
super().__init__(uid, simulator)
218218

219-
@accepts(Iterable, bool)
220-
def follow(self, waypoints, loop=False):
219+
@accepts(Iterable, bool, str)
220+
def follow(self, waypoints, loop=False, waypoints_path_type="Linear"):
221221
"""Tells the NPC to follow the waypoints
222222
223223
When an NPC reaches a waypoint, it will:
@@ -258,6 +258,9 @@ def follow(self, waypoints, loop=False):
258258
259259
loop : bool
260260
whether the NPC should loop through the waypoints after reaching the final one
261+
262+
waypoints_path_type : string
263+
how the waypoints path should be interpreted, default path type is "Linear"
261264
"""
262265
self.remote.command(
263266
"vehicle/follow_waypoints",
@@ -278,6 +281,7 @@ def follow(self, waypoints, loop=False):
278281
}
279282
for wp in waypoints
280283
],
284+
"waypoints_path_type": waypoints_path_type,
281285
"loop": loop,
282286
},
283287
)
@@ -346,8 +350,8 @@ def walk_randomly(self, enable):
346350
"pedestrian/walk_randomly", {"uid": self.uid, "enable": enable}
347351
)
348352

349-
@accepts(Iterable, bool)
350-
def follow(self, waypoints, loop=False):
353+
@accepts(Iterable, bool, str)
354+
def follow(self, waypoints, loop=False, waypoints_path_type="Linear"):
351355
"""Tells the Pedestrian to follow the waypoints
352356
353357
When a pedestrian reaches a waypoint, it will:
@@ -391,6 +395,7 @@ def follow(self, waypoints, loop=False):
391395
}
392396
for wp in waypoints
393397
],
398+
"waypoints_path_type": waypoints_path_type,
394399
"loop": loop,
395400
},
396401
)

0 commit comments

Comments
 (0)