Prevent from segfault on missing SignalReference when loading OpenDrive (#6934)

* Prevent from segfault on missing SignalReference when loading OpenDrive

Prevent from segfault on failing SignalReference identification when
loading OpenDrive files

Since boost is compiled without exceptions in CARLA there is no
meaningful error handling for boost optional via exceptions. Therefore,
a validity check has to be introduced to react on potential issues.

* Update changelog

---------

Co-authored-by: Blyron <53337103+Blyron@users.noreply.github.com>
This commit is contained in:
berndgassmann 2023-11-27 16:18:46 +01:00 committed by GitHub
parent dd64af486a
commit 9490ec085d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View File

@ -1,5 +1,5 @@
## Latest
## Latest Changes
* Prevent from segfault on failing SignalReference identification when loading OpenDrive files
* Added vehicle doors to the recorder
## CARLA 0.9.15

View File

@ -36,11 +36,15 @@ void UYieldSignComponent::InitializeSign(const carla::road::Map &Map)
if(lane == 0)
continue;
auto signal_waypoint = Map.GetWaypoint(
RoadId, lane, SignalReference->GetS()).get();
if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving)
auto signal_waypoint_optional = Map.GetWaypoint(RoadId, lane, SignalReference->GetS());
if (!signal_waypoint_optional) {
carla::log_warning("YieldSignComponent::InitializeSignsignal() waypoint seems to be invalid, ignoring. RoadId:", RoadId, " LaneId:", lane, " s:", SignalReference->GetS());
continue;
}
auto signal_waypoint = signal_waypoint_optional.value();
if(Map.GetLane(signal_waypoint).GetType() != cr::Lane::LaneType::Driving) {
continue;
}
auto box_waypoint = signal_waypoint;
// Prevent adding the bounding box inside the intersection