Skip to content

Commit

Permalink
Enhanced the variable validation
Browse files Browse the repository at this point in the history
  • Loading branch information
TakanoTaiga committed Oct 2, 2024
1 parent 89ae5b4 commit f4de90b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions simulation/traffic_simulator/src/entity/ego_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,13 @@ auto EgoEntity::getGoalPoses() -> std::vector<CanonicalizedLaneletPose>
dynamic_cast<concealer::FieldOperatorApplicationFor<concealer::AutowareUniverse> *>(
field_operator_application.get());
universe) {
lanelet_pose.push_back(traffic_simulator::pose::toCanonicalizedLaneletPose(
universe->getAutowareMissionRoute().goal_pose, false, hdmap_utils_ptr_)
.value());
if (const auto pose_opt = traffic_simulator::pose::toCanonicalizedLaneletPose(
universe->getAutowareMissionRoute().goal_pose, false, hdmap_utils_ptr_);
pose_opt.has_value()) {
lanelet_pose.push_back(pose_opt.value());
}
}

return lanelet_pose;
}

Expand Down

0 comments on commit f4de90b

Please sign in to comment.