Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ground_segmentation_evaluator #528

Open
wants to merge 67 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
d4b8285
[update] ground seg evaluator as DLR node
Jan 4, 2024
e6d56c2
[update] append sub-node
Jan 4, 2024
bd26359
[update] adjust launch, append rviz config for ground seg eval
Jan 4, 2024
9958801
test
nanoshimarobot Jan 4, 2024
0a08ce8
del test
nanoshimarobot Jan 4, 2024
257d999
[update] publish eval result
nanoshimarobot Jan 7, 2024
4dd07a0
[update] writeout ground-seg eval result
nanoshimarobot Jan 7, 2024
3dd6d63
[update] eval process time
nanoshimarobot Jan 20, 2024
66a4330
[update] add guard process
nanoshimarobot Jan 21, 2024
8f58c2d
[update] delete process time eval
nanoshimarobot Jan 27, 2024
55bc5bd
[fix] delete process time eval
nanoshimarobot Feb 23, 2024
edf3ff5
[update]
nanoshimarobot Feb 23, 2024
4079792
[tmp] 一時退避
nanoshimarobot Apr 11, 2024
f71ff7e
[fix] ground seg eval sub node
nanoshimarobot Apr 17, 2024
c5b1cb3
Merge branch 'feat/ground_segmentation_eval' into feat/ground_segment…
nanoshimarobot Apr 17, 2024
e61cf27
[update] add pcd eval
nanoshimarobot Apr 23, 2024
135aaf9
[update] debug output
nanoshimarobot Apr 29, 2024
d162b94
[update] not to build sub node
nanoshimarobot May 9, 2024
3cf21e0
[update] add get gt frame timestamp
nanoshimarobot May 9, 2024
d4e1af2
[refactor]
nanoshimarobot May 10, 2024
52d83c6
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot May 10, 2024
8dd1434
[update] play_delay 30.0→10.0
nanoshimarobot May 10, 2024
5959a1e
[remove] sub-eval node
nanoshimarobot May 27, 2024
3518d1b
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot May 27, 2024
884983e
[update] add accuracy to GroundSegmentationEvalResult
nanoshimarobot Jun 6, 2024
f499796
[update] evaluator node
nanoshimarobot Jun 6, 2024
c278703
[update] ground segmentation
nanoshimarobot Jun 6, 2024
928b355
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jun 6, 2024
339777a
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jun 10, 2024
6524f3e
[update] add copyright
nanoshimarobot Jun 11, 2024
e9d962b
[update] add new line at end of msg file
nanoshimarobot Jun 11, 2024
f436852
[modify] some deprecated parts
nanoshimarobot Jun 11, 2024
d85027e
[modify] use get_logger()
nanoshimarobot Jun 11, 2024
6a14816
[modify] import
nanoshimarobot Jun 11, 2024
572866d
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jun 11, 2024
cc2e297
[update] disable sensing when running autoware
nanoshimarobot Jun 25, 2024
a7ccd93
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jun 25, 2024
cf375bc
[update] add sub evaluator node for ground segmenatation
nanoshimarobot Jul 11, 2024
d694029
[update] add evaluation using annotated rosbag
nanoshimarobot Jul 11, 2024
182ab18
[refactor] remove debug output from sub-node
nanoshimarobot Jul 11, 2024
0d624d7
Merge branch 'develop' into feat/ground_segmentation_eval_integ
nanoshimarobot Jul 11, 2024
6b8efd9
[remove] sub_eval node
nanoshimarobot Jul 18, 2024
61d81c6
[update] add eval method for annotated rosbag to evaluator_node
nanoshimarobot Jul 18, 2024
408bc88
Merge branch 'develop' into feat/ground_segmentation_eval_integ
nanoshimarobot Jul 18, 2024
e44397a
[update] CMakeLists, package.xml
nanoshimarobot Jul 18, 2024
ce5591e
[update] selct label in scenario.yaml
nanoshimarobot Jul 18, 2024
c8ac0c6
[update] add sample scenario
nanoshimarobot Jul 18, 2024
98c6932
[refactor]
nanoshimarobot Jul 18, 2024
c6ce10b
[remove] unused imports
nanoshimarobot Jul 18, 2024
d30dd53
[refactor] error message is too long
nanoshimarobot Jul 18, 2024
2d5098f
[remove] unused configs
nanoshimarobot Jul 18, 2024
af8650e
[refactor]
nanoshimarobot Jul 18, 2024
84c72bf
[update] new line
nanoshimarobot Jul 18, 2024
ad511fb
[reformatted]
nanoshimarobot Jul 19, 2024
aaa3ada
[reformatted]
nanoshimarobot Jul 19, 2024
a131962
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jul 23, 2024
aa3073f
[update] display warning if input cloud has no sematic field
nanoshimarobot Jul 25, 2024
a824221
[update] add launch_arg to select evaluation target topic
nanoshimarobot Jul 26, 2024
48093f8
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Jul 26, 2024
040d079
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Aug 15, 2024
07ba5cc
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Aug 19, 2024
8cb2a47
[update] add ground_segmentation to USE_T4_DATASET
nanoshimarobot Aug 19, 2024
6973d00
[update] scenario, config.toml
nanoshimarobot Aug 19, 2024
4b22a99
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Sep 9, 2024
5a48bb1
[fix] modified sensor. vehicle model
nanoshimarobot Sep 9, 2024
24bbfcc
[fix] modified .vscode
nanoshimarobot Sep 9, 2024
a6f6701
Merge branch 'develop' into feat/ground_segmentation_pcd_eval
nanoshimarobot Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions driving_log_replayer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ install(PROGRAMS
scripts/perception_database_result.py
scripts/perception_2d_evaluator_node.py
scripts/traffic_light_evaluator_node.py
scripts/ground_segmentation_evaluator_node.py
scripts/obstacle_segmentation_evaluator_node.py
scripts/performance_diag_evaluator_node.py
scripts/localization_evaluator_node.py
Expand Down
100 changes: 100 additions & 0 deletions driving_log_replayer/driving_log_replayer/ground_segmentation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Copyright (c) 2024 TierIV.inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from dataclasses import dataclass
from typing import Literal

from pydantic import BaseModel

from driving_log_replayer.result import EvaluationItem
from driving_log_replayer.result import ResultBase
from driving_log_replayer.scenario import number
from driving_log_replayer.scenario import Scenario
from driving_log_replayer_msgs.msg import GroundSegmentationEvalResult


class Condition(BaseModel):
Method: Literal["annotated_pcd", "annotated_rosbag"]
ground_label: number
obstacle_label: number
accuracy_min: number
accuracy_max: number
PassRate: number


class Evaluation(BaseModel):
UseCaseName: Literal["ground_segmentation"]
UseCaseFormatVersion: Literal["0.3.0"]
Conditions: Condition


class GroundSegmentationScenario(Scenario):
Evaluation: Evaluation


@dataclass
class GroundSegmentation(EvaluationItem):
name: str = "Ground Segmentation"

def set_frame(self, msg: GroundSegmentationEvalResult) -> dict:
self.condition: Condition
self.total += 1

frame_success = self.condition.accuracy_min <= msg.accuracy <= self.condition.accuracy_max

if frame_success:
self.passed += 1

current_rate = self.rate()
self.success = current_rate >= self.condition.PassRate
self.summary = f"{self.name} ({self.success_str()}): {self.passed} / {self.total} -> {current_rate:.2f}"

return {
"GroundSegmentation": {
"Result": {
"Total": self.success_str(),
"Frame": "Success" if frame_success else "Fail",
},
"Info": {
"TP": msg.tp,
"FP": msg.fp,
"TN": msg.tn,
"FN": msg.fn,
"Accuracy": msg.accuracy,
"Precision": msg.precision,
"Recall": msg.recall,
"Specificity": msg.specificity,
"F1-score": msg.f1_score,
},
},
}


class GroundSegmentationResult(ResultBase):
def __init__(self, condition: Condition) -> None:
super().__init__()
self.__ground_segmentation = GroundSegmentation(condition=condition)

def update(self) -> None:
summary_str = f"{self.__ground_segmentation.summary}"
if self.__ground_segmentation.success:
self._success = True
self._summary = f"Passed: {summary_str}"
else:
self._success = False
self._summary = f"Failed: {summary_str}"

def set_frame(self, msg: GroundSegmentationEvalResult) -> None:
self._frame = self.__ground_segmentation.set_frame(msg)
self.update()
67 changes: 67 additions & 0 deletions driving_log_replayer/launch/ground_segmentation.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright (c) 2024 TierIV.inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import launch
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration

import driving_log_replayer.launch_common as cmn

RECORD_TOPIC_REGEX = """^/clock$\
|^/tf$\
|^/driving_log_replayer/.*\
"""


def generate_launch_description() -> launch.LaunchDescription:
launch_arguments = cmn.get_launch_arguments()
launch_arguments.append(
DeclareLaunchArgument(
"evaluation_target_topic",
default_value="/perception/obstacle_segmentation/pointcloud",
),
)
autoware_launch = cmn.get_autoware_launch(
sensing="false",
localization="false",
planning="false",
control="false",
scenario_simulation="true",
perception_mode="lidar",
)

evaluator_node = cmn.get_evaluator_node(
"ground_segmentation",
addition_parameter={
"vehicle_model": LaunchConfiguration("vehicle_model"),
"evaluation_target_topic": LaunchConfiguration("evaluation_target_topic"),
},
)
player = cmn.get_player()

recorder, recorder_override = cmn.get_regex_recorders(
"obstacle_segmentation.qos.yaml",
RECORD_TOPIC_REGEX,
)

return launch.LaunchDescription(
[
*launch_arguments,
autoware_launch,
evaluator_node,
player,
recorder,
recorder_override,
],
)
Loading
Loading