diff --git a/CHANGELOG.md b/CHANGELOG.md index b9f79a22a..76ae069bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## Latest Changes + * Fix ActorList returned by ActorList.Filter(...) * Add --rolename to manual_control.py * Migrate Content to AWS * Adding a parser to represent the map as a connected graph of waypoints. diff --git a/LibCarla/source/carla/client/ActorList.cpp b/LibCarla/source/carla/client/ActorList.cpp index a8e06e4f7..faad12923 100644 --- a/LibCarla/source/carla/client/ActorList.cpp +++ b/LibCarla/source/carla/client/ActorList.cpp @@ -29,11 +29,11 @@ namespace client { return nullptr; } - ActorList ActorList::Filter(const std::string &wildcard_pattern) const { - ActorList filtered{_episode, {}}; + SharedPtr ActorList::Filter(const std::string &wildcard_pattern) const { + SharedPtr filtered (new ActorList(_episode, {})); for (auto &&actor : _actors) { if (StringUtil::Match(actor.GetTypeId(), wildcard_pattern)) { - filtered._actors.push_back(actor); + filtered->_actors.push_back(actor); } } return filtered; diff --git a/LibCarla/source/carla/client/ActorList.h b/LibCarla/source/carla/client/ActorList.h index 545134682..c99aebb98 100644 --- a/LibCarla/source/carla/client/ActorList.h +++ b/LibCarla/source/carla/client/ActorList.h @@ -31,7 +31,7 @@ namespace client { SharedPtr Find(ActorId actor_id) const; /// Filters a list of Actor with type id matching @a wildcard_pattern. - ActorList Filter(const std::string &wildcard_pattern) const; + SharedPtr Filter(const std::string &wildcard_pattern) const; SharedPtr operator[](size_t pos) const { return _actors[pos].Get(_episode, shared_from_this());