#include <WalkerNavigation.h>
Classes | |
struct | WalkerHandle |
Public Member Functions | |
void | AddWalker (ActorId walker_id, carla::geom::Location location) |
boost::optional< geom::Location > | GetRandomLocation () |
void | RegisterWalker (ActorId walker_id, ActorId controller_id) |
void | RemoveWalker (ActorId walker_id) |
void | SetPedestriansCrossFactor (float percentage) |
void | SetPedestriansSeed (unsigned int seed) |
bool | SetWalkerMaxSpeed (ActorId id, float max_speed) |
bool | SetWalkerTarget (ActorId id, const carla::geom::Location to) |
void | Tick (std::shared_ptr< Episode > episode) |
void | UnregisterWalker (ActorId walker_id, ActorId controller_id) |
WalkerNavigation (std::weak_ptr< Simulator > simulator) | |
Private Member Functions | |
void | CheckIfWalkerExist (std::vector< WalkerHandle > walkers, const EpisodeState &state) |
check a few walkers and if they don't exist then remove from the crowd More... | |
void | UpdateVehiclesInCrowd (std::shared_ptr< Episode > episode, bool show_debug=false) |
add/update/delete all vehicles in crowd More... | |
Private Member Functions inherited from carla::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable (NonCopyable &&)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
NonCopyable & | operator= (NonCopyable &&)=delete |
Private Attributes | |
carla::nav::Navigation | _nav |
unsigned long | _next_check_index |
std::weak_ptr< Simulator > | _simulator |
AtomicList< WalkerHandle > | _walkers |
Definition at line 25 of file WalkerNavigation.h.
|
explicit |
Definition at line 24 of file WalkerNavigation.cpp.
References _nav, _simulator, carla::nav::Navigation::Load(), and carla::nav::Navigation::SetSimulator().
|
inline |
Definition at line 56 of file WalkerNavigation.h.
References _nav, carla::nav::Navigation::AddWalker(), and Tick().
|
private |
check a few walkers and if they don't exist then remove from the crowd
Definition at line 83 of file WalkerNavigation.cpp.
References _nav, _next_check_index, _simulator, carla::client::detail::EpisodeState::ContainsActorSnapshot(), carla::nav::Navigation::RemoveAgent(), and UnregisterWalker().
Referenced by Tick().
|
inline |
Definition at line 64 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::GetRandomLocation().
|
inline |
Definition at line 32 of file WalkerNavigation.h.
References _walkers.
|
inline |
Definition at line 51 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::RemoveAgent().
|
inline |
Definition at line 83 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::SetPedestriansCrossFactor().
|
inline |
Definition at line 87 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::SetSeed().
|
inline |
Definition at line 78 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::SetWalkerMaxSpeed().
|
inline |
Definition at line 73 of file WalkerNavigation.h.
References _nav, and carla::nav::Navigation::SetWalkerTarget().
void carla::client::detail::WalkerNavigation::Tick | ( | std::shared_ptr< Episode > | episode | ) |
Definition at line 33 of file WalkerNavigation.cpp.
References _nav, _simulator, _walkers, CheckIfWalkerExist(), carla::nav::Navigation::GetWalkerSpeed(), carla::nav::Navigation::GetWalkerTransform(), carla::nav::Navigation::IsWalkerAlive(), carla::nav::Navigation::RemoveAgent(), UnregisterWalker(), carla::nav::Navigation::UpdateCrowd(), and UpdateVehiclesInCrowd().
Referenced by AddWalker().
|
inline |
Definition at line 37 of file WalkerNavigation.h.
References _walkers.
Referenced by CheckIfWalkerExist(), and Tick().
|
private |
add/update/delete all vehicles in crowd
Definition at line 104 of file WalkerNavigation.cpp.
References _nav, _simulator, carla::rpc::DebugShape::color, carla::nav::Navigation::GetCrowd(), carla::nav::VehicleCollisionInfo::id, carla::rpc::DebugShape::life_time, carla::rpc::DebugShape::persistent_lines, carla::rpc::DebugShape::primitive, carla::client::ActorSnapshot::transform, carla::nav::Navigation::UpdateVehicles(), carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.
Referenced by Tick().
|
private |
Definition at line 97 of file WalkerNavigation.h.
Referenced by AddWalker(), CheckIfWalkerExist(), GetRandomLocation(), RemoveWalker(), SetPedestriansCrossFactor(), SetPedestriansSeed(), SetWalkerMaxSpeed(), SetWalkerTarget(), Tick(), UpdateVehiclesInCrowd(), and WalkerNavigation().
|
private |
Definition at line 95 of file WalkerNavigation.h.
Referenced by CheckIfWalkerExist().
|
private |
Definition at line 93 of file WalkerNavigation.h.
Referenced by CheckIfWalkerExist(), Tick(), UpdateVehiclesInCrowd(), and WalkerNavigation().
|
private |
Definition at line 104 of file WalkerNavigation.h.
Referenced by RegisterWalker(), Tick(), and UnregisterWalker().