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

#include <Client.h>

+ carla::client::Client 的协作图:

Public 成员函数

void ApplyBatch (std::vector< rpc::Command > commands, bool do_tick_cue=false) const
 
std::vector< rpc::CommandResponseApplyBatchSync (std::vector< rpc::Command > commands, bool do_tick_cue=false) const
 
 Client (const std::string &host, uint16_t port, size_t worker_threads=0u)
 构建一个 carla 客户端。
 
World GenerateOpenDriveWorld (std::string opendrive, const rpc::OpendriveGenerationParameters &params, bool reset_settings=true) const
 通过 OpenDrive 文件生成一个新的世界。
 
std::vector< std::string > GetAvailableMaps () const
 获取当前服务中心提供的所有可用地图名称。
 
std::string GetClientVersion () const
 返回此客户端 API 版本的字符串。
 
carla::client::detail::EpisodeProxy GetCurrentEpisode () const
 获取当前模拟器中的活动场景实例。
 
TrafficManager GetInstanceTM (uint16_t port=TM_DEFAULT_PORT) const
 获取当前模拟器中的 TrafficManager 实例。
 
std::vector< std::string > GetRequiredFiles (const std::string &folder="", const bool download=true) const
 获取指定文件夹中的所需文件列表,默认情况下会下载所需文件。 如果文件夹路径为空,则使用默认路径。
 
std::string GetServerVersion () const
 获取当前连接的模拟器版本字符串。
 
time_duration GetTimeout ()
 
World GetWorld () const
 获取当前模拟器中的活跃世界实例。
 
World LoadWorld (std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) const
 加载指定名称的场景地图。
 
void LoadWorldIfDifferent (std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) const
 如果当前地图与请求地图不同,则加载新地图。
 
World ReloadWorld (bool reset_settings=true) const
 重新加载世界环境。 通过调用 _simulator->ReloadEpisode 来实现,是否重置设置由参数决定。 返回重载后的世界对象。
 
std::string ReplayFile (std::string name, double start, double duration, uint32_t follow_id, bool replay_sensors)
 
void RequestFile (const std::string &name) const
 请求指定名称的文件,模拟器会处理文件的加载或下载。
 
bool SetFilesBaseFolder (const std::string &path)
 设置文件系统的基路径(文件夹)。 用于设置模拟器读取文件的路径。 返回操作是否成功。
 
void SetReplayerIgnoreHero (bool ignore_hero)
 
void SetReplayerIgnoreSpectator (bool ignore_spectator)
 
void SetReplayerTimeFactor (double time_factor)
 
void SetTimeout (time_duration timeout)
 设置网络操作的超时时间。超时将抛出 rpc::timeout 异常
 
std::string ShowRecorderActorsBlocked (std::string name, double min_time, double min_distance)
 
std::string ShowRecorderCollisions (std::string name, char type1, char type2)
 
std::string ShowRecorderFileInfo (std::string name, bool show_all)
 
std::string StartRecorder (std::string name, bool additional_data=false)
 
void StopRecorder (void)
 
void StopReplayer (bool keep_actors)
 

Private 属性

std::shared_ptr< detail::Simulator_simulator
 

详细描述

在文件 client/Client.h22 行定义.

构造及析构函数说明

◆ Client()

carla::client::Client::Client ( const std::string & host,
uint16_t port,
size_t worker_threads = 0u )
inlineexplicit

构建一个 carla 客户端。

参数
host运行模拟器的主机IP地址。
port连接到模拟器的TCP端口。
worker_threads要使用的异步线程数,默认为 0(即使用所有可用的硬件并发线程)。

在文件 client/Client.h225 行定义.

成员函数说明

◆ ApplyBatch()

void carla::client::Client::ApplyBatch ( std::vector< rpc::Command > commands,
bool do_tick_cue = false ) const
inline

在文件 client/Client.h200 行定义.

引用了 _simulator.

◆ ApplyBatchSync()

std::vector< rpc::CommandResponse > carla::client::Client::ApplyBatchSync ( std::vector< rpc::Command > commands,
bool do_tick_cue = false ) const
inline

在文件 client/Client.h208 行定义.

引用了 _simulator.

◆ GenerateOpenDriveWorld()

World carla::client::Client::GenerateOpenDriveWorld ( std::string opendrive,
const rpc::OpendriveGenerationParameters & params,
bool reset_settings = true ) const
inline

通过 OpenDrive 文件生成一个新的世界。

参数
opendriveOpenDrive 格式的文件路径。
params生成 OpenDrive 世界时的参数。
reset_settings是否重置设置。

在文件 client/Client.h114 行定义.

引用了 _simulator.

◆ GetAvailableMaps()

std::vector< std::string > carla::client::Client::GetAvailableMaps ( ) const
inline

获取当前服务中心提供的所有可用地图名称。

在文件 client/Client.h56 行定义.

引用了 _simulator.

◆ GetClientVersion()

std::string carla::client::Client::GetClientVersion ( ) const
inline

返回此客户端 API 版本的字符串。

在文件 client/Client.h46 行定义.

引用了 _simulator.

◆ GetCurrentEpisode()

carla::client::detail::EpisodeProxy carla::client::Client::GetCurrentEpisode ( ) const
inline

获取当前模拟器中的活动场景实例。

在文件 client/Client.h134 行定义.

引用了 _simulator.

◆ GetInstanceTM()

