Skip to content

Commit

Permalink
fix: initialization order (#101)
Browse files Browse the repository at this point in the history
* fix: initialization order

Signed-off-by: Hayato Mizushima <[email protected]>

* fix: order

Signed-off-by: Hayato Mizushima <[email protected]>

---------

Signed-off-by: Hayato Mizushima <[email protected]>
  • Loading branch information
hayato-m126 authored Feb 25, 2025
1 parent 3c67536 commit 0926a19
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ def __init__(self, name: str) -> None:
super().__init__(name, ObstacleSegmentationScenario, ObstacleSegmentationResult)
self._result: ObstacleSegmentationResult

# pub_goal_pose must be created before timer_cb is called
self.__goal_pose_counter = 0
self.__goal_pose = get_goal_pose_from_t4_dataset(self._t4_dataset_paths[0])
self.__pub_goal_pose = self.create_publisher(
PoseStamped,
"/planning/mission_planning/goal",
1,
)

self._scenario: ObstacleSegmentationScenario
self.__s_cfg = self._scenario.Evaluation.SensingEvaluationConfig
self.__s_cfg["evaluation_config_dict"]["label_prefix"] = "autoware"
Expand All @@ -84,6 +93,7 @@ def __init__(self, name: str) -> None:
"lanelet2_map.osm",
).as_posix()
self.__road_lanelets = road_lanelets_from_file(map_path)

if self._scenario.Evaluation.Conditions.NonDetection is not None:
self.__search_range = (
self._scenario.Evaluation.Conditions.NonDetection.ProposedArea.search_range()
Expand All @@ -94,8 +104,6 @@ def __init__(self, name: str) -> None:
self.__vehicle_model = (
self.get_parameter("vehicle_model").get_parameter_value().string_value
)
self.__goal_pose_counter = 0
self.__goal_pose = get_goal_pose_from_t4_dataset(self._t4_dataset_paths[0])

evaluation_config: SensingEvaluationConfig = SensingEvaluationConfig(
dataset_paths=self._t4_dataset_paths,
Expand Down Expand Up @@ -150,11 +158,6 @@ def __init__(self, name: str) -> None:
"marker/non_detection",
1,
)
self.__pub_goal_pose = self.create_publisher(
PoseStamped,
"/planning/mission_planning/goal",
1,
)
# for Autoware Evaluator visualization
self.__pub_graph_topic_rate = self.create_publisher(
ObstacleSegmentationMarker,
Expand Down

0 comments on commit 0926a19

Please sign in to comment.