Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:CARLA simulator Carla EpisodeSettings

From Leeroopedia
Knowledge Sources
Domains Simulation Configuration, RPC Serialization
Last Updated 2026-02-15 05:00 GMT

Overview

EpisodeSettings is an RPC-serializable class that configures the simulation episode parameters including synchronous mode, rendering, physics sub-stepping, and streaming distances.

Description

Defined in the carla::rpc namespace, this class (~158 lines) holds all configurable episode-level settings:

  • synchronous_mode: whether the client controls simulation stepping
  • no_rendering_mode: disables rendering for faster simulation
  • fixed_delta_seconds: optional fixed time step (std::optional<double>)
  • substepping: enables physics sub-stepping with configurable max_substep_delta_time and max_substeps
  • max_culling_distance: distance-based actor culling
  • deterministic_ragdolls: deterministic ragdoll physics
  • tile_stream_distance / actor_active_distance: streaming and activation distances in meters
  • spectator_as_ego: whether the spectator acts as the ego vehicle

The class supports UE4 conversion (with cm-to-m unit conversion for streaming distances), equality operators, and MsgPack serialization.

Usage

Use this type to configure or query the simulation settings for the current episode via the CARLA client API.

Code Reference

Source Location

  • Repository: CARLA
  • File: LibCarla/source/carla/rpc/EpisodeSettings.h

Signature

namespace carla {
namespace rpc {

  class EpisodeSettings {
  public:
    bool synchronous_mode = false;
    bool no_rendering_mode = false;
    std::optional<double> fixed_delta_seconds;
    bool substepping = true;
    double max_substep_delta_time = 0.01;
    int max_substeps = 10;
    float max_culling_distance = 0.0f;
    bool deterministic_ragdolls = true;
    float tile_stream_distance = 3000.f;
    float actor_active_distance = 2000.f;
    bool spectator_as_ego = true;

    EpisodeSettings() = default;
    EpisodeSettings(bool synchronous_mode, bool no_rendering_mode, ...);

    bool operator==(const EpisodeSettings &rhs) const;
    bool operator!=(const EpisodeSettings &rhs) const;

    MSGPACK_DEFINE_ARRAY(...);
  };

} // namespace rpc
} // namespace carla

Import

#include "carla/rpc/EpisodeSettings.h"

I/O Contract

Field Type Default Description
synchronous_mode bool false Client-controlled stepping
no_rendering_mode bool false Disable rendering for performance
fixed_delta_seconds std::optional<double> nullopt Fixed time step (nullopt = variable)
substepping bool true Enable physics sub-stepping
max_substep_delta_time double 0.01 Maximum sub-step delta time
max_substeps int 10 Maximum number of sub-steps per frame
max_culling_distance float 0.0f Distance-based culling threshold
deterministic_ragdolls bool true Deterministic ragdoll physics
tile_stream_distance float 3000.0f Map tile streaming distance in meters
actor_active_distance float 2000.0f Actor activation distance in meters
spectator_as_ego bool true Spectator camera acts as ego

Usage Examples

#include "carla/rpc/EpisodeSettings.h"

carla::rpc::EpisodeSettings settings;
settings.synchronous_mode = true;
settings.fixed_delta_seconds = 0.05; // 20 FPS fixed step
settings.no_rendering_mode = false;
settings.max_substeps = 10;

// Apply settings via client RPC

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment