Fixing docs

This commit is contained in:
bernatx 2021-11-04 10:07:41 +01:00 committed by bernat
parent 4284ebb0e1
commit 115fe2d915
6 changed files with 1433 additions and 1213 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -424,18 +424,53 @@
doc: >
On the next tick, the control will move the walker in a certain direction with a certain speed. Jumps can be commanded too.
# --------------------------------------
- def_name: apply_control
params:
- param_name: control
type: carla.WalkerBoneControl
doc: >
On the next tick, the control defines a list of bone transformations that will be applied to the walker's skeleton.
# --------------------------------------
- def_name: get_control
return: carla.WalkerControl
doc: >
The client returns the control applied to this walker during last tick. The method does not call the simulator.
# --------------------------------------
- def_name: get_bones
return: carla.WalkerBoneControlOut
doc: >
Return the structure with all the bone transformations from the actor. For each bone, we get the name and its transform in three different spaces:
- name: bone name
- world: transform in world coordinates
- component: transform based on the pivot of the actor
- relative: transform based on the bone parent
# --------------------------------------
- def_name: set_bones
params:
- param_name: bones
type: carla.WalkerBoneControlIn
param_units: list of pairs (bone_name, transform) for the bones that we want to set
doc: >
Set the bones of the actor. For each bone we want to set we use a relative transform. Only the bones in this list will be set. For each bone you need to setup this info:
- name: bone name
- relative: transform based on the bone parent
# --------------------------------------
- def_name: blend_pose
params:
- param_name: blend_value
type: float
param_units: value from 0 to 1 with the blend percentage
doc: >
Set the blending value of the custom pose with the animation. The values can be:
- 0: will show only the animation
- 1: will show only the custom pose (set by the user with set_bones())
- any other: will interpolate all the bone positions between animation and the custom pose
# --------------------------------------
- def_name: show_pose
doc: >
Show the custom pose and hide the animation (same as calling blend_pose(1))
# --------------------------------------
- def_name: hide_pose
doc: >
Hide the custom pose and show the animation (same as calling blend_pose(0))
# --------------------------------------
- def_name: get_pose_from_animation
doc: >
Make a copy of the current animation frame as the custom pose. Initially the custom pose is the neutral pedestrian pose.
# --------------------------------------
- def_name: __str__
# --------------------------------------

View File

@ -164,7 +164,7 @@ def generate_pb_docs():
md.list_push(code(attr.id))
md.text(' ' + parentheses(italic(str(attr.type))))
if attr.is_modifiable:
md.text(sub(italic(' Modifiable')))
md.text(' ' + sub(italic('- Modifiable')))
md.list_popn()
md.list_pop()
md.list_pop()

View File

@ -88,7 +88,7 @@
- class_name: WalkerControl
doc: >
This class defines specific directions that can be commanded to a carla.Walker to control it via script. The walker's animations will blend automatically with the parameters defined in this class when applied, though specific skeleton moves can be obtained through class.WalkerBoneControl.
This class defines specific directions that can be commanded to a carla.Walker to control it via script.
AI control can be settled for walkers, but the control used to do so is carla.WalkerAIController.
@ -142,7 +142,26 @@
- def_name: __str__
# --------------------------------------
- class_name: WalkerBoneControl
- class_name: WalkerBoneControlOut
# - DESCRIPTION ------------------------
doc: >
This class is used to return all bone positions of a pedestrian. For each bone we get its _name_ and its transform in three different spaces (world, actor and relative).
# - PROPERTIES -------------------------
instance_variables:
- var_name: bone_transforms
type: list([name,world, actor, relative])
doc: >
List of one entry per bone with this information:
- name: bone name
- world: transform in world coordinates
- component: transform based on the pivot of the actor
- relative: transform based on the bone parent
# - METHODS ----------------------------
methods:
- def_name: __str__
# --------------------------------------
- class_name: WalkerBoneControlIn
# - DESCRIPTION ------------------------
doc: >
This class grants bone specific manipulation for walker. The skeletons of walkers have been unified for clarity and the transform applied to each bone are always relative to its parent. Take a look [here](tuto_G_control_walker_skeletons.md) to learn more on how to create a walker and define its movement.
@ -151,7 +170,9 @@
- var_name: bone_transforms
type: list([name,transform])
doc: >
List of tuples where the first value is the bone's name and the second value stores the transformation (changes in location and rotation) that will be applied to it.
List with the data for each bone we want to set:
- name: bone name
- relative: transform based on the bone parent
# - METHODS ----------------------------
methods:
- def_name: __init__

View File

@ -265,6 +265,7 @@ def append_code_snipets(md):
snipets_path = os.path.join(current_folder, '../../Docs/python_api_snipets.md')
snipets = open(snipets_path, 'r')
md.text(snipets.read())
snipets.close()
os.remove(snipets_path)
@ -393,13 +394,13 @@ def add_doc_method_param(md, param):
if valid_dic_val(param, 'doc'):
param_doc = create_hyperlinks(md.prettify_doc(param['doc']))
if valid_dic_val(param, 'param_units'):
param_units = small_html(' '+param['param_units'])
param_units = small_html(' - '+param['param_units'])
param_type = '' if not param_type else parentheses(italic(param_type+param_units))
md.list_push(code(param_name))
if param_type:
md.text(' ' + param_type)
if param_doc:
md.textn(' ' + param_doc)
md.textn(' - ' + param_doc)
else:
md.new_line()
md.list_pop()
@ -436,7 +437,7 @@ def add_doc_method(md, method, class_key):
md.list_push(bold('Return:') + ' ')
return_units = ''
if valid_dic_val(method, 'return_units'):
return_units = small_html(' '+method['return_units'])
return_units = small_html(' - '+method['return_units'])
md.textn(italic(create_hyperlinks(method['return'])+return_units))
md.list_pop()
@ -490,7 +491,7 @@ def add_doc_getter_setter(md, method, class_key, is_getter, other_list):
md.list_push(bold('Return:') + ' ')
return_units = ''
if valid_dic_val(method, 'return_units'):
return_units = small_html(' '+method['return_units'])
return_units = small_html(' - '+method['return_units'])
md.textn(italic(create_hyperlinks(method['return'])+return_units))
md.list_pop()
@ -566,7 +567,7 @@ def add_doc_inst_var(md, inst_var, class_key):
# Instance variable type
if valid_dic_val(inst_var, 'type'):
if valid_dic_val(inst_var, 'var_units'):
var_units = small_html(' '+inst_var['var_units'])
var_units = small_html(' - '+inst_var['var_units'])
var_type = ' ' + parentheses(italic(create_hyperlinks(inst_var['type']+var_units)))
md.list_pushn(
html_key(var_key) +