CARLA
Loading...
Searching...
No Matches
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:

Classes

struct  WalkerHandle
 

Public Member Functions

void AddWalker (ActorId walker_id, carla::geom::Location location)
 
std::optional< geom::Location > GetRandomLocation ()
 
bool IsServerSide () const
 True when the server hosts the navigation (World-Partitioned navmesh): the client-side Detour crowd stays disabled and walker AI goes through the walker_* RPCs instead.
 
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, bool server_side=false)
 

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
 
void UpdateVehiclesInCrowd (std::shared_ptr< Episode > episode, bool show_debug=false)
 add/update/delete all vehicles in crowd
 
- 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
 
const bool _server_side
 
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,
bool  server_side = false 
)
explicit

Member Function Documentation

◆ AddWalker()

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

Definition at line 63 of file WalkerNavigation.h.

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

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

References _nav, _next_check_index, _simulator, carla::client::detail::EpisodeState::ContainsActorSnapshot(), carla::nav::Navigation::RemoveAgent(), and UnregisterWalker().

Referenced by Tick().

◆ GetRandomLocation()

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

Definition at line 71 of file WalkerNavigation.h.

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

◆ IsServerSide()

bool carla::client::detail::WalkerNavigation::IsServerSide ( ) const
inline

True when the server hosts the navigation (World-Partitioned navmesh): the client-side Detour crowd stays disabled and walker AI goes through the walker_* RPCs instead.

Definition at line 35 of file WalkerNavigation.h.

References _server_side.

◆ RegisterWalker()

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

Definition at line 39 of file WalkerNavigation.h.

References _walkers.

◆ RemoveWalker()

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

Definition at line 58 of file WalkerNavigation.h.

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

◆ SetPedestriansCrossFactor()

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

Definition at line 90 of file WalkerNavigation.h.

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

◆ SetPedestriansSeed()

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

Definition at line 94 of file WalkerNavigation.h.

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

◆ SetWalkerMaxSpeed()

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

Definition at line 85 of file WalkerNavigation.h.

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

◆ SetWalkerTarget()

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

Definition at line 80 of file WalkerNavigation.h.

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

◆ Tick()

void carla::client::detail::WalkerNavigation::Tick ( std::shared_ptr< Episode >  episode)

◆ UnregisterWalker()

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

Definition at line 44 of file WalkerNavigation.h.

References _walkers.

Referenced by CheckIfWalkerExist(), and Tick().

◆ UpdateVehiclesInCrowd()

void carla::client::detail::WalkerNavigation::UpdateVehiclesInCrowd ( std::shared_ptr< Episode >  episode,
bool  show_debug = false 
)
private

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 102 of file WalkerNavigation.h.

Referenced by CheckIfWalkerExist().

◆ _server_side

const bool carla::client::detail::WalkerNavigation::_server_side
private

Definition at line 104 of file WalkerNavigation.h.

Referenced by IsServerSide(), Tick(), and WalkerNavigation().

◆ _simulator

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

◆ _walkers

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

Definition at line 113 of file WalkerNavigation.h.

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


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