CARLA
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
carla::client::detail::WalkerNavigation Class Reference

#include <WalkerNavigation.h>

+ Inheritance diagram for carla::client::detail::WalkerNavigation:
+ Collaboration diagram for carla::client::detail::WalkerNavigation:

Classes

struct  WalkerHandle
 

Public Member Functions

void AddWalker (ActorId walker_id, carla::geom::Location location)
 
boost::optional< geom::LocationGetRandomLocation ()
 
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
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=delete
 

Private Attributes

carla::nav::Navigation _nav
 
unsigned long _next_check_index
 
std::weak_ptr< Simulator_simulator
 
AtomicList< WalkerHandle_walkers
 

Detailed Description

Definition at line 25 of file WalkerNavigation.h.

Constructor & Destructor Documentation

◆ WalkerNavigation()

carla::client::detail::WalkerNavigation::WalkerNavigation ( std::weak_ptr< Simulator simulator)
explicit

Definition at line 24 of file WalkerNavigation.cpp.

References _nav, _simulator, carla::nav::Navigation::Load(), and carla::nav::Navigation::SetSimulator().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddWalker()

void carla::client::detail::WalkerNavigation::AddWalker ( ActorId  walker_id,
carla::geom::Location  location 
)
inline

Definition at line 56 of file WalkerNavigation.h.

References _nav, carla::nav::Navigation::AddWalker(), and Tick().

+ Here is the call graph for this function:

◆ CheckIfWalkerExist()

void carla::client::detail::WalkerNavigation::CheckIfWalkerExist ( std::vector< WalkerHandle walkers,
const EpisodeState state 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetRandomLocation()

boost::optional<geom::Location> carla::client::detail::WalkerNavigation::GetRandomLocation ( )
inline

Definition at line 64 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::GetRandomLocation().

+ Here is the call graph for this function:

◆ RegisterWalker()

void carla::client::detail::WalkerNavigation::RegisterWalker ( ActorId  walker_id,
ActorId  controller_id 
)
inline

Definition at line 32 of file WalkerNavigation.h.

References _walkers.

◆ RemoveWalker()

void carla::client::detail::WalkerNavigation::RemoveWalker ( ActorId  walker_id)
inline

Definition at line 51 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::RemoveAgent().

+ Here is the call graph for this function:

◆ SetPedestriansCrossFactor()

void carla::client::detail::WalkerNavigation::SetPedestriansCrossFactor ( float  percentage)
inline

Definition at line 83 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::SetPedestriansCrossFactor().

+ Here is the call graph for this function:

◆ SetPedestriansSeed()

void carla::client::detail::WalkerNavigation::SetPedestriansSeed ( unsigned int  seed)
inline

Definition at line 87 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::SetSeed().

+ Here is the call graph for this function:

◆ SetWalkerMaxSpeed()

bool carla::client::detail::WalkerNavigation::SetWalkerMaxSpeed ( ActorId  id,
float  max_speed 
)
inline

Definition at line 78 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::SetWalkerMaxSpeed().

+ Here is the call graph for this function:

◆ SetWalkerTarget()

bool carla::client::detail::WalkerNavigation::SetWalkerTarget ( ActorId  id,
const carla::geom::Location  to 
)
inline

Definition at line 73 of file WalkerNavigation.h.

References _nav, and carla::nav::Navigation::SetWalkerTarget().

+ Here is the call graph for this function:

◆ Tick()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UnregisterWalker()

void carla::client::detail::WalkerNavigation::UnregisterWalker ( ActorId  walker_id,
ActorId  controller_id 
)
inline

Definition at line 37 of file WalkerNavigation.h.

References _walkers.

Referenced by CheckIfWalkerExist(), and Tick().

+ Here is the caller graph for this function:

◆ UpdateVehiclesInCrowd()

void carla::client::detail::WalkerNavigation::UpdateVehiclesInCrowd ( std::shared_ptr< Episode episode,
bool  show_debug = false 
)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ _nav

carla::nav::Navigation carla::client::detail::WalkerNavigation::_nav
private

◆ _next_check_index

unsigned long carla::client::detail::WalkerNavigation::_next_check_index
private

Definition at line 95 of file WalkerNavigation.h.

Referenced by CheckIfWalkerExist().

◆ _simulator

std::weak_ptr<Simulator> carla::client::detail::WalkerNavigation::_simulator
private

◆ _walkers

AtomicList<WalkerHandle> carla::client::detail::WalkerNavigation::_walkers
private

Definition at line 104 of file WalkerNavigation.h.

Referenced by RegisterWalker(), Tick(), and UnregisterWalker().


The documentation for this class was generated from the following files: