CARLA
Public Member Functions | Private Member Functions | Private Attributes | List of all members
carla::nav::WalkerManager Class Reference

#include <WalkerManager.h>

+ Inheritance diagram for carla::nav::WalkerManager:
+ Collaboration diagram for carla::nav::WalkerManager:

Public Member Functions

bool AddWalker (ActorId id)
 create a new walker route More...
 
NavigationGetNavigation ()
 return the navigation object More...
 
bool GetWalkerCrosswalkEnd (ActorId id, carla::geom::Location &location)
 get the point in the route that end current crosswalk More...
 
bool GetWalkerNextPoint (ActorId id, carla::geom::Location &location)
 get the next point in the route More...
 
bool RemoveWalker (ActorId id)
 remove a walker route More...
 
void SetNav (Navigation *nav)
 assign the navigation module More...
 
bool SetWalkerNextPoint (ActorId id)
 set the next point in the route More...
 
bool SetWalkerRoute (ActorId id)
 set a new route from its current position More...
 
bool SetWalkerRoute (ActorId id, carla::geom::Location to)
 
bool Update (double delta)
 update all routes More...
 
 WalkerManager ()
 
 ~WalkerManager ()
 

Private Member Functions

EventResult ExecuteEvent (ActorId id, WalkerInfo &info, double delta)
 
- 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

Navigation_nav { nullptr }
 
std::unordered_map< ActorId, WalkerInfo_walkers
 

Detailed Description

Definition at line 42 of file WalkerManager.h.

Constructor & Destructor Documentation

◆ WalkerManager()

carla::nav::WalkerManager::WalkerManager ( )

Definition at line 13 of file WalkerManager.cpp.

References _nav.

◆ ~WalkerManager()

carla::nav::WalkerManager::~WalkerManager ( )

Definition at line 17 of file WalkerManager.cpp.

Member Function Documentation

◆ AddWalker()

bool carla::nav::WalkerManager::AddWalker ( ActorId  id)

create a new walker route

Definition at line 21 of file WalkerManager.cpp.

References _walkers, carla::nav::WalkerInfo::state, and carla::nav::WALKER_IDLE.

Referenced by carla::nav::Navigation::AddWalker().

+ Here is the caller graph for this function:

◆ ExecuteEvent()

EventResult carla::nav::WalkerManager::ExecuteEvent ( ActorId  id,
WalkerInfo info,
double  delta 
)
private

Definition at line 249 of file WalkerManager.cpp.

References carla::nav::WalkerInfo::currentIndex, carla::nav::WalkerRoutePoint::event, and carla::nav::WalkerInfo::route.

Referenced by Update().

+ Here is the caller graph for this function:

◆ GetNavigation()

Navigation* carla::nav::WalkerManager::GetNavigation ( )
inline

return the navigation object

Definition at line 75 of file WalkerManager.h.

Referenced by carla::nav::WalkerEventVisitor::operator()().

+ Here is the caller graph for this function:

◆ GetWalkerCrosswalkEnd()

bool carla::nav::WalkerManager::GetWalkerCrosswalkEnd ( ActorId  id,
carla::geom::Location location 
)

get the point in the route that end current crosswalk

Definition at line 223 of file WalkerManager.cpp.

References _nav, _walkers, carla::nav::CARLA_AREA_CROSSWALK, carla::nav::WalkerInfo::currentIndex, and carla::nav::WalkerInfo::route.

Referenced by carla::nav::WalkerEventVisitor::operator()().

+ Here is the caller graph for this function:

◆ GetWalkerNextPoint()

bool carla::nav::WalkerManager::GetWalkerNextPoint ( ActorId  id,
carla::geom::Location location 
)

get the next point in the route

Definition at line 201 of file WalkerManager.cpp.

References _nav, _walkers, carla::nav::WalkerInfo::currentIndex, and carla::nav::WalkerInfo::route.

◆ RemoveWalker()

bool carla::nav::WalkerManager::RemoveWalker ( ActorId  id)

remove a walker route

Definition at line 32 of file WalkerManager.cpp.

References _walkers.

Referenced by carla::nav::Navigation::RemoveAgent().

+ Here is the caller graph for this function:

◆ SetNav()

void carla::nav::WalkerManager::SetNav ( Navigation nav)
inline

assign the navigation module

Definition at line 50 of file WalkerManager.h.

References carla::nav::WalkerRoutePoint::location.

Referenced by carla::nav::Navigation::Navigation().

+ Here is the caller graph for this function:

◆ SetWalkerNextPoint()

bool carla::nav::WalkerManager::SetWalkerNextPoint ( ActorId  id)

set the next point in the route

Definition at line 166 of file WalkerManager.cpp.

References _nav, _walkers, carla::nav::WalkerInfo::currentIndex, carla::nav::Navigation::PauseAgent(), carla::nav::WalkerInfo::route, carla::nav::Navigation::SetWalkerDirectTarget(), SetWalkerRoute(), carla::nav::WalkerInfo::state, carla::nav::WALKER_STOP, and carla::nav::WALKER_WALKING.

Referenced by SetWalkerRoute(), and Update().

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

◆ SetWalkerRoute() [1/2]

bool carla::nav::WalkerManager::SetWalkerRoute ( ActorId  id)

set a new route from its current position

Definition at line 96 of file WalkerManager.cpp.

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

Referenced by SetWalkerNextPoint(), carla::nav::Navigation::SetWalkerTarget(), Update(), and carla::nav::Navigation::UpdateCrowd().

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

◆ SetWalkerRoute() [2/2]

bool carla::nav::WalkerManager::SetWalkerRoute ( ActorId  id,
carla::geom::Location  to 
)

◆ Update()

bool carla::nav::WalkerManager::Update ( double  delta)

update all routes

Definition at line 43 of file WalkerManager.cpp.

References _nav, _walkers, carla::nav::Continue, carla::nav::WalkerInfo::currentIndex, carla::nav::End, ExecuteEvent(), carla::nav::Navigation::GetWalkerPosition(), carla::nav::WalkerInfo::route, SetWalkerNextPoint(), SetWalkerRoute(), carla::geom::Vector3D::SquaredLength(), carla::nav::WalkerInfo::state, carla::nav::TimeOut, carla::nav::WALKER_IDLE, carla::nav::WALKER_IN_EVENT, carla::nav::WALKER_STOP, carla::nav::WALKER_WALKING, carla::geom::Vector3D::x, carla::geom::Vector3D::y, and carla::geom::Vector3D::z.

Referenced by carla::nav::Navigation::UpdateCrowd().

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

Member Data Documentation

◆ _nav

Navigation* carla::nav::WalkerManager::_nav { nullptr }
private

◆ _walkers

std::unordered_map<ActorId, WalkerInfo> carla::nav::WalkerManager::_walkers
private

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