From 1d0e3f77907cd1a710fe9aae6f3aa48cb8e9ee3b Mon Sep 17 00:00:00 2001 From: Marc Garcia Puig Date: Thu, 25 Apr 2019 14:50:43 +0200 Subject: [PATCH] Updated PythonAPI docs --- Docs/python_api.md | 56 ++++++++++++++++++++++++++++++--------- PythonAPI/docs/client.yml | 8 ++++++ 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/Docs/python_api.md b/Docs/python_api.md index 4f139bcef..7869f8b45 100644 --- a/Docs/python_api.md +++ b/Docs/python_api.md @@ -20,11 +20,11 @@ - [**load_world**(**self**, **map_name**)](#carla.Client.load_world) _Method_ - [**start_recorder**(**self**, **filename**)](#carla.Client.start_recorder) _Method_ - [**stop_recorder**(**self**)](#carla.Client.stop_recorder) _Method_ - - [**show_recorder_file_info**(**self**)](#carla.Client.show_recorder_file_info) _Method_ - - [**show_recorder_collisions**(**self**)](#carla.Client.show_recorder_collisions) _Method_ - - [**show_recorder_actors_blocked**(**self**)](#carla.Client.show_recorder_actors_blocked) _Method_ - - [**replay_file**(**self**)](#carla.Client.replay_file) _Method_ - - [**set_replayer_time_factor**(**self**)](#carla.Client.set_replayer_time_factor) _Method_ + - [**show_recorder_file_info**(**self**, **filename**, **show_all**=False)](#carla.Client.show_recorder_file_info) _Method_ + - [**show_recorder_collisions**(**self**, **filename**, **category1**='a', **category2**='a')](#carla.Client.show_recorder_collisions) _Method_ + - [**show_recorder_actors_blocked**(**self**, **filename**, **min_time**=60.0, **min_distance**=100.0)](#carla.Client.show_recorder_actors_blocked) _Method_ + - [**replay_file**(**self**, **filename**, **start**=0.0, **duration**=0.0, **camera**=0)](#carla.Client.replay_file) _Method_ + - [**set_replayer_time_factor**(**self**, **time_factor**)](#carla.Client.set_replayer_time_factor) _Method_ - [**apply_batch**(**self**)](#carla.Client.apply_batch) _Method_ - [**apply_batch_sync**(**self**)](#carla.Client.apply_batch_sync) _Method_ @@ -74,15 +74,47 @@ - **Parameters:** - `map_name` (_str_) – Name of the map to load. - **start_recorder**(**self**, **filename**) + 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'. - **Parameters:** - - `filename` (_str_) – Name of the recorder file to load. + - `filename` (_str_) – Name of the file to create. - **stop_recorder**(**self**) -- **show_recorder_file_info**(**self**) -- **show_recorder_collisions**(**self**) -- **show_recorder_actors_blocked**(**self**) -- **replay_file**(**self**) -- **set_replayer_time_factor**(**self**) + Stops the recording in curse. +- **show_recorder_file_info**(**self**, **filename**, **show_all**=False) + Will show info about the recorded file. 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. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `show_all` (_bool_) – Show all detailed info, or just a summary. +- **show_recorder_collisions**(**self**, **filename**, **category1**='a', **category2**='a') + 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 categories. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `category1` (_single char_) – Character specifying the category of the first actor. + - `category2` (_single char_) – Character specifying the category of the second actor. +- **show_recorder_actors_blocked**(**self**, **filename**, **min_time**=60.0, **min_distance**=100.0) + 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). + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to load. + - `min_time` (_float_) – How many seconds has to be stoped an actor to be considered as blocked. + - `min_distance` (_float_) – How many centimeters needs to displace an actor in order to not be considered as blocked. +- **replay_file**(**self**, **filename**, **start**=0.0, **duration**=0.0, **camera**=0) + Playback a file. + - **Parameters:** + - `filename` (_str_) – Name of the recorded file to play. + - `start` (_float_) – Time in seconds where to start the playback. If it is negative, then it starts from the end. + - `duration` (_float_) – Time of playback, after that time the playback stops and all the actors are left driving in autopilot. A value of 0 means playback until the end. + - `camera` (_int_) – Id of the actor to follow. If this is 0 then camera is disabled. +- **set_replayer_time_factor**(**self**, **time_factor**) + Apply a different playback speed to current playback. Can be used several times while a playback is in curse. + - **Parameters:** + - `time_factor` (_float_) – 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). - **apply_batch**(**self**) - **apply_batch_sync**(**self**) ---- +--- \ No newline at end of file diff --git a/PythonAPI/docs/client.yml b/PythonAPI/docs/client.yml index 903ae8512..8c8c2ff55 100644 --- a/PythonAPI/docs/client.yml +++ b/PythonAPI/docs/client.yml @@ -107,6 +107,7 @@ Name of the recorded file to load - param_name: show_all type: bool + default: False doc: > Show all detailed info, or just a summary doc: > @@ -122,10 +123,12 @@ Name of the recorded file to load - param_name: category1 type: single char + default: "'a'" doc: > Character specifying the category of the first actor - param_name: category2 type: single char + default: "'a'" doc: > Character specifying the category of the second actor doc: > @@ -149,10 +152,12 @@ Name of the recorded file to load - param_name: min_time type: float + default: 60.0 doc: > How many seconds has to be stoped an actor to be considered as blocked - param_name: min_distance type: float + default: 100.0 doc: > How many centimeters needs to displace an actor in order to not be considered as blocked doc: > @@ -169,15 +174,18 @@ Name of the recorded file to play - param_name: start type: float + default: 0.0 doc: > Time in seconds where to start the playback. If it is negative, then it starts from the end. - param_name: duration type: float + default: 0.0 doc: > Time of playback, after that time the playback stops and all the actors are left driving in autopilot. A value of 0 means playback until the end - param_name: camera type: int + default: 0 doc: > Id of the actor to follow. If this is 0 then camera is disabled doc: >