Implementation:CARLA simulator Carla OpendriveGenerationParameters
| Knowledge Sources | |
|---|---|
| Domains | OpenDRIVE, Map Generation, RPC Serialization |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
OpendriveGenerationParameters is an RPC-serializable struct that configures the procedural mesh generation from OpenDRIVE road network files.
Description
Defined in the carla::rpc namespace, this struct holds parameters controlling how CARLA generates 3D road geometry from OpenDRIVE descriptions:
- vertex_distance (default 2.0): spacing between mesh vertices along roads
- max_road_length (default 50.0): maximum road segment length before splitting
- wall_height (default 1.0): height of road boundary walls
- additional_width (default 0.6): extra width added to roads
- vertex_width_resolution (default 4.0): resolution across road width
- simplification_percentage (default 20.0): mesh simplification percentage
- smooth_junctions (default true): whether to smooth junction geometry
- enable_mesh_visibility (default true): whether generated mesh is visible
- enable_pedestrian_navigation (default true): whether to generate pedestrian navigation mesh
Note: vertex_width_resolution and simplification_percentage are not included in the MsgPack serialization array.
Usage
Use this struct when loading or generating maps from OpenDRIVE files to control the quality, resolution, and features of the generated road geometry.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/rpc/OpendriveGenerationParameters.h
Signature
namespace carla {
namespace rpc {
struct OpendriveGenerationParameters {
OpendriveGenerationParameters() {}
OpendriveGenerationParameters(
double v_distance, double max_road_len,
double w_height, double a_width,
bool smooth_junc, bool e_visibility, bool e_pedestrian);
double vertex_distance = 2.0;
double max_road_length = 50.0;
double wall_height = 1.0;
double additional_width = 0.6;
double vertex_width_resolution = 4.0f;
float simplification_percentage = 20.0f;
bool smooth_junctions = true;
bool enable_mesh_visibility = true;
bool enable_pedestrian_navigation = true;
MSGPACK_DEFINE_ARRAY(vertex_distance, max_road_length,
wall_height, additional_width, smooth_junctions,
enable_mesh_visibility, enable_pedestrian_navigation);
};
} // namespace rpc
} // namespace carla
Import
#include "carla/rpc/OpendriveGenerationParameters.h"
I/O Contract
| Field | Type | Default | Description |
|---|---|---|---|
| vertex_distance | double |
2.0 | Spacing between vertices along road |
| max_road_length | double |
50.0 | Max road segment length |
| wall_height | double |
1.0 | Road boundary wall height |
| additional_width | double |
0.6 | Extra width added to roads |
| vertex_width_resolution | double |
4.0 | Resolution across road width (not serialized) |
| simplification_percentage | float |
20.0 | Mesh simplification percentage (not serialized) |
| smooth_junctions | bool |
true | Smooth junction geometry |
| enable_mesh_visibility | bool |
true | Generated mesh visibility |
| enable_pedestrian_navigation | bool |
true | Generate pedestrian nav mesh |
Usage Examples
#include "carla/rpc/OpendriveGenerationParameters.h"
carla::rpc::OpendriveGenerationParameters params;
params.vertex_distance = 1.0; // finer mesh resolution
params.max_road_length = 100.0;
params.smooth_junctions = true;
params.enable_pedestrian_navigation = true;
// Pass params when loading an OpenDRIVE map