Apply suggestions from code review

Co-Authored-By: Néstor Subirón <nsubiron@cvc.uab.es>
This commit is contained in:
Francesc Domene 2019-07-09 16:03:58 +02:00 committed by Néstor Subirón
parent b05722630d
commit 7aaa481f0e
7 changed files with 40 additions and 22 deletions

View File

@ -80,7 +80,7 @@ matrix:
- pip install -q --user -r PythonAPI/docs/requirements.txt
- pip install -q --user mkdocs
script:
- ./PythonAPI/docs/doc_gen.py
- make PythonAPI.docs
- git diff --quiet HEAD --; if [ ! $? -eq 0 ]; then echo "Python API reference changed, forgot to run doc_gen.py?"; exit 1; fi
- mkdocs build --verbose --clean --strict --site-dir _site

View File

@ -223,7 +223,7 @@
- param_name: wildcard_pattern
type: str
doc: >
Test if any of the flags matches wildcard_pattern.
Test if any of the flags or id matches wildcard_pattern.
note: >
Wildcard_pattern follows Unix shell-style wildcards.
# --------------------------------------
@ -278,11 +278,15 @@
type: str
doc: >
Filters a list of ActorBlueprint with id or tags matching wildcard_pattern.
The pattern is matched against each blueprint's id and tags.
note: >
wildcard_pattern follows Unix shell-style wildcards (fnmatch).
return: carla.BlueprintLibrary
# --------------------------------------
- def_name: __getitem__
params:
- param_name: pos
return: carla.BlueprintLibrary
return: carla.ActorBlueprint
doc: >
# --------------------------------------
- def_name: __len__

View File

@ -16,16 +16,17 @@
- param_name: host
type: str
doc: >
IP where Carla is running
IP address where a CARLA Simulator instance is running
- param_name: port
type: int
doc: >
Port where Carla is running
TCP port where the CARLA Simulator instance is running
- param_name: worker_threads
type: int
default: 0
doc: >
Number of working threads
Number of working threads used for background updates. If 0, use all
available concurrency.
doc: >
Client constructor
# --------------------------------------
@ -36,7 +37,7 @@
doc: >
New timeout value in seconds
doc: >
Sets the server timeout in seconds
Set the timeout in seconds allowed to block when doing networking calls
# --------------------------------------
- def_name: get_client_version
params:
@ -54,7 +55,7 @@
params:
return: carla.World
doc: >
Get the world object from where we can get other information about the map
Get the world currently active in the simulation
# --------------------------------------
- def_name: get_available_maps
params:
@ -73,16 +74,20 @@
params:
raises: RuntimeError
doc: >
Start again current world
Reload the current world, note that a new world is created with default
settings using the same map. All actors present in the world will be
destroyed.
# --------------------------------------
- def_name: load_world
params:
- param_name: map_name
type: str
doc: >
Name of the map to load, like '/Game/Carla/Maps/Town01'
Name of the map to load, accepts both full paths and map names, e.g.
'/Game/Carla/Maps/Town01' or 'Town01'.
doc: >
Load one of the available worlds on server
Load a new world with default settings using `map_name` map. All actors
present in the current world will be destroyed.
# --------------------------------------
- def_name: start_recorder
params:
@ -97,7 +102,7 @@
- def_name: stop_recorder
params:
doc: >
Stops the recording in curse.
Stops the recording in progress.
# --------------------------------------
- def_name: show_recorder_file_info
params:
@ -207,7 +212,7 @@
SetSimulatePhysics
SetAutopilot
doc: >
This function executes some commands altogether as fast as it can.
This function executes the whole list of commands on a single simulation step.
For example, to set autopilot on some actors, we could use:
[sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L126)
We don't have control about the response of each command. If we need that, we can use apply_batch_sync().
@ -221,7 +226,10 @@
A list of commands to execute in batch. For a list of commands available see function above apply_batch().
return: list
doc: >
This function executes some commands altogether as fast as it can one after the other, and returns another list with all the responses from each command.
This function executes the whole list of commands on a single simulation
step, blocks until the commands are executed, and returns a list of
carla.command.Response that can be used to determine whether a single
command succeeded or not.
[sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116)
# --------------------------------------
...

View File

@ -1,10 +1,13 @@
---
- module_name: commands
- module_name: command
doc: >
classes:
- class_name: Response
# - DESCRIPTION ------------------------
doc: >
Execution result of a command, contains either an error string or and
actor ID, depending on whether or not the command succeeded. See
`client.apply_batch_sync()`
# - PROPERTIES -------------------------
instance_variables:
- var_name: actor_id

View File

@ -122,7 +122,7 @@
parent: carla.Vector3D
# - DESCRIPTION ------------------------
doc: >
Represents a location in the world
Represents a location in the world (in meters).
# - PROPERTIES -------------------------
instance_variables:
- var_name: x
@ -154,7 +154,7 @@
The Location from where to compute the distance
return: float
doc: >
Computes the Euclidean distance between the current location to another one
Computes the Euclidean distance in meters from this location to another one
# --------------------------------------
- def_name: __eq__
params:
@ -173,7 +173,7 @@
- class_name: Rotation
# - DESCRIPTION ------------------------
doc: >
Class that represents a 3D rotation.
Class that represents a 3D rotation. All rotation angles are stored in degrees.
![UE4_Rotation](https://d26ilriwvtzlb.cloudfront.net/8/83/BRMC_9.jpg)
@ -282,7 +282,7 @@
- var_name: location
type: carla.Location
doc: >
The center of the bounding box in the world
The center of the bounding box relative to its parent actor.
- var_name: extent
type: carla.Vector3D
doc: >

View File

@ -20,7 +20,10 @@
- param_name: callback
type: function
doc: >
Function that will be called each time the sensor sends data. As a parameter, the function receives a buffer with the data.
Register a callback to be executed each time a new measurement is
received. The callback must accept a single argument containing the
sensor data; the type of this object varies depending on the type of
sensor, but they all derive from carla.SensorData.
doc: >
# --------------------------------------
- def_name: stop

View File

@ -32,7 +32,7 @@
- param_name: actor_id
type: int
doc: >
Find an ActorSnapshot by id.
Find an ActorSnapshot by id, return None if the actor is not found.
# --------------------------------------
- def_name: __len__
doc: >
@ -87,4 +87,4 @@
- def_name: __self__
doc: >
# --------------------------------------
...
...