From dad5f5dc7bab5b52d81f3880b47b14da4407f197 Mon Sep 17 00:00:00 2001 From: Daniel Date: Thu, 22 Aug 2024 12:44:56 +0200 Subject: [PATCH] Added and fixed Client.apply_batch signature --- Docs/python_api.md | 7 ++++--- PythonAPI/docs/client.yml | 9 +++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Docs/python_api.md b/Docs/python_api.md index 8b1e00b006..a0344c0c7b 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -505,15 +505,16 @@ Client constructor. - `host` (_str_) - IP address where a CARLA Simulator instance is running. Default is localhost (127.0.0.1). - `port` (_int_) - TCP port where the CARLA Simulator instance is running. Default are 2000 and the subsequent 2001. - `worker_threads` (_int_) - Number of working threads used for background updates. If 0, use all available concurrency. -- **apply_batch**(**self**, **commands**) +- **apply_batch**(**self**, **commands**, **do_tick**=False) Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __apply_batch_sync()__ method. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in [carla.ActorList](#carla.ActorList) all at once. - **Parameters:** - `commands` (_list_) - A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. -- **apply_batch_sync**(**self**, **commands**, **due_tick_cue**=False) + - `do_tick` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. Defaults to __False__. +- **apply_batch_sync**(**self**, **commands**, **do_tick**=False) Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of command.Response that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors. - **Parameters:** - `commands` (_list_) - A list of commands to execute in batch. The commands available are listed right above, in the method **apply_batch()**. - - `due_tick_cue` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. It is __False__ by default. + - `do_tick` (_bool_) - A boolean parameter to specify whether or not to perform a [carla.World.tick](#carla.World.tick) after applying the batch in _synchronous mode_. Defaults to __False__. - **Return:** _list(command.Response)_ - **generate_opendrive_world**(**self**, **opendrive**, **parameters**=(2.0, 50.0, 1.0, 0.6, true, true), **reset_settings**=True) Loads a new world with a basic 3D topology generated from the content of an OpenDRIVE file. This content is passed as a `string` parameter. It is similar to `client.load_world(map_name)` but allows for custom OpenDRIVE maps in server side. Cars can drive around the map, but there are no graphics besides the road and sidewalks. diff --git a/PythonAPI/docs/client.yml b/PythonAPI/docs/client.yml index 4b15bb7dbb..8b3247e9ab 100644 --- a/PythonAPI/docs/client.yml +++ b/PythonAPI/docs/client.yml @@ -41,6 +41,11 @@ type: list doc: > A list of commands to execute in batch. Each command is different and has its own parameters. They appear listed at the bottom of this page. + - param_name: do_tick + type: bool + default: false + doc: > + A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. Defaults to __False__. doc: > Executes a list of commands on a single simulation step and retrieves no information. If you need information about the response of each command, use the __apply_batch_sync()__ method. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example on how to delete the actors that appear in carla.ActorList all at once. @@ -51,11 +56,11 @@ type: list doc: > A list of commands to execute in batch. The commands available are listed right above, in the method **apply_batch()**. - - param_name: due_tick_cue + - param_name: do_tick type: bool default: false doc: > - A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. It is __False__ by default. + A boolean parameter to specify whether or not to perform a carla.World.tick after applying the batch in _synchronous mode_. Defaults to __False__. return: list(command.Response) doc: > Executes a list of commands on a single simulation step, blocks until the commands are linked, and returns a list of command.Response that can be used to determine whether a single command succeeded or not. [Here](https://github.com/carla-simulator/carla/blob/master/PythonAPI/examples/generate_traffic.py) is an example of it being used to spawn actors.