|
CARLA
|
Holds the current episode, and the current episode state. More...
#include <Episode.h>
Inheritance diagram for carla::client::detail::Episode:Public Member Functions | |
| void | AddPendingException (std::string e) |
| std::shared_ptr< WalkerNavigation > | CreateNavigationIfMissing () |
| Episode (Client &client, std::weak_ptr< Simulator > simulator) | |
| std::optional< rpc::Actor > | GetActorById (ActorId id) |
| std::vector< rpc::Actor > | GetActors () |
| std::vector< rpc::Actor > | GetActorsById (const std::vector< ActorId > &actor_ids) |
| auto | GetId () const |
| std::shared_ptr< const EpisodeState > | GetState () const |
| bool | HasMapChangedSinceLastCall () |
| bool | IsEpisodeChangeHandled () const |
| Whether OnEpisodeChanged has finished for the episode GetId() returns. | |
| void | Listen () |
| void | RegisterActor (rpc::Actor actor) |
| size_t | RegisterLightUpdateChangeEvent (std::function< void(WorldSnapshot)> callback) |
| size_t | RegisterOnMapChangeEvent (std::function< void(WorldSnapshot)> callback) |
| size_t | RegisterOnTickEvent (std::function< void(WorldSnapshot)> callback) |
| void | RemoveLightUpdateChangeEvent (size_t id) |
| void | RemoveOnMapChangeEvent (size_t id) |
| void | RemoveOnTickEvent (size_t id) |
| void | SetPedestriansCrossFactor (float percentage) |
| void | SetPedestriansSeed (unsigned int seed) |
| std::optional< WorldSnapshot > | WaitForState (time_duration timeout) |
| ~Episode () | |
Private Member Functions | |
| Episode (Client &client, const rpc::EpisodeInfo &info, std::weak_ptr< Simulator > simulator) | |
| void | OnEpisodeChanged (uint64_t episode_id) |
| void | OnEpisodeStarted () |
Private Member Functions inherited from carla::NonCopyable | |
| NonCopyable ()=default | |
| NonCopyable (const NonCopyable &)=delete | |
| NonCopyable (NonCopyable &&)=delete | |
| NonCopyable & | operator= (const NonCopyable &)=delete |
| NonCopyable & | operator= (NonCopyable &&)=delete |
Private Attributes | |
| CachedActorList | _actors |
| Client & | _client |
| std::atomic< uint64_t > | _handled_episode_id |
| CallbackList< WorldSnapshot > | _on_light_update_callbacks |
| CallbackList< WorldSnapshot > | _on_map_change_callbacks |
| CallbackList< WorldSnapshot > | _on_tick_callbacks |
| bool | _pending_exceptions = false |
| std::string | _pending_exceptions_msg |
| bool | _should_update_map = true |
| std::weak_ptr< Simulator > | _simulator |
| RecurrentSharedFuture< WorldSnapshot > | _snapshot |
| AtomicSharedPtr< const EpisodeState > | _state |
| std::thread | _tm_reset_thread |
| const streaming::Token | _token |
| AtomicSharedPtr< WalkerNavigation > | _walker_navigation |
Holds the current episode, and the current episode state.
The episode state changes in the background each time a world tick is received. The episode may change with any background update if the simulator has loaded a new episode.
|
explicit |
Definition at line 39 of file Episode.cpp.
| carla::client::detail::Episode::~Episode | ( | ) |
Definition at line 49 of file Episode.cpp.
References _client, _tm_reset_thread, _token, carla::log_error(), and carla::client::detail::Client::UnSubscribeFromStream().
|
private |
Definition at line 42 of file Episode.cpp.
|
inline |
Definition at line 102 of file Episode.h.
References _pending_exceptions, and _pending_exceptions_msg.
| std::shared_ptr< WalkerNavigation > carla::client::detail::Episode::CreateNavigationIfMissing | ( | ) |
Definition at line 190 of file Episode.cpp.
References _client, _simulator, _walker_navigation, and carla::client::detail::Client::IsNavigationServerSide().
| std::optional< rpc::Actor > carla::client::detail::Episode::GetActorById | ( | ActorId | id | ) |
Definition at line 140 of file Episode.cpp.
References _actors, _client, carla::client::detail::CachedActorList::GetActorById(), carla::client::detail::Client::GetActorsById(), and carla::client::detail::CachedActorList::Insert().
| std::vector< rpc::Actor > carla::client::detail::Episode::GetActors | ( | ) |
Definition at line 156 of file Episode.cpp.
References _actors, _client, carla::client::detail::GetActorsById_Impl(), and GetState().
| std::vector< rpc::Actor > carla::client::detail::Episode::GetActorsById | ( | const std::vector< ActorId > & | actor_ids | ) |
Definition at line 152 of file Episode.cpp.
References _actors, _client, and carla::client::detail::GetActorsById_Impl().
|
inline |
Definition at line 47 of file Episode.h.
References GetState().
Referenced by IsEpisodeChangeHandled().
|
inline |
Definition at line 56 of file Episode.h.
References _state.
Referenced by GetActors(), GetId(), and carla::client::detail::SynchronizeFrame().
| bool carla::client::detail::Episode::HasMapChangedSinceLastCall | ( | ) |
Definition at line 182 of file Episode.cpp.
References _should_update_map.
|
inline |
Whether OnEpisodeChanged has finished for the episode GetId() returns.
Definition at line 52 of file Episode.h.
References _handled_episode_id, and GetId().
| void carla::client::detail::Episode::Listen | ( | ) |
Check for pending exceptions (Mainly TM server closed)
Mark pending exception false
Create exception for the error message
Sensor case: inconsistent data
Episode change
Definition at line 60 of file Episode.cpp.
References _client, _token, carla::client::detail::CastData(), carla::sensor::Deserializer::Deserialize(), carla::log_error(), and carla::client::detail::Client::SubscribeToStream().
|
private |
Definition at line 167 of file Episode.cpp.
References _handled_episode_id, _tm_reset_thread, carla::log_error(), and carla::traffic_manager::TrafficManager::Reset().
|
private |
Definition at line 160 of file Episode.cpp.
References _actors, _on_tick_callbacks, _walker_navigation, carla::client::detail::CachedActorList::Clear(), and carla::traffic_manager::TrafficManager::Release().
|
inline |
Definition at line 60 of file Episode.h.
References _actors, and carla::client::detail::CachedActorList::Insert().
|
inline |
Definition at line 90 of file Episode.h.
References _on_light_update_callbacks.
|
inline |
Definition at line 82 of file Episode.h.
References _on_map_change_callbacks.
|
inline |
Definition at line 74 of file Episode.h.
References _on_tick_callbacks.
|
inline |
Definition at line 94 of file Episode.h.
References _on_light_update_callbacks.
|
inline |
Definition at line 86 of file Episode.h.
References _on_map_change_callbacks.
|
inline |
Definition at line 78 of file Episode.h.
References _on_tick_callbacks.
| void carla::client::detail::Episode::SetPedestriansCrossFactor | ( | float | percentage | ) |
| void carla::client::detail::Episode::SetPedestriansSeed | ( | unsigned int | seed | ) |
|
inline |
|
private |
Definition at line 125 of file Episode.h.
Referenced by GetActorById(), GetActors(), GetActorsById(), OnEpisodeStarted(), and RegisterActor().
|
private |
Definition at line 119 of file Episode.h.
Referenced by CreateNavigationIfMissing(), GetActorById(), GetActors(), GetActorsById(), Listen(), and ~Episode().
|
private |
Definition at line 145 of file Episode.h.
Referenced by IsEpisodeChangeHandled(), and OnEpisodeChanged().
|
private |
Definition at line 131 of file Episode.h.
Referenced by RegisterLightUpdateChangeEvent(), and RemoveLightUpdateChangeEvent().
|
private |
Definition at line 129 of file Episode.h.
Referenced by RegisterOnMapChangeEvent(), and RemoveOnMapChangeEvent().
|
private |
Definition at line 127 of file Episode.h.
Referenced by OnEpisodeStarted(), RegisterOnTickEvent(), and RemoveOnTickEvent().
|
private |
Definition at line 139 of file Episode.h.
Referenced by AddPendingException().
|
private |
Definition at line 123 of file Episode.h.
Referenced by AddPendingException().
|
private |
Definition at line 141 of file Episode.h.
Referenced by HasMapChangedSinceLastCall().
|
private |
Definition at line 143 of file Episode.h.
Referenced by CreateNavigationIfMissing().
|
private |
Definition at line 133 of file Episode.h.
Referenced by WaitForState().
|
private |
Definition at line 121 of file Episode.h.
Referenced by GetState().
|
private |
Definition at line 147 of file Episode.h.
Referenced by OnEpisodeChanged(), and ~Episode().
|
private |
Definition at line 137 of file Episode.h.
Referenced by Listen(), and ~Episode().
|
private |
Definition at line 135 of file Episode.h.
Referenced by CreateNavigationIfMissing(), and OnEpisodeStarted().