Skip to content

Commit

Permalink
Merge branch 'main' into mau/fix/sensing/vehicle_velocity_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
YamatoAndo authored Nov 22, 2024
2 parents 343e543 + b8e4f83 commit 2c03a03
Show file tree
Hide file tree
Showing 136 changed files with 18,312 additions and 660 deletions.
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
### Automatically generated from package.xml ###
autoware_dependency_checker/** [email protected]
bag2lanelet/** [email protected] [email protected]
common/autoware_debug_tools/** [email protected] [email protected] [email protected]
common/mission_planner_rviz_plugin/** [email protected]
common/rtc_manager_rviz_plugin/** [email protected] [email protected]
common/tier4_automatic_goal_rviz_plugin/** [email protected] [email protected] [email protected] [email protected]
Expand All @@ -11,6 +13,7 @@ common/tier4_debug_tools/** [email protected]
common/tier4_logging_level_configure_rviz_plugin/** [email protected] [email protected] [email protected]
common/tier4_screen_capture_rviz_plugin/** [email protected] [email protected] [email protected]
common/tier4_simulated_clock_rviz_plugin/** [email protected]
common/tier4_string_viewer_rviz_plugin/** [email protected]
common/tier4_target_object_type_rviz_plugin/** [email protected]
control/control_debug_tools/** [email protected] [email protected]
control/stop_accel_evaluator/** [email protected]
Expand All @@ -20,6 +23,11 @@ driving_environment_analyzer/** [email protected]
evaluation/tier4_metrics_rviz_plugin/** [email protected] [email protected] [email protected] [email protected] [email protected]
localization/deviation_estimation_tools/deviation_estimator/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
localization/deviation_estimation_tools/deviation_evaluator/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
map/autoware_lanelet2_map_utils/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
map/autoware_lanelet2_map_validator/** [email protected] [email protected] [email protected] [email protected] [email protected] [email protected]
map/autoware_pointcloud_divider/** [email protected]
map/autoware_pointcloud_merger/** [email protected]
planning/autoware_planning_data_analyzer/** [email protected] [email protected]
planning/autoware_route_client/** [email protected]
planning/autoware_rtc_replayer/** [email protected] [email protected]
planning/planning_debug_tools/** [email protected] [email protected] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build-and-test-differential:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cancel-previous-workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
cancel-previous-workflows:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-build-depends.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
check-build-depends:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-pr-comments-manually.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: true
jobs:
clang-tidy-pr-comments-manually:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-pr-comments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
clang-tidy-pr-comments:
if: ${{ github.event.workflow_run.event == 'pull_request' && contains(fromJson('["success", "failure"]'), github.event.workflow_run.conclusion) }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/delete-closed-pr-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
delete-closed-pr-docs:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
deploy-docs:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
github-release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Set tag name
id: set-tag-name
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/json-schema-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
json-schema-check:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openai-pr-reviewer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
review:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: fluxninja/openai-pr-reviewer@latest
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-labeler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
label:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/labeler@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-optional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
pre-commit-optional:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
pre-commit:
if: ${{ github.event.repository.private }} # Use pre-commit.ci for public repositories
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Generate token
id: generate-token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spell-check-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
spell-check-all:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spell-check-partial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:

jobs:
spell-check-partial:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-files.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
sync-files:
needs: check-secret
if: ${{ needs.check-secret.outputs.set == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Generate token
id: generate-token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-codeowners-from-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
update-codeowners-from-packages:
needs: check-secret
if: ${{ needs.check-secret.outputs.set == 'true' }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Generate token
id: generate-token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(self, args, ylabel, output_suffix):
self.ymax = args.ymax
self.number_of_plot = args.number_of_plot
self.save_result = args.save_result
self.skip_plt_show = args.skip_plt_show
self.ylabel = ylabel
self.output_suffix = output_suffix

Expand Down Expand Up @@ -174,7 +175,8 @@ def run(self):
# save figure of plot
plt.savefig(f"./result/{output_name}-{timestamp}.png")

plt.show()
if not self.skip_plt_show:
plt.show()


def create_common_argment(ymax=None):
Expand All @@ -193,6 +195,13 @@ def create_common_argment(ymax=None):
parser.add_argument(
"-s", "--save-result", default=False, action="store_true", help="whether to save result"
)
parser.add_argument(
"-p",
"--skip_plt_show",
default=False,
action="store_true",
help="whether to skip plt.show()",
)

args = parser.parse_args()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,32 @@ def get_system_usage(pid, system_usages, interval):
)
if component == "":
component = "others"
container = process_name.split("__node:=", 1)[1].split(" ")[0]
system_usages[pid] = {
"component": component,
"container": container,
"cpu_usage": cpu_usage,
"memory_usage": memory_usage,
}

elements = process_name.split("__node:=", 1)

# If `process_name`` can be split by "__node:=", get the container name from the second element.
# Otherwise, get the container name from the file name in the first element.
# An example of `process_name` is as follows:
# `/path/to/autoware/install/topic_state_monitor/lib/topic_state_monitor/topic_state_monitor_node
# --ros-args -r __node:=topic_state_monitor_scenario_planning_trajectory -r __ns:=/system ...`
if len(elements) < 2:
container = process_name.split(" ")[0].split("/")[-1]
if container.startswith("autoware_"):
container = container.split("_", 1)[1]
system_usages[pid] = {
"component": component,
"container": container,
"cpu_usage": cpu_usage,
"memory_usage": memory_usage,
}
else:
container = elements[1].split(" ")[0]
system_usages[pid] = {
"component": component,
"container": container,
"cpu_usage": cpu_usage,
"memory_usage": memory_usage,
}
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess, IndexError):
pass

Expand Down Expand Up @@ -128,7 +147,7 @@ def main(args=None):
system_usages = {}
while True:
# create thread to calculate cpu usage of each process since it takes time
process_name_keyword = "__node:="
process_name_keyword = "--ros-args"
threads = []
for proc in psutil.process_iter(["pid", "name", "cpu_percent", "cmdline"]):
try:
Expand Down
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .launch_tree import LaunchTree # noqa
from .launch_tree import LaunchTreeNode # noqa
from .main import launch_file_analyse_main # noqa
from .string_utils import find_cmake_projects # noqa
from .string_utils import find_package # noqa
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import json
from typing import List


class LaunchTreeNode:
"""Each node in the launch tree is a LaunchTreeNode. It represents a launch file or a ros node."""

def __init__(self, name: str, **kwargs):
self.name = name
self.children: List[LaunchTreeNode] = []
self.parameters = kwargs

def add_child(self, child: "LaunchTreeNode"):
self.children.append(child)

def jsonify(self):
return {
"name": self.name,
"children": [child.jsonify() for child in self.children],
"parameters": self.parameters,
}


class LaunchTree:
"""Tree Structure to store the launch file structure."""

def __init__(self):
self.root = None
self.edges_manager = []
self.nodes_manager = {}

def get_node(self, node_name):
return self.nodes_manager[node_name]

def add_root(self, root_name, **kwargs):
if self.root is None:
self.root = LaunchTreeNode(root_name)
self.nodes_manager[root_name] = self.root
else:
print("Root already exists")

def add_child(self, parent_name, child_name, **kwargs):
if self.root is None:
self.root = LaunchTreeNode(parent_name)
self.nodes_manager[parent_name] = self.root

if parent_name not in self.nodes_manager:
# print(f"Parent node {parent_name} not found")
return

if child_name in self.nodes_manager:
# print(f"Child node {child_name} already exists")
return

child = LaunchTreeNode(child_name, **kwargs)
self.nodes_manager[child_name] = child
self.nodes_manager[parent_name].add_child(child)
self.edges_manager.append((parent_name, child_name))

def add_argument(self, node_name, argument_name, argument_value):
if node_name not in self.nodes_manager:
print(f"Node {node_name} not found")
return

self.nodes_manager[node_name].arguments[argument_name] = argument_value

def jsonify(self):
json_object = self.root.jsonify()
return json_object

def __repr__(self) -> str:
json_object = self.jsonify()
return json.dumps(json_object, indent=4)


def find_unset_parameters(tree: LaunchTree):
"""Find all unset parameters in the launch tree."""
unset_parameters = []
for node_name, node in tree.nodes_manager.items():
for parameter_name, parameter_value in node.parameters.items():
if parameter_value == "ERROR_PARAMETER_NOT_SET":
unset_parameters.append((node_name, parameter_name))
return unset_parameters
Loading

0 comments on commit 2c03a03

Please sign in to comment.