First iteration of sync
This commit is contained in:
parent
76a1e95c6f
commit
a12943d329
|
@ -214,7 +214,7 @@ A class that contains every actor present on the scene and provides access to th
|
|||
|
||||
<h3>Methods</h3>
|
||||
- <a name="carla.ActorList.filter"></a>**<font color="#7fb800">filter</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**wildcard_pattern**</font>)
|
||||
Filters a list of Actors matching `wildcard_pattern` against their variable **<font color="#f8805a">type_id</font>** (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
Filters a list of Actors matching `wildcard_pattern` against their variable __<font color="#f8805a">type_id</font>__ (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
- **Parameters:**
|
||||
- `wildcard_pattern` (_str_)
|
||||
- **Return:** _list_
|
||||
|
@ -2673,21 +2673,23 @@ This method applies settings contained in an object to the simulation running an
|
|||
- `world_settings` (_[carla.WorldSettings](#carla.WorldSettings)_)
|
||||
- **Return:** _int_
|
||||
- <a name="carla.World.on_tick"></a>**<font color="#7fb800">on_tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**callback**</font>)
|
||||
The method will start callbacks for a defined function `callback`. It will return the ID for this callback so it can be removed with **<font color="#7fb800">remove_on_tick()</font>**.
|
||||
This method is used in [__asynchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/). It starts callbacks from the client for the function defined as `callback`, and returns the ID of the callback. The function will be called everytime the server ticks. It requires a [carla.WorldSnapshot](#carla.WorldSnapshot) as argument, which can be retrieved from __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ to stop the callbacks.
|
||||
- **Parameters:**
|
||||
- `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) – A defined function with a snapshot as compulsory parameter that will be called every tick.
|
||||
- `callback` (_[carla.WorldSnapshot](#carla.WorldSnapshot)_) – Function with a snapshot as compulsory parameter that will be called when the client receives a tick.
|
||||
- **Return:** _int_
|
||||
- <a name="carla.World.remove_on_tick"></a>**<font color="#7fb800">remove_on_tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**callback_id**</font>)
|
||||
Stops the callback for `callback_id` started with **<font color="#7fb800">on_tick()</font>**.
|
||||
Stops the callback for `callback_id` started with __<font color="#7fb800">on_tick()</font>__.
|
||||
- **Parameters:**
|
||||
- `callback_id` (_callback_) – The callback to be removed.
|
||||
- `callback_id` (_callback_) – The callback to be removed. The ID is returned when creating the callback.
|
||||
- <a name="carla.World.tick"></a>**<font color="#7fb800">tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**seconds**=10.0</font>)
|
||||
This method only has effect on synchronous mode, when both client and server move together. The client tells the server when to step to the next frame and returns the id of the newly started frame.
|
||||
This method is used in [__synchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/), when the server waits for a client tick before computing the next frame. This method will send the tick, and give way to the server. It returns the ID of the new frame computed by the server.
|
||||
- **Parameters:**
|
||||
- `seconds` (_float<small> – seconds</small>_) – Maximum time the server should wait for a tick. It is set to <code>10.0</code> by default.
|
||||
- **Return:** _int_
|
||||
- **Note:** <font color="#8E8E8E">_If no tick is received in synchronous mode, the simulation will freeze. Also, if many ticks are received from different clients, there may be synchronization issues. Please read the docs about [synchronous mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/) to learn more.
|
||||
_</font>
|
||||
- <a name="carla.World.wait_for_tick"></a>**<font color="#7fb800">wait_for_tick</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**seconds**=10.0</font>)
|
||||
The client tells the server to pause the simulation until a **<font color="#7fb800">World.tick()</font>** is received.
|
||||
This method is used in [__asynchronous__ mode](https://[carla.readthedocs.io](#carla.readthedocs.io)/en/latest/adv_synchrony_timestep/). It makes the client wait for a server tick. When the next frame is computed, the server will tick and return a snapshot describing the new state of the world.
|
||||
- **Parameters:**
|
||||
- `seconds` (_float<small> – seconds</small>_) – Maximum time the server should wait for a tick. It is set to <code>10.0</code> by default.
|
||||
- **Return:** _[carla.WorldSnapshot](#carla.WorldSnapshot)_
|
||||
|
@ -2700,7 +2702,7 @@ The method will create, return and spawn an actor into the world. The actor will
|
|||
- `attachment` (_[carla.AttachmentType](#carla.AttachmentType)_) – Determines how fixed and rigorous should be the changes in position according to its parent object.
|
||||
- **Return:** _[carla.Actor](#carla.Actor)_
|
||||
- <a name="carla.World.try_spawn_actor"></a>**<font color="#7fb800">try_spawn_actor</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**blueprint**</font>, <font color="#00a6ed">**transform**</font>, <font color="#00a6ed">**attach_to**=None</font>, <font color="#00a6ed">**attachment**=Rigid</font>)
|
||||
Same as **<font color="#7fb800">spawn_actor()</font>** but returns <b>None</b> on failure instead of throwing an exception.
|
||||
Same as __<font color="#7fb800">spawn_actor()</font>__ but returns <b>None</b> on failure instead of throwing an exception.
|
||||
- **Parameters:**
|
||||
- `blueprint` (_[carla.ActorBlueprint](#carla.ActorBlueprint)_) – The reference from which the actor will be created.
|
||||
- `transform` (_[carla.Transform](#carla.Transform)_) – Contains the location and orientation the actor will be spawned with.
|
||||
|
@ -2755,7 +2757,7 @@ Provided a landmark, returns the traffic sign object it describes.
|
|||
- `landmark` (_[carla.Landmark](#carla.Landmark)_) – The landmark object describing a traffic sign.
|
||||
- **Return:** _[carla.TrafficSign](#carla.TrafficSign)_
|
||||
- <a name="carla.World.get_random_location_from_navigation"></a>**<font color="#7fb800">get_random_location_from_navigation</font>**(<font color="#00a6ed">**self**</font>)
|
||||
This can only be used with walkers. It retrieves a random location to be used as a destination using the **<font color="#7fb800">go_to_location()</font>** method in [carla.WalkerAIController](#carla.WalkerAIController). This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
This can only be used with walkers. It retrieves a random location to be used as a destination using the __<font color="#7fb800">go_to_location()</font>__ method in [carla.WalkerAIController](#carla.WalkerAIController). This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
- **Return:** _[carla.Location](#carla.Location)_
|
||||
- <a name="carla.World.get_settings"></a>**<font color="#7fb800">get_settings</font>**(<font color="#00a6ed">**self**</font>)
|
||||
Returns an object containing some data about the simulation such as synchrony between client and server or rendering mode.
|
||||
|
@ -2798,7 +2800,7 @@ Ensures that the time elapsed between two steps of the simulation is fixed. Set
|
|||
|
||||
<h3>Methods</h3>
|
||||
- <a name="carla.WorldSettings.__init__"></a>**<font color="#7fb800">\__init__</font>**(<font color="#00a6ed">**self**</font>, <font color="#00a6ed">**synchronous_mode**=False</font>, <font color="#00a6ed">**no_rendering_mode**=False</font>, <font color="#00a6ed">**fixed_delta_seconds**=0.0</font>)
|
||||
Creates an object containing desired settings that could later be applied through [carla.World](#carla.World) and its method **<font color="#7fb800">apply_settings()</font>**.
|
||||
Creates an object containing desired settings that could later be applied through [carla.World](#carla.World) and its method __<font color="#7fb800">apply_settings()</font>__.
|
||||
- **Parameters:**
|
||||
- `synchronous_mode` (_bool_) – Set this to true to enable client-server synchrony.
|
||||
- `no_rendering_mode` (_bool_) – Set this to true to completely disable rendering in the simulation.
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
- param_name: wildcard_pattern
|
||||
type: str
|
||||
doc: >
|
||||
Filters a list of Actors matching `wildcard_pattern` against their variable **<font color="#f8805a">type_id</font>** (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
Filters a list of Actors matching `wildcard_pattern` against their variable __<font color="#f8805a">type_id</font>__ (which identifies the blueprint used to spawn them). Matching follows [fnmatch](https://docs.python.org/2/library/fnmatch.html) standard.
|
||||
# --------------------------------------
|
||||
- def_name: find
|
||||
return: carla.Actor
|
||||
|
@ -143,7 +143,7 @@
|
|||
doc: >
|
||||
Set a fixed time-step in between frames. <code>0.0</code> means variable time-step and it is the default mode.
|
||||
doc: >
|
||||
Creates an object containing desired settings that could later be applied through carla.World and its method **<font color="#7fb800">apply_settings()</font>**.
|
||||
Creates an object containing desired settings that could later be applied through carla.World and its method __<font color="#7fb800">apply_settings()</font>__.
|
||||
# --------------------------------------
|
||||
- def_name: __eq__
|
||||
return: bool
|
||||
|
@ -216,18 +216,18 @@
|
|||
- param_name: callback
|
||||
type: carla.WorldSnapshot
|
||||
doc: >
|
||||
A defined function with a snapshot as compulsory parameter that will be called every tick.
|
||||
Function with a snapshot as compulsory parameter that will be called when the client receives a tick.
|
||||
doc: >
|
||||
The method will start callbacks for a defined function `callback`. It will return the ID for this callback so it can be removed with **<font color="#7fb800">remove_on_tick()</font>**.
|
||||
This method is used in [__asynchronous__ mode](https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/). It starts callbacks from the client for the function defined as `callback`, and returns the ID of the callback. The function will be called everytime the server ticks. It requires a carla.WorldSnapshot as argument, which can be retrieved from __<font color="#7fb800">wait_for_tick()</font>__. Use __<font color="#7fb800">remove_on_tick()</font>__ to stop the callbacks.
|
||||
# --------------------------------------
|
||||
- def_name: remove_on_tick
|
||||
params:
|
||||
- param_name: callback_id
|
||||
type: callback
|
||||
doc: >
|
||||
The callback to be removed.
|
||||
The callback to be removed. The ID is returned when creating the callback.
|
||||
doc: >
|
||||
Stops the callback for `callback_id` started with **<font color="#7fb800">on_tick()</font>**.
|
||||
Stops the callback for `callback_id` started with __<font color="#7fb800">on_tick()</font>__.
|
||||
# --------------------------------------
|
||||
- def_name: tick
|
||||
return: int
|
||||
|
@ -239,7 +239,9 @@
|
|||
doc: >
|
||||
Maximum time the server should wait for a tick. It is set to <code>10.0</code> by default.
|
||||
doc: >
|
||||
This method only has effect on synchronous mode, when both client and server move together. The client tells the server when to step to the next frame and returns the id of the newly started frame.
|
||||
This method is used in [__synchronous__ mode](https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/), when the server waits for a client tick before computing the next frame. This method will send the tick, and give way to the server. It returns the ID of the new frame computed by the server.
|
||||
note: >
|
||||
If no tick is received in synchronous mode, the simulation will freeze. Also, if many ticks are received from different clients, there may be synchronization issues. Please read the docs about [synchronous mode](https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/) to learn more.
|
||||
# --------------------------------------
|
||||
- def_name: wait_for_tick
|
||||
return: carla.WorldSnapshot
|
||||
|
@ -251,7 +253,7 @@
|
|||
doc: >
|
||||
Maximum time the server should wait for a tick. It is set to <code>10.0</code> by default.
|
||||
doc: >
|
||||
The client tells the server to pause the simulation until a **<font color="#7fb800">World.tick()</font>** is received.
|
||||
This method is used in [__asynchronous__ mode](https://carla.readthedocs.io/en/latest/adv_synchrony_timestep/). It makes the client wait for a server tick. When the next frame is computed, the server will tick and return a snapshot describing the new state of the world.
|
||||
# --------------------------------------
|
||||
- def_name: spawn_actor
|
||||
return: carla.Actor
|
||||
|
@ -299,7 +301,7 @@
|
|||
doc: >
|
||||
Determines how fixed and rigorous should be the changes in position according to its parent object.
|
||||
doc: >
|
||||
Same as **<font color="#7fb800">spawn_actor()</font>** but returns <b>None</b> on failure instead of throwing an exception.
|
||||
Same as __<font color="#7fb800">spawn_actor()</font>__ but returns <b>None</b> on failure instead of throwing an exception.
|
||||
# --------------------------------------
|
||||
- def_name: get_actor
|
||||
return: carla.Actor
|
||||
|
@ -387,7 +389,7 @@
|
|||
- def_name: get_random_location_from_navigation
|
||||
return: carla.Location
|
||||
doc: >
|
||||
This can only be used with walkers. It retrieves a random location to be used as a destination using the **<font color="#7fb800">go_to_location()</font>** method in carla.WalkerAIController. This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
This can only be used with walkers. It retrieves a random location to be used as a destination using the __<font color="#7fb800">go_to_location()</font>__ method in carla.WalkerAIController. This location will be part of a sidewalk. Roads, crosswalks and grass zones are excluded. The method does not take into consideration locations of existing actors so if a collision happens when trying to spawn an actor, it will return an error. Take a look at [`spawn_npc.py`](https://github.com/carla-simulator/carla/blob/e73ad54d182e743b50690ca00f1709b08b16528c/PythonAPI/examples/spawn_npc.py#L179) for an example.
|
||||
# --------------------------------------
|
||||
- def_name: get_settings
|
||||
return: carla.WorldSettings
|
||||
|
|
Loading…
Reference in New Issue