CARLA
 
载入中...
搜索中...
未找到
Public 成员函数 | Private 成员函数 | Private 属性 | 所有成员列表
carla::nav::Navigation类 参考

Manage the pedestrians navigation, using the Recast & Detour library for low level calculations. 更多...

#include <Navigation.h>

+ 类 carla::nav::Navigation 继承关系图:
+ carla::nav::Navigation 的协作图:

Public 成员函数

bool AddOrUpdateVehicle (VehicleCollisionInfo &vehicle)
 create a new vehicle in crowd to be avoided by walkers
 
bool AddWalker (ActorId id, carla::geom::Location from)
 create a new walker
 
void CreateCrowd (void)
 create the crowd object
 
bool GetAgentRoute (ActorId id, carla::geom::Location from, carla::geom::Location to, std::vector< carla::geom::Location > &path, std::vector< unsigned char > &area)
 
dtCrowd * GetCrowd ()
 
double GetDeltaSeconds ()
 return the last delta seconds
 
bool GetPath (carla::geom::Location from, carla::geom::Location to, dtQueryFilter *filter, std::vector< carla::geom::Location > &path, std::vector< unsigned char > &area)
 return the path points to go from one position to another
 
bool GetRandomLocation (carla::geom::Location &location, dtQueryFilter *filter=nullptr) const
 get a random location for navigation
 
bool GetWalkerPosition (ActorId id, carla::geom::Location &location)
 get the walker current location
 
float GetWalkerSpeed (ActorId id)
 get the walker current transform
 
bool GetWalkerTransform (ActorId id, carla::geom::Transform &trans)
 get the walker current transform
 
bool HasVehicleNear (ActorId id, float distance, carla::geom::Location direction)
 return if the agent has a vehicle near (as neighbour)
 
bool IsWalkerAlive (ActorId id, bool &alive)
 return if the agent has been killed by a vehicle
 
bool Load (const std::string &filename)
 load navigation data
 
bool Load (std::vector< uint8_t > content)
 load navigation data from memory
 
 Navigation ()
 
void PauseAgent (ActorId id, bool pause)
 set an agent as paused for the crowd
 
bool RemoveAgent (ActorId id)
 remove an agent
 
void SetPedestriansCrossFactor (float percentage)
 set the probability that an agent could cross the roads in its path following
 
void SetSeed (unsigned int seed)
 set the seed to use with random numbers
 
void SetSimulator (std::weak_ptr< carla::client::detail::Simulator > simulator)
 reference to the simulator to access API functions
 
bool SetWalkerDirectTarget (ActorId id, carla::geom::Location to)
 
bool SetWalkerDirectTargetIndex (int index, carla::geom::Location to)
 
bool SetWalkerLookAt (ActorId id, carla::geom::Location location)
 make agent look at some location
 
bool SetWalkerMaxSpeed (ActorId id, float max_speed)
 set new max speed
 
bool SetWalkerTarget (ActorId id, carla::geom::Location to)
 set a new target point to go through a route with events
 
void UpdateCrowd (const client::detail::EpisodeState &state)
 update all walkers in crowd
 
bool UpdateVehicles (std::vector< VehicleCollisionInfo > vehicles)
 add/update/delete vehicles in crowd
 
 ~Navigation ()
 

Private 成员函数

void SetAgentFilter (int agent_index, int filter_index)
 assign a filter index to an agent
 
- Private 成员函数 继承自 carla::NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=delete
 

Private 属性

std::vector< uint8_t > _binary_mesh
 
dtCrowd * _crowd { nullptr }
 crowd
 
double _delta_seconds { 0.0 }
 
std::unordered_map< int, ActorId_mapped_by_index
 
std::unordered_map< ActorId, int > _mapped_vehicles_id
 
std::unordered_map< ActorId, int > _mapped_walkers_id
 mapping Id
 
std::mutex _mutex
 
dtNavMesh * _nav_mesh { nullptr }
 meshes
 
dtNavMeshQuery * _nav_query { nullptr }
 
float _probability_crossing { 0.0f }
 
bool _ready { false }
 
std::weak_ptr< carla::client::detail::Simulator_simulator
 
double _time_to_unblock { 0.0 }
 
WalkerManager _walker_manager
 walker manager for the route planning with events
 
std::unordered_map< int, carla::geom::Vector3D_walkers_blocked_position
 saves the position of each actor at intervals and check if any is blocked
 
