diff --git a/LibCarla/source/carla/nav/Navigation.cpp b/LibCarla/source/carla/nav/Navigation.cpp index c1b09fbfd..c0f435aaa 100644 --- a/LibCarla/source/carla/nav/Navigation.cpp +++ b/LibCarla/source/carla/nav/Navigation.cpp @@ -1141,7 +1141,7 @@ namespace nav { agent->paused = pause; } - bool Navigation::HasVehicleNear(ActorId id, float distance) { + bool Navigation::HasVehicleNear(ActorId id, float distance, carla::geom::Location direction) { // get the internal index (walker or vehicle) auto it = _mapped_walkers_id.find(id); if (it == _mapped_walkers_id.end()) { @@ -1151,11 +1151,12 @@ namespace nav { } } + float dir[3] = { direction.x, direction.z, direction.y }; bool result; { // critical section, force single thread running this std::lock_guard lock(_mutex); - result = _crowd->hasVehicleNear(it->second, distance * distance, false); + result = _crowd->hasVehicleNear(it->second, distance * distance, dir, false); } return result; } diff --git a/LibCarla/source/carla/nav/Navigation.h b/LibCarla/source/carla/nav/Navigation.h index 3d24fe373..cc9d3bca4 100644 --- a/LibCarla/source/carla/nav/Navigation.h +++ b/LibCarla/source/carla/nav/Navigation.h @@ -103,9 +103,9 @@ namespace nav { /// set an agent as paused for the crowd void PauseAgent(ActorId id, bool pause); /// return if the agent has a vehicle near (as neighbour) - bool HasVehicleNear(ActorId id, float distance); + bool HasVehicleNear(ActorId id, float distance, carla::geom::Location direction); /// make agent look at some location - bool SetWalkerLookAt(ActorId id, carla::geom::Location location); + bool SetWalkerLookAt(ActorId id, carla::geom::Location location); dtCrowd *GetCrowd() { return _crowd; }; diff --git a/Util/BuildTools/Setup.sh b/Util/BuildTools/Setup.sh old mode 100644 new mode 100755