30 const std::string &host,
32 size_t worker_threads = 0u);
62 std::vector<std::string>
GetRequiredFiles(
const std::string &folder =
"",
const bool download =
true)
const {
63 return _simulator->GetRequiredFiles(folder, download);
76 bool reset_settings =
true,
78 return World{
_simulator->LoadEpisode(std::move(map_name), reset_settings, map_layers)};
85 bool reset_settings =
true,
89 std::string current_map_name = current_map->GetName();
90 std::string map_name_prefix =
"Carla/Maps/";
91 std::string map_name_without_prefix = map_name;
92 std::string map_name_with_prefix = map_name_prefix + map_name;
93 if(!(map_name_without_prefix == current_map_name) && !(map_name_with_prefix == current_map_name)){
99 std::string opendrive,
101 bool reset_settings =
true)
const {
103 std::move(opendrive), params, reset_settings)};
122 return _simulator->StartRecorder(name, additional_data);
130 return _simulator->ShowRecorderFileInfo(name, show_all);
134 return _simulator->ShowRecorderCollisions(name, type1, type2);
138 return _simulator->ShowRecorderActorsBlocked(name, min_time, min_distance);
141 std::string
ReplayFile(std::string name,
double start,
double duration,
142 uint32_t follow_id,
bool replay_sensors) {
143 return _simulator->ReplayFile(name, start, duration, follow_id, replay_sensors);
151 _simulator->SetReplayerTimeFactor(time_factor);
155 _simulator->SetReplayerIgnoreHero(ignore_hero);
159 _simulator->SetReplayerIgnoreSpectator(ignore_spectator);
163 std::vector<rpc::Command> commands,
164 bool do_tick_cue =
false)
const {
165 _simulator->ApplyBatch(std::move(commands), do_tick_cue);
169 std::vector<rpc::Command> commands,
170 bool do_tick_cue =
false)
const {
171 auto responses =
_simulator->ApplyBatchSync(std::move(commands),
false);
184 const std::string &host,
186 size_t worker_threads)
188 new 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 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)
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 LoadWorldIfDifferent(std::string map_name, bool reset_settings=true, rpc::MapLayer map_layers=rpc::MapLayer::All) const
Return (and load) a new world (map) only when the requested map is different from the current one
void SetReplayerTimeFactor(double time_factor)
std::string ReplayFile(std::string name, double start, double duration, uint32_t follow_id, bool replay_sensors)
World GenerateOpenDriveWorld(std::string opendrive, const rpc::OpendriveGenerationParameters ¶ms, bool reset_settings=true) const
World ReloadWorld(bool reset_settings=true) const
std::string StartRecorder(std::string name, bool additional_data=false)
void ApplyBatch(std::vector< rpc::Command > commands, bool do_tick_cue=false) const
void SetReplayerIgnoreHero(bool ignore_hero)
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.
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.
boost::shared_ptr< T > SharedPtr
Use this SharedPtr (boost::shared_ptr) to keep compatibility with boost::python, but it would be nice...
Seting for map generation from opendrive without additional geometry