std::unordered_map< ActorId, float > _yaw_walkers
 store walkers yaw angle from previous tick
 

详细描述

Manage the pedestrians navigation, using the Recast & Detour library for low level calculations.

This class gets the binary content of the map from the server, which is required for the path finding. Then this class can add or remove pedestrians, and also set target points to walk for each one.

在文件 Navigation.h57 行定义.

构造及析构函数说明

◆ Navigation()

carla::nav::Navigation::Navigation ( )

在文件 Navigation.cpp51 行定义.

引用了 _walker_manager , 以及 carla::nav::WalkerManager::SetNav().

+ 函数调用图:

◆ ~Navigation()

carla::nav::Navigation::~Navigation ( )

成员函数说明

◆ AddOrUpdateVehicle()

bool carla::nav::Navigation::AddOrUpdateVehicle ( VehicleCollisionInfo & vehicle)

create a new vehicle in crowd to be avoided by walkers

在文件 Navigation.cpp534 行定义.

引用了 _crowd, _mapped_by_index, _mapped_vehicles_id, _mutex, _ready, carla::nav::AGENT_HEIGHT, carla::nav::VehicleCollisionInfo::bounding, DEBUG_ASSERT, carla::nav::DT_CROWD_SEPARATION, carla::geom::BoundingBox::extent, carla::nav::VehicleCollisionInfo::id, carla::geom::Transform::location, carla::logging::log(), carla::geom::Transform::rotation, carla::nav::VehicleCollisionInfo::transform, carla::geom::Vector3D::x, carla::geom::Vector3D::y, carla::geom::Rotation::yaw , 以及 carla::geom::Vector3D::z.

被这些函数引用 UpdateVehicles().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ AddWalker()

bool carla::nav::Navigation::AddWalker ( ActorId id,
carla::geom::Location from )

create a new walker

在文件 Navigation.cpp473 行定义.

引用了 _crowd, _mapped_by_index, _mapped_walkers_id, _mutex, _probability_crossing, _ready, _walker_manager, _yaw_walkers, carla::nav::WalkerManager::AddWalker(), carla::nav::AGENT_HEIGHT, carla::nav::AGENT_RADIUS, DEBUG_ASSERT, carla::nav::DT_CROWD_ANTICIPATE_TURNS, carla::nav::DT_CROWD_OBSTACLE_AVOIDANCE, carla::nav::DT_CROWD_SEPARATION, carla::nav::frand(), carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::client::detail::WalkerNavigation::AddWalker().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ CreateCrowd()

void carla::nav::Navigation::CreateCrowd ( void )

create the crowd object

在文件 Navigation.cpp201 行定义.

引用了 _crowd, _nav_mesh, _ready, carla::nav::AGENT_RADIUS, carla::nav::AREA_GRASS_COST, carla::nav::AREA_ROAD_COST, carla::nav::CARLA_AREA_GRASS, carla::nav::CARLA_AREA_ROAD, carla::nav::CARLA_TYPE_NONE, carla::nav::CARLA_TYPE_ROAD, carla::nav::CARLA_TYPE_WALKABLE, DEBUG_ASSERT, carla::logging::log() , 以及 carla::nav::MAX_AGENTS.

被这些函数引用 Load().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetAgentRoute()

bool carla::nav::Navigation::GetAgentRoute ( ActorId id,
carla::geom::Location from,
carla::geom::Location to,
std::vector< carla::geom::Location > & path,
std::vector< unsigned char > & area )

在文件 Navigation.cpp372 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _nav_mesh, _nav_query, _ready, DEBUG_ASSERT, carla::nav::MAX_POLYS, carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::nav::WalkerManager::SetWalkerRoute().

+ 这是这个函数的调用关系图:

◆ GetCrowd()

dtCrowd * carla::nav::Navigation::GetCrowd ( )
inline

在文件 Navigation.h116 行定义.

引用了 _crowd.

被这些函数引用 carla::client::detail::WalkerNavigation::UpdateVehiclesInCrowd().

+ 这是这个函数的调用关系图:

◆ GetDeltaSeconds()

double carla::nav::Navigation::GetDeltaSeconds ( )
inline

return the last delta seconds

在文件 Navigation.h119 行定义.

引用了 _delta_seconds.

◆ GetPath()

bool carla::nav::Navigation::GetPath ( carla::geom::Location from,
carla::geom::Location to,
dtQueryFilter * filter,
std::vector< carla::geom::Location > & path,
std::vector< unsigned char > & area )

