27 class WalkerNavigation;
34 :
public std::enable_shared_from_this<Episode>,
48 std::shared_ptr<const EpisodeState>
GetState()
const {
这个类类似于共享未来(shared future)的使用方式,但是它的值可以被设置任意次数的值。 未来设计模式的核心思想是异步调用。 Future接口象征着异步执行任务的结果即执行一个耗时任务完全可以另...
保留参与者描述列表,以避免每次都向服务器请求描述。
void Insert(rpc::Actor actor)
将参与者插入到列表中。
提供与 CARLA 模拟器的 rpc 和流媒体服务器的通信。
void RemoveOnTickEvent(size_t id)
RecurrentSharedFuture< WorldSnapshot > _snapshot
size_t RegisterLightUpdateChangeEvent(std::function< void(WorldSnapshot)> callback)
AtomicSharedPtr< const EpisodeState > _state
std::weak_ptr< Simulator > _simulator
CallbackList< WorldSnapshot > _on_tick_callbacks
boost::optional< rpc::Actor > GetParticipantById(ActorId id)
void AddPendingException(std::string e)
void RegisterParticipant(rpc::Actor actor)
size_t RegisterOnTickEvent(std::function< void(WorldSnapshot)> callback)
std::shared_ptr< WalkerNavigation > CreateNavigationIfMissing()
boost::optional< WorldSnapshot > WaitForState(time_duration timeout)
std::string _pending_exceptions_msg
size_t RegisterOnMapChangeEvent(std::function< void(WorldSnapshot)> callback)
std::shared_ptr< const EpisodeState > GetState() const
const streaming::Token _token
AtomicSharedPtr< WalkerNavigation > _walker_navigation
void RemoveLightUpdateChangeEvent(size_t id)
std::vector< rpc::Actor > GetParticipantsById(const std::vector< ActorId > &actor_ids)
std::vector< rpc::Actor > GetParticipants()
void SetPedestriansSeed(unsigned int seed)
void RemoveOnMapChangeEvent(size_t id)
bool HasMapChangedSinceLastCall()
void SetPedestriansCrossFactor(float percentage)
CallbackList< WorldSnapshot > _on_light_update_callbacks
CallbackList< WorldSnapshot > _on_map_change_callbacks
Episode(Client &client, std::weak_ptr< Simulator > simulator)
Positive time duration up to milliseconds resolution.
carla::ActorId ActorId
参与者的智能指针类型