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 (Client &client)
 

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

Client_client
 
carla::nav::Navigation _nav
 
unsigned long _next_check_index
 
AtomicList< WalkerHandle_walkers
 

Detailed Description

Definition at line 26 of file WalkerNavigation.h.

Constructor & Destructor Documentation

◆ WalkerNavigation()

carla::client::detail::WalkerNavigation::WalkerNavigation ( Client client)
explicit

Definition at line 23 of file WalkerNavigation.cpp.

References _client, _nav, carla::client::detail::Client::GetCacheFile(), carla::client::detail::Client::GetRequiredFiles(), and carla::nav::Navigation::Load().

+ 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 57 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 64 of file WalkerNavigation.cpp.

References _client, _nav, _next_check_index, carla::client::detail::EpisodeState::ContainsActorSnapshot(), carla::client::detail::Client::DestroyActor(), 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 65 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 33 of file WalkerNavigation.h.

References _walkers.

◆ RemoveWalker()

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

Definition at line 52 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 84 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 88 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 79 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 74 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 31 of file WalkerNavigation.cpp.

References _client, _nav, _walkers, carla::client::detail::Client::ApplyBatch(), CheckIfWalkerExist(), carla::nav::Navigation::GetWalkerSpeed(), carla::nav::Navigation::GetWalkerTransform(), 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 38 of file WalkerNavigation.h.

References _walkers.

Referenced by CheckIfWalkerExist().

+ 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 85 of file WalkerNavigation.cpp.

References _client, _nav, carla::rpc::DebugShape::color, carla::client::detail::Client::DrawDebugShape(), 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

◆ _client

Client& carla::client::detail::WalkerNavigation::_client
private

◆ _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 96 of file WalkerNavigation.h.

Referenced by CheckIfWalkerExist().

◆ _walkers

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

Definition at line 105 of file WalkerNavigation.h.

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


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