◆ GetRandomLocation()

bool carla::nav::Navigation::GetRandomLocation ( carla::geom::Location & location,
dtQueryFilter * filter = nullptr ) const

get a random location for navigation

在文件 Navigation.cpp1062 行定义.

引用了 _mutex, _nav_query, _ready, carla::nav::CARLA_TYPE_NONE, carla::nav::CARLA_TYPE_SIDEWALK, DEBUG_ASSERT, carla::nav::frand(), carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::client::detail::WalkerNavigation::GetRandomLocation(), carla::nav::WalkerManager::SetWalkerRoute() , 以及 UpdateCrowd().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ GetWalkerPosition()

bool carla::nav::Navigation::GetWalkerPosition ( ActorId id,
carla::geom::Location & location )

get the walker current location

在文件 Navigation.cpp987 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _ready, DEBUG_ASSERT, carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::nav::WalkerEventVisitor::operator()(), carla::nav::WalkerManager::SetWalkerRoute() , 以及 carla::nav::WalkerManager::Update().

+ 这是这个函数的调用关系图:

◆ GetWalkerSpeed()

float carla::nav::Navigation::GetWalkerSpeed ( ActorId id)

get the walker current transform

在文件 Navigation.cpp1028 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _ready , 以及 DEBUG_ASSERT.

被这些函数引用 carla::client::detail::WalkerNavigation::Tick().

+ 这是这个函数的调用关系图:

◆ GetWalkerTransform()

bool carla::nav::Navigation::GetWalkerTransform ( ActorId id,
carla::geom::Transform & trans )

get the walker current transform

在文件 Navigation.cpp923 行定义.

引用了 _crowd, _delta_seconds, _mapped_walkers_id, _mutex, _ready, _yaw_walkers, DEBUG_ASSERT, carla::geom::Transform::location, min(), carla::geom::Transform::rotation, carla::geom::Vector3D::x, carla::geom::Vector3D::y, carla::geom::Rotation::yaw , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::client::detail::WalkerNavigation::Tick().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ HasVehicleNear()

bool carla::nav::Navigation::HasVehicleNear ( ActorId id,
float distance,
carla::geom::Location direction )

return if the agent has a vehicle near (as neighbour)

在文件 Navigation.cpp1157 行定义.

引用了 _crowd, _mapped_vehicles_id, _mapped_walkers_id, _mutex, carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 carla::nav::WalkerEventVisitor::operator()().

+ 这是这个函数的调用关系图:

◆ IsWalkerAlive()

bool carla::nav::Navigation::IsWalkerAlive ( ActorId id,
bool & alive )

return if the agent has been killed by a vehicle

在文件 Navigation.cpp1214 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _ready , 以及 DEBUG_ASSERT.

被这些函数引用 carla::client::detail::WalkerNavigation::Tick().

+ 这是这个函数的调用关系图:

◆ Load() [1/2]

bool carla::nav::Navigation::Load ( const std::string & filename)

load navigation data

在文件 Navigation.cpp83 行定义.

引用了 Load().

被这些函数引用 Load() , 以及 carla::client::detail::WalkerNavigation::WalkerNavigation().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ Load() [2/2]

bool carla::nav::Navigation::Load ( std::vector< uint8_t > content)

load navigation data from memory

在文件 Navigation.cpp100 行定义.

引用了 _binary_mesh, _nav_mesh, _nav_query, _ready, CreateCrowd(), carla::logging::log() , 以及 carla::nav::MAX_QUERY_SEARCH_NODES.

+ 函数调用图:

◆ PauseAgent()

void carla::nav::Navigation::PauseAgent ( ActorId id,
bool pause )

set an agent as paused for the crowd

在文件 Navigation.cpp1125 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _ready , 以及 DEBUG_ASSERT.

被这些函数引用 carla::nav::WalkerEventVisitor::operator()() , 以及 carla::nav::WalkerManager::SetWalkerNextPoint().

+ 这是这个函数的调用关系图:

◆ RemoveAgent()

bool carla::nav::Navigation::RemoveAgent ( ActorId id)

remove an agent

在文件 Navigation.cpp663 行定义.

引用了 _crowd, _mapped_by_index, _mapped_vehicles_id, _mapped_walkers_id, _mutex, _ready, _walker_manager, DEBUG_ASSERT , 以及 carla::nav::WalkerManager::RemoveWalker().

