Revision ad7447b3e726de653f2c77f4db63fb0c383dc555 authored by Francesc Domene on 04 July 2019, 13:50:10 UTC, committed by Néstor Subirón on 09 July 2019, 17:18:46 UTC
1 parent a847f8a
client.yml
---
- module_name: carla
doc: >
# - CLASSES ------------------------------
classes:
- class_name: Client
# - DESCRIPTION ------------------------
doc: >
Client used to connect to a Carla server
# - PROPERTIES -------------------------
instance_variables:
# - METHODS ----------------------------
methods:
- def_name: __init__
params:
- param_name: host
type: str
doc: >
IP where Carla is running
- param_name: port
type: int
doc: >
Port where Carla is running
- param_name: worker_threads
type: int
default: 0
doc: >
Number of working threads
doc: >
Client constructor
# --------------------------------------
- def_name: set_timeout
params:
- param_name: seconds
type: float
doc: >
New timeout value in seconds
doc: >
Sets the server timeout in seconds
# --------------------------------------
- def_name: get_client_version
params:
return: str
doc: >
Get the client version as a string
# --------------------------------------
- def_name: get_server_version
params:
return: str
doc: >
Get the server version as a string
# --------------------------------------
- def_name: get_world
params:
return: carla.World
doc: >
Get the world object from where we can get other information about the map
# --------------------------------------
- def_name: get_available_maps
params:
return: list(str)
doc: >
Get a list of strings of the maps available on server. The result can be something like:
'/Game/Carla/Maps/Town01'
'/Game/Carla/Maps/Town02'
'/Game/Carla/Maps/Town03'
'/Game/Carla/Maps/Town04'
'/Game/Carla/Maps/Town05'
'/Game/Carla/Maps/Town06'
'/Game/Carla/Maps/Town07'
# --------------------------------------
- def_name: reload_world
params:
raises: RuntimeError
doc: >
Start again current world
# --------------------------------------
- def_name: load_world
params:
- param_name: map_name
type: str
doc: >
Name of the map to load, like '/Game/Carla/Maps/Town01'
doc: >
Load one of the available worlds on server
# --------------------------------------
- def_name: start_recorder
params:
- param_name: filename
type: str
doc: >
Name of the file to write the recorded data
doc: >
If we use a simple name like 'recording.log' then it will be saved at server folder 'CarlaUE4/Saved/recording.log'.
If we use some folder in the name, then it will be considered to be an absolute path, like '/home/carla/recording.log'.
# --------------------------------------
- def_name: stop_recorder
params:
doc: >
Stops the recording in curse.
# --------------------------------------
- def_name: show_recorder_file_info
params:
- param_name: filename
type: str
doc: >
Name of the recorded file to load
- param_name: show_all
type: bool
doc: >
Show all detailed info, or just a summary
doc: >
Will show info about the recorded file (frames, times, events, state, positions...)
We have the option to show all the details per frame, that includes all the traffic light states, position of all actors, and animations data.
# --------------------------------------
- def_name: show_recorder_collisions
params:
- param_name: filename
type: str
doc: >
Name of the recorded file to load
- param_name: category1
type: single char
doc: >
Character specifying the category of the first actor
- param_name: category2
type: single char
doc: >
Character specifying the category of the second actor
doc: >
This will show which collisions were recorded in the file. We can use a filter for the collisions we want, using two categories.
The categories can be:
'h' = Hero
'v' = Vehicle
'w' = Walker
't' = Traffic light
'o' = Other
'a' = Any
So, if you want to see only collisions about a vehicle and a walker, we would use for category1 'v' and category2 'w'.
Or if you want all the collisions (filter off) you can use 'a' as both categories.
# --------------------------------------
- def_name: show_recorder_actors_blocked
params:
- param_name: filename
type: str
doc: >
Name of the recorded file to load
- param_name: min_time
type: float
doc: >
How many seconds has to be stoped an actor to be considered as blocked
- param_name: min_distance
type: float
doc: >
How many centimeters needs to move the actor in order to be considered as moving, and not blocked
doc: >
Shows which actors seems blocked by some reason.
The idea is to calculate which actors are not moving as much as 'min_distance' for a period of 'min_time'.
By default min_time = 60 seconds (1 min) and min_distance = 100 centimeters (1 m).
# --------------------------------------
- def_name: replay_file
params:
- param_name: name
type: str
doc: >
Name of the file.
- param_name: start
type: float
doc: >
Time in seconds where to start the playback. If it is negative, then it starts from the end.
- param_name: duration
type: float
doc: >
Id of the actor to follow. If this is 0 then camera is disabled
- param_name: follow_id
type: int
doc: >
doc: >
Playback a file
# --------------------------------------
- def_name: set_replayer_time_factor
params:
- param_name: time_factor
type: float
doc: >
A value of 1.0 means normal time factor.
A value < 1.0 means slow motion (for example 0.5 is half speed)
A value > 1.0 means fast motion (for example 2.0 is double speed)
doc: >
Apply a different playback speed to current playback. Can be used several times while a playback is in curse.
# --------------------------------------
- def_name: apply_batch
params:
- param_name: commands
type: list
doc: >
A list of commands to execute in batch. Each command have a different number of parameters.
Currently we can use these [commands](#commands.ApplyAngularVelocity):
SpawnActor
DestroyActor
ApplyVehicleControl
ApplyWalkerControl
ApplyTransform
ApplyVelocity
AplyAngularVelocity
ApplyImpulse
SetSimulatePhysics
SetAutopilot
doc: >
This function executes some commands altogether as fast as it can.
For example, to set autopilot on 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().
# --------------------------------------
- def_name: apply_batch_sync
params:
- param_name: commands
type: list
doc: >
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.
[sample_code](https://github.com/carla-simulator/carla/blob/10c5f6a482a21abfd00220c68c7f12b4110b7f63/PythonAPI/examples/spawn_npc.py#L112-L116)
# --------------------------------------
...
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...