31 const std::string &host,
33 size_t worker_threads = 0u);
83 std::vector<std::string>
GetRequiredFiles(
const std::string &folder =
"",
const bool download =
true)
const {
84 return _simulator->GetRequiredFiles(folder, download);
97 bool reset_settings =
true,
99 return World{
_simulator->LoadEpisode(std::move(map_name), reset_settings, map_layers)};
105 std::string map_name,
106 bool reset_settings =
true,
108 const std::string current_map_name =
GetWorld().
GetMap()->GetName();
109 if (current_map_name == map_name || current_map_name ==
"Carla/Maps/" + map_name) {
112 return World{
_simulator->LoadEpisode(std::move(map_name), reset_settings, map_layers)};
116 std::string opendrive,
118 bool reset_settings =
true)
const {
120 std::move(opendrive), params, reset_settings)};
138 std::string
StartRecorder(std::string name,
bool additional_data =
false,
bool stop_replayer =
true) {
139 return _simulator->StartRecorder(name, additional_data, stop_replayer);
147 return _simulator->ShowRecorderFileInfo(name, show_all);
151 return _simulator->ShowRecorderCollisions(name, type1, type2);
155 return _simulator->ShowRecorderActorsBlocked(name, min_time, min_distance);
159 std::string name,
double start,
double duration,
160 uint32_t follow_id,
bool replay_sensors,
161 bool replay_weather =
false,
163 std::string map_override =
"") {
165 std::move(name), start, duration, follow_id, replay_sensors,
166 replay_weather, offset, std::move(map_override));
174 _simulator->SetReplayerTimeFactor(time_factor);
178 _simulator->SetReplayerIgnoreHero(ignore_hero);
182 _simulator->SetReplayerIgnoreSpectator(ignore_spectator);
186 std::vector<rpc::Command> commands,
187 bool do_tick_cue =
false)
const {
188 _simulator->ApplyBatch(std::move(commands), do_tick_cue);
192 std::vector<rpc::Command> commands,
193 bool do_tick_cue =
false)
const {
194 auto responses =
_simulator->ApplyBatchSync(std::move(commands),
false);
207 const std::string &host,
209 size_t worker_threads)
211 std::make_shared<detail::Simulator>(host, port, worker_threads)) {}
void RequestFile(const std::string &name) const
std::string GetServerVersion() const
Return the version string of the simulator we are connected to.
World LoadWorldIfDifferent(std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) const
Return the current world, loading map_name first unless it is already the map in use.
World LoadWorld(std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) const
time_duration GetTimeout()
std::string ShowRecorderActorsBlocked(std::string name, double min_time, double min_distance)
std::string ReplayFile(std::string name, double start, double duration, uint32_t follow_id, bool replay_sensors, bool replay_weather=false, const geom::Transform &offset=geom::Transform(), std::string map_override="")
bool SetFilesBaseFolder(const std::string &path)
carla::client::detail::EpisodeProxy GetCurrentEpisode() const
Return an instance of the Episode currently active in the simulator.
Client(const std::string &host, uint16_t port, size_t worker_threads=0u)
Construct a carla client.
void SetReplayerIgnoreSpectator(bool ignore_spectator)
World GetWorld() const
Return an instance of the world currently active in the simulator.
std::shared_ptr< detail::Simulator > _simulator
std::vector< std::string > GetAvailableMaps() const
void SetReplayerTimeFactor(double time_factor)
std::vector< rpc::ContentPackInfo > GetContentPacks() const
Content packs known to the server (discovered at startup or mounted through MountContentPack),...
bool UnmountContentPack(const std::string &name) const
Unmount a content pack by name.
World GenerateOpenDriveWorld(std::string opendrive, const rpc::OpendriveGenerationParameters ¶ms, bool reset_settings=true) const
World ReloadWorld(bool reset_settings=true) const
void ApplyBatch(std::vector< rpc::Command > commands, bool do_tick_cue=false) const
rpc::ContentPackInfo MountContentPack(const std::string &path) const
Mount a content pack from a directory on the server host (the pack directory or its carla-pack....
void SetReplayerIgnoreHero(bool ignore_hero)
std::string StartRecorder(std::string name, bool additional_data=false, bool stop_replayer=true)
void StopReplayer(bool keep_actors)
std::vector< std::string > GetRequiredFiles(const std::string &folder="", const bool download=true) const
std::string GetClientVersion() const
Return the version string of this client API.
void SetTimeout(time_duration timeout)
Set a timeout for networking operations.
std::string ShowRecorderCollisions(std::string name, char type1, char type2)
std::string ShowRecorderFileInfo(std::string name, bool show_all)
TrafficManager GetInstanceTM(uint16_t port=TM_DEFAULT_PORT) const
Return an instance of the TrafficManager currently active in the simulator.
std::vector< rpc::CommandResponse > ApplyBatchSync(std::vector< rpc::Command > commands, bool do_tick_cue=false) const
SharedPtr< Map > GetMap() const
Return the map that describes this world.
Description of a CARLA content pack known to the server (see UCarlaContentPackManager).
Positive time duration up to milliseconds resolution.
This class integrates all the various stages of the traffic manager appropriately using messengers.
This file contains definitions of common data structures used in traffic manager.
Seting for map generation from opendrive without additional geometry.