forked from autowarefoundation/autoware.universe
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #783 from tier4/sync-upstream
chore: sync upstream
- Loading branch information
Showing
36 changed files
with
545 additions
and
318 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ common/component_interface_tools/** [email protected] [email protected] m | |
common/component_interface_utils/** [email protected] [email protected] [email protected] [email protected] | ||
common/cuda_utils/** [email protected] [email protected] | ||
common/fake_test_node/** [email protected] [email protected] [email protected] [email protected] | ||
common/geography_utils/** [email protected] | ||
common/global_parameter_loader/** [email protected] | ||
common/glog_component/** [email protected] | ||
common/goal_distance_calculator/** [email protected] | ||
|
@@ -117,7 +118,7 @@ perception/lidar_apollo_segmentation_tvm/** [email protected] xinyu.wang@ | |
perception/lidar_apollo_segmentation_tvm_nodes/** [email protected] [email protected] | ||
perception/lidar_centerpoint/** [email protected] [email protected] | ||
perception/lidar_centerpoint_tvm/** [email protected] [email protected] | ||
perception/map_based_prediction/** [email protected] [email protected] [email protected] [email protected] | ||
perception/map_based_prediction/** [email protected] shunsuke.miura@tier4.jp takayuki.murooka@tier4.jp [email protected] [email protected] [email protected] | ||
perception/multi_object_tracker/** [email protected] [email protected] | ||
perception/object_merger/** [email protected] [email protected] | ||
perception/object_range_splitter/** [email protected] | ||
|
@@ -166,7 +167,7 @@ planning/freespace_planning_algorithms/** [email protected] takamasa.hori | |
planning/mission_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] | ||
planning/motion_velocity_smoother/** [email protected] [email protected] [email protected] [email protected] | ||
planning/obstacle_avoidance_planner/** [email protected] [email protected] [email protected] | ||
planning/obstacle_cruise_planner/** [email protected] [email protected] | ||
planning/obstacle_cruise_planner/** [email protected] [email protected] [email protected] [email protected] | ||
planning/obstacle_stop_planner/** [email protected] [email protected] [email protected] [email protected] [email protected] | ||
planning/obstacle_velocity_limiter/** [email protected] | ||
planning/path_smoother/** [email protected] [email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import json | ||
|
||
from tabulate import tabulate | ||
|
||
# This file is for defining macros for mkdocs-macros plugin | ||
# Check https://mkdocs-macros-plugin.readthedocs.io/en/latest/macros/ for the details | ||
|
||
|
||
def format_param_type(param_type): | ||
if param_type == "number": | ||
return "float" | ||
else: | ||
return param_type | ||
|
||
|
||
def format_param_range(param): | ||
list_of_range = [] | ||
if "enum" in param.keys(): | ||
list_of_range.append(param["enum"]) | ||
if "minimum" in param.keys(): | ||
list_of_range.append("≥" + str(param["minimum"])) | ||
if "exclusiveMinimum" in param.keys(): | ||
list_of_range.append(">" + str(param["exclusiveMinimum"])) | ||
if "maximum" in param.keys(): | ||
list_of_range.append("≤" + str(param["maximum"])) | ||
if "exclusiveMaximum" in param.keys(): | ||
list_of_range.append("<" + str(param["exclusiveMaximum"])) | ||
if "exclusive" in param.keys(): | ||
list_of_range.append("≠" + str(param["exclusive"])) | ||
|
||
if len(list_of_range) == 0: | ||
return "N/A" | ||
else: | ||
range_in_text = "" | ||
for item in list_of_range: | ||
if range_in_text != "": | ||
range_in_text += "<br/>" | ||
range_in_text += str(item) | ||
return range_in_text | ||
|
||
|
||
def extract_parameter_info(parameters, namespace=""): | ||
params = [] | ||
for k, v in parameters.items(): | ||
if v["type"] != "object": | ||
param = {} | ||
param["Name"] = namespace + k | ||
param["Type"] = format_param_type(v["type"]) | ||
param["Description"] = v["description"] | ||
param["Default"] = v["default"] | ||
param["Range"] = format_param_range(v) | ||
params.append(param) | ||
else: # if the object is namespace, then dive deeper in to json value | ||
params.extend(extract_parameter_info(v["properties"], k + ".")) | ||
return params | ||
|
||
|
||
def format_json(json_data): | ||
parameters = list(json_data["definitions"].values())[0]["properties"] | ||
# cspell: ignore tablefmt | ||
markdown_table = tabulate(extract_parameter_info(parameters), headers="keys", tablefmt="github") | ||
return markdown_table | ||
|
||
|
||
def define_env(env): | ||
@env.macro | ||
def json_to_markdown(json_schema_file_path): | ||
with open(json_schema_file_path) as f: | ||
data = json.load(f) | ||
return format_json(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.