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