被这些函数引用 carla::client::detail::WalkerNavigation::CheckIfWalkerExist(), carla::client::detail::WalkerNavigation::RemoveWalker(), carla::client::detail::WalkerNavigation::Tick() , 以及 UpdateVehicles().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ SetAgentFilter()

void carla::nav::Navigation::SetAgentFilter ( int agent_index,
int filter_index )
private

assign a filter index to an agent

在文件 Navigation.cpp1103 行定义.

引用了 _crowd , 以及 _mutex.

被这些函数引用 UpdateCrowd().

+ 这是这个函数的调用关系图:

◆ SetPedestriansCrossFactor()

void carla::nav::Navigation::SetPedestriansCrossFactor ( float percentage)

set the probability that an agent could cross the roads in its path following

在文件 Navigation.cpp1119 行定义.

引用了 _probability_crossing.

被这些函数引用 carla::client::detail::WalkerNavigation::SetPedestriansCrossFactor().

+ 这是这个函数的调用关系图:

◆ SetSeed()

void carla::nav::Navigation::SetSeed ( unsigned int seed)

set the seed to use with random numbers

在文件 Navigation.cpp78 行定义.

被这些函数引用 carla::client::detail::WalkerNavigation::SetPedestriansSeed().

+ 这是这个函数的调用关系图:

◆ SetSimulator()

void carla::nav::Navigation::SetSimulator ( std::weak_ptr< carla::client::detail::Simulator > simulator)

reference to the simulator to access API functions

在文件 Navigation.cpp71 行定义.

引用了 _simulator, _walker_manager , 以及 carla::nav::WalkerManager::SetSimulator().

被这些函数引用 carla::client::detail::WalkerNavigation::WalkerNavigation().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ SetWalkerDirectTarget()

bool carla::nav::Navigation::SetWalkerDirectTarget ( ActorId id,
carla::geom::Location to )

在文件 Navigation.cpp782 行定义.

引用了 _mapped_walkers_id, _ready , 以及 SetWalkerDirectTargetIndex().

被这些函数引用 carla::nav::WalkerManager::SetWalkerNextPoint().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ SetWalkerDirectTargetIndex()

bool carla::nav::Navigation::SetWalkerDirectTargetIndex ( int index,
carla::geom::Location to )

在文件 Navigation.cpp799 行定义.

引用了 _crowd, _mutex, _nav_query, _ready, DEBUG_ASSERT, carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

被这些函数引用 SetWalkerDirectTarget().

+ 这是这个函数的调用关系图:

◆ SetWalkerLookAt()

bool carla::nav::Navigation::SetWalkerLookAt ( ActorId id,
carla::geom::Location location )

make agent look at some location

在文件 Navigation.cpp1178 行定义.

引用了 _crowd, _mapped_vehicles_id, _mapped_walkers_id, _mutex, carla::geom::Vector3D::x, carla::geom::Vector3D::y , 以及 carla::geom::Vector3D::z.

◆ SetWalkerMaxSpeed()

bool carla::nav::Navigation::SetWalkerMaxSpeed ( ActorId id,
float max_speed )

set new max speed

在文件 Navigation.cpp735 行定义.

引用了 _crowd, _mapped_walkers_id, _mutex, _ready , 以及 DEBUG_ASSERT.

被这些函数引用 carla::client::detail::WalkerNavigation::SetWalkerMaxSpeed().

+ 这是这个函数的调用关系图:

◆ SetWalkerTarget()

bool carla::nav::Navigation::SetWalkerTarget ( ActorId id,
carla::geom::Location to )

set a new target point to go through a route with events

在文件 Navigation.cpp765 行定义.

引用了 _mapped_walkers_id, _ready, _walker_manager , 以及 carla::nav::WalkerManager::SetWalkerRoute().

被这些函数引用 carla::client::detail::WalkerNavigation::SetWalkerTarget().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ UpdateCrowd()

void carla::nav::Navigation::UpdateCrowd ( const client::detail::EpisodeState & state)

update all walkers in crowd

在文件 Navigation.cpp834 行定义.

引用了 _crowd, _delta_seconds, _mapped_by_index, _mutex, _probability_crossing, _ready, _time_to_unblock, _walker_manager, _walkers_blocked_position, carla::nav::AGENT_UNBLOCK_DISTANCE_SQUARED, carla::nav::AGENT_UNBLOCK_TIME, DEBUG_ASSERT, carla::nav::frand(), GetRandomLocation(), carla::client::detail::EpisodeState::GetTimestamp(), SetAgentFilter(), carla::nav::WalkerManager::SetWalkerRoute(), carla::geom::Vector3D::SquaredLength() , 以及 carla::nav::WalkerManager::Update().

