32 #include <boost/optional.hpp> 40 class BlueprintLibrary;
114 Actor *parent =
nullptr,
122 Actor *parent =
nullptr,
172 std::vector<geom::BoundingBox>
GetLevelBBs(uint8_t queried_tag)
const;
177 std::vector<uint64_t> env_objects_ids,
186 std::vector<rpc::LabelledPoint>
CastRay(
190 const Waypoint& waypoint,
double distance)
const;
198 const std::string &actor_name,
203 const std::vector<std::string> &objects_names,
208 const std::string &actor_name,
213 const std::vector<std::string> &objects_names,
218 const std::string &actor_name,
225 const std::vector<std::string> &objects_names,
std::vector< std::string > GetNamesOfAllObjects() const
SharedPtr< BlueprintLibrary > GetBlueprintLibrary() const
Return the list of blueprints available in this world.
std::vector< SharedPtr< Actor > > GetTrafficLightsInJunction(const road::JuncId junc_id) const
void RemoveOnTick(size_t callback_id)
Remove a callback registered with OnTick.
World & operator=(const World &)=default
void SetWeather(const rpc::WeatherParameters &weather)
Change the weather in the simulation.
SharedPtr< ActorList > GetActors() const
Return a list with all the actors currently present in the world.
void SetPedestriansCrossFactor(float percentage)
set the probability that an agent could cross the roads in its path following percentage of 0...
World(detail::EpisodeProxy episode)
size_t OnTick(std::function< void(WorldSnapshot)> callback)
Register a callback to be called every time a world tick is received.
boost::optional< rpc::LabelledPoint > ProjectPoint(geom::Location location, geom::Vector3D direction, float search_distance=10000.f) const
void UnloadLevelLayer(rpc::MapLayer map_layers) const
SharedPtr< Actor > GetSpectator() const
Return the spectator actor.
SharedPtr< LightManager > GetLightManager() const
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
std::vector< std::pair< ActorId, VehicleLightState::flag_type > > VehicleLightStateList
std::vector< rpc::LabelledPoint > CastRay(geom::Location start_location, geom::Location end_location) const
This file contains definitions of common data structures used in traffic manager. ...
SharedPtr< Map > GetMap() const
Return the map that describes this world.
void ApplyColorTextureToObject(const std::string &actor_name, const rpc::MaterialParameter ¶meter, const rpc::TextureColor &Texture)
Class containing a reference to RoadInfoSignal.
uint64_t Tick(time_duration timeout)
Signal the simulator to continue to next tick (only has effect on synchronous mode).
rpc::VehicleLightStateList GetVehiclesLightStates() const
Returns a list of pairs where the firts element is the vehicle ID and the second one is the light sta...
detail::EpisodeProxy _episode
uint64_t GetId() const
Get the id of the episode associated with this world.
SharedPtr< Actor > GetTrafficLightFromOpenDRIVE(const road::SignId &sign_id) const
void ApplyColorTextureToObjects(const std::vector< std::string > &objects_names, const rpc::MaterialParameter ¶meter, const rpc::TextureColor &Texture)
carla::SharedPtr< cc::Actor > Actor
SharedPtr< Actor > GetTrafficSign(const Landmark &landmark) const
auto GetId() const noexcept
void ResetAllTrafficLights()
void LoadLevelLayer(rpc::MapLayer map_layers) const
SharedPtr< Actor > GetActor(ActorId id) const
Find actor by id, return nullptr if not found.
void SetPedestriansSeed(unsigned int seed)
set the seed to use with random numbers in the pedestrians module
void ApplyFloatColorTextureToObject(const std::string &actor_name, const rpc::MaterialParameter ¶meter, const rpc::TextureFloatColor &Texture)
boost::optional< rpc::LabelledPoint > GroundProjection(geom::Location location, float search_distance=10000.0) const
rpc::WeatherParameters GetWeather() const
Retrieve the weather parameters currently active in the world.
void FreezeAllTrafficLights(bool frozen)
detail::EpisodeProxy GetEpisode() const
void EnableEnvironmentObjects(std::vector< uint64_t > env_objects_ids, bool enable) const
std::vector< SharedPtr< Actor > > GetTrafficLightsFromWaypoint(const Waypoint &waypoint, double distance) const
Represents an actor in the simulation.
uint64_t ApplySettings(const rpc::EpisodeSettings &settings, time_duration timeout)
std::vector< geom::BoundingBox > GetLevelBBs(uint8_t queried_tag) const
Returns all the BBs of all the elements of the level.
Positive time duration up to milliseconds resolution.
Contains all the necessary information for spawning an Actor.
SharedPtr< Actor > TrySpawnActor(const ActorBlueprint &blueprint, const geom::Transform &transform, Actor *parent=nullptr, rpc::AttachmentType attachment_type=rpc::AttachmentType::Rigid) noexcept
Same as SpawnActor but return nullptr on failure instead of throwing an exception.
rpc::EpisodeSettings GetSettings() const
carla::SharedPtr< cc::ActorList > ActorList
SharedPtr< Actor > SpawnActor(const ActorBlueprint &blueprint, const geom::Transform &transform, Actor *parent=nullptr, rpc::AttachmentType attachment_type=rpc::AttachmentType::Rigid)
Spawn an actor into the world based on the blueprint provided at transform.
void ApplyFloatColorTextureToObjects(const std::vector< std::string > &objects_names, const rpc::MaterialParameter ¶meter, const rpc::TextureFloatColor &Texture)
WorldSnapshot GetSnapshot() const
Return a snapshot of the world at this moment.
std::vector< rpc::EnvironmentObject > GetEnvironmentObjects(uint8_t queried_tag) const
boost::optional< geom::Location > GetRandomLocationFromNavigation() const
Get a random location from the pedestrians navigation mesh.
SharedPtr< Actor > GetTrafficLight(const Landmark &landmark) const
DebugHelper MakeDebugHelper() const
void ApplyTexturesToObject(const std::string &actor_name, const rpc::TextureColor &diffuse_texture, const rpc::TextureFloatColor &emissive_texture, const rpc::TextureFloatColor &normal_texture, const rpc::TextureFloatColor &ao_roughness_metallic_emissive_texture)
WorldSnapshot WaitForTick(time_duration timeout) const
Block calling thread until a world tick is received.
void ApplyTexturesToObjects(const std::vector< std::string > &objects_names, const rpc::TextureColor &diffuse_texture, const rpc::TextureFloatColor &emissive_texture, const rpc::TextureFloatColor &normal_texture, const rpc::TextureFloatColor &ao_roughness_metallic_emissive_texture)