提供与TrafficManagerServer的RPC通信功能。 更多...
#include <TrafficManagerClient.h>
Public 成员函数 | |
ActionBuffer | GetActionBuffer (const ActorId &actor_id) |
获取车辆动作缓冲区的方法 | |
Action | GetNextAction (const ActorId &actor_id) |
获取车辆下一个动作的方法 | |
void | getServerDetails (std::string &_host, uint16_t &_port) |
获取服务器详细信息。 | |
void | HealthCheckRemoteTM () |
检查远程交通管理器(TM)是否存活 | |
TrafficManagerClient & | operator= (const TrafficManagerClient &)=default |
拷贝赋值运算符,默认实现。 | |
TrafficManagerClient & | operator= (TrafficManagerClient &&)=default |
移动赋值运算符,默认实现。 | |
void | RegisterVehicle (const std::vector< carla::rpc::Actor > &actor_list) |
通过RPC客户端向远程交通管理服务器注册车辆。 | |
void | RemoveImportedRoute (const ActorId &actor_id, const bool remove_path) |
移除路线的方法 | |
void | RemoveUploadPath (const ActorId &actor_id, const bool remove_path) |
移除一系列点(路径) | |
void | SetAutoLaneChange (const carla::rpc::Actor &actor, const bool enable) |
启用/禁用车辆的自动换道功能。 | |
void | SetBoundariesRespawnDormantVehicles (const float lower_bound, const float upper_bound) |
设置重生车辆的边界的方法 | |
void | SetCollisionDetection (const carla::rpc::Actor &reference_actor, const carla::rpc::Actor &other_actor, const bool detect_collision) |
设置车辆间的碰撞检测规则。 | |
void | SetCustomPath (const carla::rpc::Actor &actor, const Path path, const bool empty_buffer) |
设置自定义路径 | |
void | SetDesiredSpeed (const carla::rpc::Actor &_actor, const float value) |
设置车辆的精确期望速度。 | |
void | SetDistanceToLeadingVehicle (const carla::rpc::Actor &actor, const float distance) |
设置车辆与前车应保持的距离。 | |
void | SetForceLaneChange (const carla::rpc::Actor &actor, const bool direction) |
强制车辆换道。 | |
void | SetGlobalDistanceToLeadingVehicle (const float distance) |
设置全局领航车辆应保持的距离 | |
void | SetGlobalLaneOffset (const float offset) |
设置全局车道偏移量,相对于中心线。 | |
void | SetGlobalPercentageSpeedDifference (const float percentage) |
设置全局相对于限速的速度百分比差异。 | |
void | SetHybridPhysicsMode (const bool mode_switch) |
设置混合物理模式 | |
void | SetHybridPhysicsRadius (const float radius) |
设置混合物理模式的半径 | |
void | SetImportedRoute (const carla::rpc::Actor &actor, const Route route, const bool empty_buffer) |
设置我们自己的导入路线的方法 | |
void | SetKeepRightPercentage (const carla::rpc::Actor &actor, const float percentage) |
设置车辆保持在右侧车道的百分比 | |
void | SetLaneOffset (const carla::rpc::Actor &_actor, const float offset) |
设置车辆相对于中心线的车道偏移量。 | |
void | SetMaxBoundaries (const float lower, const float upper) |
设置最大边界的方法 | |
void | SetOSMMode (const bool mode_switch) |
设置Open Street Map模式 | |
void | SetPercentageIgnoreVehicles (const carla::rpc::Actor &actor, const float percentage) |
设置车辆忽略其他车辆的碰撞概率。 | |
void | SetPercentageIgnoreWalkers (const carla::rpc::Actor &actor, const float percentage) |
设置车辆忽略行人的碰撞概率。 | |
void | SetPercentageRunningLight (const carla::rpc::Actor &actor, const float percentage) |
设置车辆闯红灯的概率。 | |
void | SetPercentageRunningSign (const carla::rpc::Actor &actor, const float percentage) |
设置车辆无视任何交通标志的概率。 | |
void | SetPercentageSpeedDifference (const carla::rpc::Actor &_actor, const float percentage) |
设置车辆相对于限速的速度百分比差异。 | |
void | SetRandomDeviceSeed (const uint64_t seed) |
设置随机化种子 | |
void | SetRandomLeftLaneChangePercentage (const carla::rpc::Actor &actor, const float percentage) |
设置车辆随机进行左车道变换的百分比 | |
void | SetRandomRightLaneChangePercentage (const carla::rpc::Actor &actor, const float percentage) |
设置车辆随机进行右车道变换的百分比 | |
void | SetRespawnDormantVehicles (const bool mode_switch) |
设置休眠车辆的自动重生模式的方法 | |
void | setServerDetails (const std::string &_host, const uint16_t &_port) |
设置服务器详细信息。 | |
void | SetSynchronousMode (const bool mode) |
将交通管理器切换为同步执行模式。 | |
void | SetSynchronousModeTimeOutInMiliSecond (const double time) |
设置同步执行模式下的超时时间(以毫秒为单位) | |
void | SetUpdateVehicleLights (const carla::rpc::Actor &_actor, const bool do_update) |
设置车辆灯光的自动管理。 | |
void | ShutDown () |
关闭的方法 | |
bool | SynchronousTick () |
提供同步滴答(tick)操作 | |
TrafficManagerClient (const std::string &_host, const uint16_t &_port) | |
参数化构造函数,用于初始化连接参数。 | |
TrafficManagerClient (const TrafficManagerClient &)=default | |
拷贝构造函数,默认实现。 | |
TrafficManagerClient (TrafficManagerClient &&)=default | |
移动构造函数,默认实现。 | |
void | UnregisterVehicle (const std::vector< carla::rpc::Actor > &actor_list) |
通过RPC客户端从远程交通管理服务器注销车辆。 | |
void | UpdateImportedRoute (const ActorId &actor_id, const Route route) |
更新已设置的导入路线的方法 | |
void | UpdateUploadPath (const ActorId &actor_id, const Path path) |
更新已设置的点列表的方法 | |
~TrafficManagerClient () | |
析构函数,用于清理资源 | |
Private 属性 | |
::rpc::client * | _client = nullptr |
RPC客户端 | |
std::string | tmhost |
服务器端口和主机 | |
uint16_t | tmport |
提供与TrafficManagerServer的RPC通信功能。
在文件 TrafficManagerClient.h 第 26 行定义.
|
default |
拷贝构造函数,默认实现。
|
default |
移动构造函数,默认实现。
|
inline |
参数化构造函数,用于初始化连接参数。
_host | 服务器主机名或IP地址。 |
_port | 服务器端口号。 |
创建RPC客户端实例。 如果_client尚未创建,则创建一个新的rpc::client实例,并设置超时时间。
在文件 TrafficManagerClient.h 第 51 行定义.
|
inline |
|
inline |
获取车辆动作缓冲区的方法
断言_client不为nullptr
调用_client的call方法,传入"get_all_actions"指令和actor_id
返回ActionBuffer对象
在文件 TrafficManagerClient.h 第 355 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
获取车辆下一个动作的方法
断言_client不为nullptr
调用_client的call方法,传入"get_next_action"指令和actor_id
返回Action对象
在文件 TrafficManagerClient.h 第 348 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
|
inline |
检查远程交通管理器(TM)是否存活
断言_client指针不为空
调用_client的call方法检查远程交通管理器状态
在文件 TrafficManagerClient.h 第 240 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
default |
拷贝赋值运算符,默认实现。
|
default |
移动赋值运算符,默认实现。
|
inline |
通过RPC客户端向远程交通管理服务器注册车辆。
actor_list | 要注册的车辆列表。 |
在文件 TrafficManagerClient.h 第 93 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
移除路线的方法
断言_client不为nullptr
调用_client的call方法,传入"remove_imported_route"指令、actor_id和remove_path。
在文件 TrafficManagerClient.h 第 318 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
移除一系列点(路径)
断言_client指针不为空
调用_client的call方法移除自定义路径
在文件 TrafficManagerClient.h 第 300 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
启用/禁用车辆的自动换道功能。
actor | 要设置自动换道功能的车辆。 |
enable | 是否启用自动换道。 |
在文件 TrafficManagerClient.h 第 175 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置重生车辆的边界的方法
断言_client不为nullptr
调用_client的call方法,传入"set_boundaries_respawn_dormant_vehicles"指令、lower_bound和upper_bound
在文件 TrafficManagerClient.h 第 336 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆间的碰撞检测规则。
reference_actor | 参考车辆。 |
other_actor | 另一辆参与碰撞检测的车辆。 |
detect_collision | 是否启用碰撞检测。 |
在文件 TrafficManagerClient.h 第 159 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置自定义路径
断言_client指针不为空
调用_client的call方法设置自定义路径
在文件 TrafficManagerClient.h 第 294 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆的精确期望速度。
_actor | 要设置期望速度的车辆。 |
value | 期望速度值。 |
在文件 TrafficManagerClient.h 第 126 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆与前车应保持的距离。
actor | 要设置距离的车辆。 |
distance | 应保持的距离。 |
在文件 TrafficManagerClient.h 第 183 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
强制车辆换道。
actor | 要强制换道的车辆。 |
direction | 换道方向,true表示向左,false表示向右。 |
在文件 TrafficManagerClient.h 第 167 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置全局领航车辆应保持的距离
断言_client指针不为空
调用_client的call方法设置全局领航距离
在文件 TrafficManagerClient.h 第 246 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置全局车道偏移量,相对于中心线。
正值表示向右偏移,负值表示向左偏移。
offset | 车道偏移量。 |
在文件 TrafficManagerClient.h 第 142 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置全局相对于限速的速度百分比差异。
如果小于0,则表示百分比增加。
percentage | 全局速度百分比差异。 |
在文件 TrafficManagerClient.h 第 134 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置混合物理模式
断言_client指针不为空
调用_client的call方法设置混合物理模式
在文件 TrafficManagerClient.h 第 270 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置混合物理模式的半径
断言_client指针不为空
调用_client的call方法设置混合物理模式的半径
在文件 TrafficManagerClient.h 第 276 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置我们自己的导入路线的方法
断言_client不为nullptr
调用_client的call方法,传入"set_imported_route"指令、actor、route和empty_buffer
在文件 TrafficManagerClient.h 第 312 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆保持在右侧车道的百分比
断言_client指针不为空
调用_client的call方法设置保持右侧车道的百分比
在文件 TrafficManagerClient.h 第 252 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆相对于中心线的车道偏移量。
正值表示向右偏移,负值表示向左偏移。
_actor | 要设置车道偏移量的车辆。 |
offset | 车道偏移量。 |
在文件 TrafficManagerClient.h 第 118 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置最大边界的方法
断言_client不为nullptr。
调用_client的call方法,传入"set_max_boundaries"指令、lower和upper
在文件 TrafficManagerClient.h 第 342 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置Open Street Map模式
断言_client指针不为空
调用_client的call方法设置Open Street Map模式
在文件 TrafficManagerClient.h 第 288 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆忽略其他车辆的碰撞概率。
actor | 要设置碰撞概率的车辆。 |
percentage | 忽略其他车辆的碰撞概率(百分比)。 |
在文件 TrafficManagerClient.h 第 199 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆忽略行人的碰撞概率。
actor | 要设置碰撞概率的车辆。 |
percentage | 忽略行人的碰撞概率(百分比)。 |
在文件 TrafficManagerClient.h 第 191 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆闯红灯的概率。
actor | 要设置闯红灯概率的车辆。 |
percentage | 闯红灯的概率(百分比)。 |
在文件 TrafficManagerClient.h 第 207 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆无视任何交通标志的概率。
actor | 要设置无视交通标志概率的车辆。 |
percentage | 无视交通标志的概率(百分比)。 |
在文件 TrafficManagerClient.h 第 215 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆相对于限速的速度百分比差异。
如果小于0,则表示百分比增加。
_actor | 要设置速度差异的车辆。 |
percentage | 速度百分比差异。 |
在文件 TrafficManagerClient.h 第 109 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置随机化种子
断言_client指针不为空
调用_client的call方法设置随机化种子
在文件 TrafficManagerClient.h 第 282 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆随机进行左车道变换的百分比
断言_client指针不为空
调用_client的call方法设置随机左车道变换的百分比
在文件 TrafficManagerClient.h 第 258 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆随机进行右车道变换的百分比
断言_client指针不为空
调用_client的call方法设置随机右车道变换的百分比
在文件 TrafficManagerClient.h 第 264 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置休眠车辆的自动重生模式的方法
断言_client不为nullptr
调用_client的call方法,传入"set_respawn_dormant_vehicles"指令和mode_switch
在文件 TrafficManagerClient.h 第 330 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
|
inline |
将交通管理器切换为同步执行模式。
mode | 是否启用同步模式。 |
在文件 TrafficManagerClient.h 第 222 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置同步执行模式下的超时时间(以毫秒为单位)
断言_client指针不为空。
调用_client的call方法设置超时时间
在文件 TrafficManagerClient.h 第 228 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
设置车辆灯光的自动管理。
_actor | 要设置灯光管理的车辆。 |
do_update | 是否启用灯光自动管理。 |
在文件 TrafficManagerClient.h 第 150 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
关闭的方法
断言_client不为nullptr
调用_client的call方法,传入"shut_down"指令
在文件 TrafficManagerClient.h 第 361 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
提供同步滴答(tick)操作
断言_client指针不为空
调用_client的call方法执行同步滴答,并返回结果
在文件 TrafficManagerClient.h 第 234 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
通过RPC客户端从远程交通管理服务器注销车辆。
actor_list | 要注销的车辆列表。 |
在文件 TrafficManagerClient.h 第 100 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
更新已设置的导入路线的方法
断言_client不为nullptr
调用_client的call方法,传入"update_imported_route"指令、actor_id和route
在文件 TrafficManagerClient.h 第 324 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
inline |
更新已设置的点列表的方法
断言_client不为nullptr
调用_client的call方法,传入"update_custom_path"指令、actor_id和path
在文件 TrafficManagerClient.h 第 306 行定义.
引用了 _client , 以及 DEBUG_ASSERT.
|
private |
RPC客户端
在文件 TrafficManagerClient.h 第 369 行定义.
被这些函数引用 GetActionBuffer(), GetNextAction(), HealthCheckRemoteTM(), RegisterVehicle(), RemoveImportedRoute(), RemoveUploadPath(), SetAutoLaneChange(), SetBoundariesRespawnDormantVehicles(), SetCollisionDetection(), SetCustomPath(), SetDesiredSpeed(), SetDistanceToLeadingVehicle(), SetForceLaneChange(), SetGlobalDistanceToLeadingVehicle(), SetGlobalLaneOffset(), SetGlobalPercentageSpeedDifference(), SetHybridPhysicsMode(), SetHybridPhysicsRadius(), SetImportedRoute(), SetKeepRightPercentage(), SetLaneOffset(), SetMaxBoundaries(), SetOSMMode(), SetPercentageIgnoreVehicles(), SetPercentageIgnoreWalkers(), SetPercentageRunningLight(), SetPercentageRunningSign(), SetPercentageSpeedDifference(), SetRandomDeviceSeed(), SetRandomLeftLaneChangePercentage(), SetRandomRightLaneChangePercentage(), SetRespawnDormantVehicles(), SetSynchronousMode(), SetSynchronousModeTimeOutInMiliSecond(), SetUpdateVehicleLights(), ShutDown(), SynchronousTick(), TrafficManagerClient(), UnregisterVehicle(), UpdateImportedRoute(), UpdateUploadPath() , 以及 ~TrafficManagerClient().
|
private |
服务器端口和主机
在文件 TrafficManagerClient.h 第 372 行定义.
被这些函数引用 getServerDetails(), setServerDetails() , 以及 TrafficManagerClient().
|
private |
在文件 TrafficManagerClient.h 第 373 行定义.
被这些函数引用 getServerDetails(), setServerDetails() , 以及 TrafficManagerClient().