Implementation:CARLA simulator Carla Controller
| Knowledge Sources | |
|---|---|
| Domains | Road Network, Traffic Signals |
| Last Updated | 2026-02-15 05:00 GMT |
Overview
The Controller class represents a signal controller in the OpenDRIVE road network, grouping traffic signals and associating them with junctions for coordinated signal management.
Description
carla::road::Controller is a MovableNonCopyable class that models an OpenDRIVE controller element. Each controller has:
- Identity -- a unique
ContId, a name string, and a sequence number for ordering - Signals -- a
std::set<SignId>of signal IDs managed by this controller - Junctions -- a
std::set<JuncId>of junction IDs where this controller operates
Controllers provide coordinated management of multiple traffic signals, typically at intersections where signals must be synchronized.
Usage
Use this class to query which signals belong to a controller and which junctions it governs. This is useful for implementing coordinated traffic light phases.
Code Reference
Source Location
- Repository: CARLA
- File:
LibCarla/source/carla/road/Controller.h
Signature
class Controller : private MovableNonCopyable {
public:
Controller(ContId id, std::string name, uint32_t sequence);
const ContId &GetControllerId() const;
const std::string &GetName() const;
const uint32_t &GetSequence() const;
const std::set<SignId> &GetSignals() const;
const std::set<JuncId> &GetJunctions() const;
};
Import
#include "carla/road/Controller.h"
I/O Contract
| Input | Type | Description |
|---|---|---|
ContId | Unique controller identifier
| ||
std::string | Controller name
| ||
uint32_t | Sequence number for ordering
|
| Output | Type | Description |
|---|---|---|
std::set<SignId> | Set of signal IDs managed by the controller
| ||
std::set<JuncId> | Set of junction IDs where controller operates
|
Usage Examples
const auto &controllers = map_data.GetControllers();
for (const auto &[id, controller] : controllers) {
auto signals = controller->GetSignals();
auto junctions = controller->GetJunctions();
}