TrafficManager carla::client::Client::GetInstanceTM ( uint16_t port = TM_DEFAULT_PORT) const
inline

获取当前模拟器中的 TrafficManager 实例。

参数
portTrafficManager 使用的端口,默认为 TM_DEFAULT_PORT。

在文件 client/Client.h129 行定义.

引用了 _simulator.

◆ GetRequiredFiles()

std::vector< std::string > carla::client::Client::GetRequiredFiles ( const std::string & folder = "",
const bool download = true ) const
inline

获取指定文件夹中的所需文件列表,默认情况下会下载所需文件。 如果文件夹路径为空,则使用默认路径。

在文件 client/Client.h67 行定义.

引用了 _simulator.

◆ GetServerVersion()

std::string carla::client::Client::GetServerVersion ( ) const
inline

获取当前连接的模拟器版本字符串。

在文件 client/Client.h51 行定义.

引用了 _simulator.

◆ GetTimeout()

time_duration carla::client::Client::GetTimeout ( )
inline

在文件 client/Client.h41 行定义.

引用了 _simulator.

◆ GetWorld()

World carla::client::Client::GetWorld ( ) const
inline

获取当前模拟器中的活跃世界实例。

在文件 client/Client.h123 行定义.

引用了 _simulator.

被这些函数引用 LoadWorldIfDifferent().

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

◆ LoadWorld()

World carla::client::Client::LoadWorld ( std::string map_name,
bool reset_settings = true,
rpc::MapLayer map_layers = rpc::MapLayer::All ) const
inline

加载指定名称的场景地图。

参数
map_name地图名称。
reset_settings是否重置设置。
map_layers需要加载的地图层。

在文件 client/Client.h85 行定义.

引用了 _simulator.

◆ LoadWorldIfDifferent()

void carla::client::Client::LoadWorldIfDifferent ( std::string map_name,
bool reset_settings = true,
rpc::MapLayer map_layers = rpc::MapLayer::All ) const
inline

如果当前地图与请求地图不同,则加载新地图。

在文件 client/Client.h94 行定义.

引用了 _simulator, carla::client::World::GetMap() , 以及 GetWorld().

+ 函数调用图:

◆ ReloadWorld()

World carla::client::Client::ReloadWorld ( bool reset_settings = true) const
inline

重新加载世界环境。 通过调用 _simulator->ReloadEpisode 来实现,是否重置设置由参数决定。 返回重载后的世界对象。

在文件 client/Client.h77 行定义.

引用了 _simulator.

◆ ReplayFile()

std::string carla::client::Client::ReplayFile ( std::string name,
double start,
double duration,
uint32_t follow_id,
bool replay_sensors )
inline

在文件 client/Client.h173 行定义.

引用了 _simulator.

◆ RequestFile()

void carla::client::Client::RequestFile ( const std::string & name) const
inline

请求指定名称的文件,模拟器会处理文件的加载或下载。

在文件 client/Client.h71 行定义.

引用了 _simulator.

◆ SetFilesBaseFolder()

bool carla::client::Client::SetFilesBaseFolder ( const std::string & path)
inline

设置文件系统的基路径(文件夹)。 用于设置模拟器读取文件的路径。 返回操作是否成功。

在文件 client/Client.h62 行定义.

引用了 _simulator.

◆ SetReplayerIgnoreHero()

void carla::client::Client::SetReplayerIgnoreHero ( bool ignore_hero)
inline

在文件 client/Client.h190 行定义.

引用了 _simulator.

◆ SetReplayerIgnoreSpectator()

void carla::client::Client::SetReplayerIgnoreSpectator ( bool ignore_spectator)
inline

在文件 client/Client.h195 行定义.

引用了 _simulator.

◆ SetReplayerTimeFactor()

void carla::client::Client::SetReplayerTimeFactor ( double time_factor)
inline

在文件 client/Client.h185 行定义.

引用了 _simulator.

◆ SetTimeout()

void carla::client::Client::SetTimeout ( time_duration timeout)
inline

设置网络操作的超时时间。超时将抛出 rpc::timeout 异常

在文件 client/Client.h36 行定义.

引用了 _simulator.

◆ ShowRecorderActorsBlocked()

std::string carla::client::Client::ShowRecorderActorsBlocked ( std::string name,
double min_time,
double min_distance )
inline

在文件 client/Client.h168 行定义.

引用了 _simulator.

◆ ShowRecorderCollisions()

std::string carla::client::Client::ShowRecorderCollisions ( std::string name,
char type1,
char type2 )
inline

在文件 client/Client.h162 行定义.

引用了 _simulator.

◆ ShowRecorderFileInfo()

std::string carla::client::Client::ShowRecorderFileInfo ( std::string name,
bool show_all )
inline
参数
name文件名。
show_all是否显示所有记录信息。

在文件 client/Client.h151 行定义.

引用了 _simulator.

◆ StartRecorder()

std::string carla::client::Client::StartRecorder ( std::string name,
bool additional_data = false )
inline

在文件 client/Client.h139 行定义.

引用了 _simulator.

◆ StopRecorder()

void carla::client::Client::StopRecorder ( void )
inline

在文件 client/Client.h144 行定义.

引用了 _simulator.

◆ StopReplayer()

void carla::client::Client::StopReplayer ( bool keep_actors)
inline

在文件 client/Client.h179 行定义.

引用了 _simulator.

类成员变量说明

◆ _simulator

std::shared_ptr<detail::Simulator> carla::client::Client::_simulator
private

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