被这些函数引用 carla::client::detail::WalkerNavigation::Tick().

+ 函数调用图:
+ 这是这个函数的调用关系图:

◆ UpdateVehicles()

bool carla::nav::Navigation::UpdateVehicles ( std::vector< VehicleCollisionInfo > vehicles)

add/update/delete vehicles in crowd

在文件 Navigation.cpp709 行定义.

引用了 _mapped_vehicles_id, AddOrUpdateVehicle() , 以及 RemoveAgent().

被这些函数引用 carla::client::detail::WalkerNavigation::UpdateVehiclesInCrowd().

+ 函数调用图:
+ 这是这个函数的调用关系图:

类成员变量说明

◆ _binary_mesh

std::vector<uint8_t> carla::nav::Navigation::_binary_mesh
private

在文件 Navigation.h124 行定义.

被这些函数引用 Load() , 以及 ~Navigation().

◆ _crowd

dtCrowd* carla::nav::Navigation::_crowd { nullptr }
private

◆ _delta_seconds

double carla::nav::Navigation::_delta_seconds { 0.0 }
private

在文件 Navigation.h125 行定义.

被这些函数引用 GetDeltaSeconds(), GetWalkerTransform() , 以及 UpdateCrowd().

◆ _mapped_by_index

std::unordered_map<int, ActorId> carla::nav::Navigation::_mapped_by_index
private

在文件 Navigation.h135 行定义.

被这些函数引用 AddOrUpdateVehicle(), AddWalker(), RemoveAgent(), UpdateCrowd() , 以及 ~Navigation().

◆ _mapped_vehicles_id

std::unordered_map<ActorId, int> carla::nav::Navigation::_mapped_vehicles_id
private

◆ _mapped_walkers_id

std::unordered_map<ActorId, int> carla::nav::Navigation::_mapped_walkers_id
private

◆ _mutex

std::mutex carla::nav::Navigation::_mutex
mutableprivate

◆ _nav_mesh

dtNavMesh* carla::nav::Navigation::_nav_mesh { nullptr }
private

meshes

在文件 Navigation.h127 行定义.

被这些函数引用 CreateCrowd(), GetAgentRoute(), GetPath(), Load() , 以及 ~Navigation().

◆ _nav_query

dtNavMeshQuery* carla::nav::Navigation::_nav_query { nullptr }
private

在文件 Navigation.h128 行定义.

被这些函数引用 GetAgentRoute(), GetPath(), GetRandomLocation(), Load(), SetWalkerDirectTargetIndex() , 以及 ~Navigation().

◆ _probability_crossing

float carla::nav::Navigation::_probability_crossing { 0.0f }
private

在文件 Navigation.h149 行定义.

被这些函数引用 AddWalker(), SetPedestriansCrossFactor() , 以及 UpdateCrowd().

◆ _ready

bool carla::nav::Navigation::_ready { false }
private

◆ _simulator

std::weak_ptr<carla::client::detail::Simulator> carla::nav::Navigation::_simulator
private

在文件 Navigation.h145 行定义.

被这些函数引用 SetSimulator().

◆ _time_to_unblock

double carla::nav::Navigation::_time_to_unblock { 0.0 }
private

在文件 Navigation.h140 行定义.

被这些函数引用 UpdateCrowd() , 以及 ~Navigation().

◆ _walker_manager

WalkerManager carla::nav::Navigation::_walker_manager
private

walker manager for the route planning with events

在文件 Navigation.h143 行定义.

被这些函数引用 AddWalker(), Navigation(), RemoveAgent(), SetSimulator(), SetWalkerTarget() , 以及 UpdateCrowd().

◆ _walkers_blocked_position

std::unordered_map<int, carla::geom::Vector3D> carla::nav::Navigation::_walkers_blocked_position
private

saves the position of each actor at intervals and check if any is blocked

在文件 Navigation.h139 行定义.

被这些函数引用 UpdateCrowd() , 以及 ~Navigation().

◆ _yaw_walkers

std::unordered_map<ActorId, float> carla::nav::Navigation::_yaw_walkers
private

store walkers yaw angle from previous tick

在文件 Navigation.h137 行定义.

被这些函数引用 AddWalker(), GetWalkerTransform() , 以及 ~Navigation().


该类的文档由以下文件生成: