diff --git a/CHANGELOG.md b/CHANGELOG.md index dd6a7be18..138f015a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ ## Latest Changes + * Fixed a bug that caused navigation information not to be loaded when switching maps * Prevent from segfault on failing SignalReference identification when loading OpenDrive files * Added vehicle doors to the recorder * Added functions to get actor' components transform diff --git a/LibCarla/source/carla/client/detail/Simulator.cpp b/LibCarla/source/carla/client/detail/Simulator.cpp index 8b4089a88..5083dd378 100644 --- a/LibCarla/source/carla/client/detail/Simulator.cpp +++ b/LibCarla/source/carla/client/detail/Simulator.cpp @@ -88,6 +88,12 @@ namespace detail { const auto id = GetCurrentEpisode().GetId(); _client.LoadEpisode(std::move(map_name), reset_settings, map_layers); + // delete the pointer to _episode so that the Navigation information + // will be loaded for the correct map + assert(_episode.use_count() == 1); + _episode.reset(); + GetReadyCurrentEpisode(); + // We are waiting 50ms for the server to reload the episode. // If in this time we have not detected a change of episode, we try again // 'number_of_attempts' times.