주요 콘텐츠

Reader

Read selected topic from SUMO scenario

Since R2026a

  • SUMO Reader block icon

Libraries:
Automated Driving Toolbox Interface for Eclipse SUMO Traffic Simulator

Description

Add-On Required: This feature requires the Automated Driving Toolbox Interface for Eclipse SUMO Traffic Simulator add-on.

The Reader block reads the selected topic from the SUMO™ scenario. Use the Topic Category parameter to select which data to read from the scenario.

You can set the Topic Category parameter to Simulation, Vehicle, or Visualization. When you select the Simulation topic, the block returns the details of vehicles included in the scenario, such as the number of arrived and departed vehicles at each simulation time step. When you select the Vehicle topic, the block returns the attributes of a specified vehicle, such as its position, speed, and angle, at each time step. When you select the Visualization topic, the block returns the status of the specified view of the SUMO interface, such as its zoom factor and schema.

Examples

Ports

Input

expand all

ID of the vehicle for which to read information, specified as a string scalar.

Example: "ActorID_1"

Dependencies

To enable this port, set Topic Category parameter to Vehicle.

Data Types: string

ID of the simulation visualization in the SUMO interface for which to read information, specified as a string scalar.

Example: "View#0"

Dependencies

To enable this port, set Topic Category to Visualization.

Data Types: string

Output

expand all

IDs of the vehicles in the SUMO scenario, returned as a vector of strings. The block returns different information depending on the value of the Simulation Topic parameter:

  • ID list — IDs of the vehicles present in the scenario.

  • Arrived list — IDs of the vehicles that have arrived at their destinations and been removed from the scenario.

  • Departed list — IDs of the vehicles that have departed from their sources and been added to the scenario.

Dependencies

To enable this port:

  • Set Topic Category to Simulation.

  • Set Simulation Topic to ID list, Arrived list, or Departed list.

Number of vehicles in the SUMO scenario, returned as a numeric scalar.

Dependencies

To enable this port:

  • Set Topic Category to Simulation.

  • Set Simulation Topic to ID count.

Acceleration of the vehicle, in meters per second squared, returned as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Acceleration.

Speed values of the vehicle, in meters per second, returned as a real-valued scalar. The block returns a different speed value depending on the value of the Vehicle Topic parameter:

  • Max allowed speed — Maximum allowed speed of the lane the vehicle is on.

  • Lateral speed — Lateral speed of the vehicle.

  • Speed — Speed of the vehicle.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Max allowed speed, Lateral speed, or Speed

Angle or yaw of the vehicle, in degrees, returned as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Angle.

Distance of the vehicle from starting point, in meters, returned as a real-valued scalar.

Dependencies

To enable this port, set these parameter in this order:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Distance to starting point.

Position of the vehicle, in meters, returned as a real-valued vector.

The format of the vector depends on the value of the Vehicle Topic parameter:

  • Position — Represents the 2D position of the vehicle as a 1-by-2 real-valued vector of the form [x y].

  • Position3D — Represents the 3D position of the vehicle as a 1-by-3 real-valued vector of the form [x y z].

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position or Position3D

Slope of the vehicle at its current position, in degrees, returned as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Slope.

Speed mode of the vehicle, returned as an integer in the range [0, 127]. Each bit of the binary equivalent of the returned integer represents whether a specific speed mode is enabled. For example, if the block returns the value 73, this corresponds to the binary pattern 1001001, which indicates that speed modes 1, 4, and 7 are enabled.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Speed mode.

ID of the SUMO class of the vehicle, returned as a string scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Vehicle profile.

Schema of the simulation visualization in the SUMO interface, returned as a string scalar.

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to Schema.

Zoom factor of the simulation visualization in the SUMO interface, returned as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to Zoom factor.

View IDs of the simulation visualizations open in the SUMO interface, returned as a vector of string.

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to View IDs.

Version of the SUMO application, returned as a string scalar.

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to SUMO version.

Traffic control interface (TraCI) in the SUMO interface, returned as a string scalar.

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to SUMO version.

Parameters

expand all

Specify the topic category from which to read data as one of these options:

  • Vehicle — Reads vehicle data from the SUMO scenario

  • Simulation — Reads simulation data from the SUMO scenario

  • Visualization — Reads visualization data from the SUMO scenario

Specify the simulation data to read from the SUMO scenario at the current simulation step as one of these values:

  • ID count — Number of vehicles in the scenario.

  • ID list — IDs of the vehicles in the scenario.

  • Arrived list — IDs of the vehicles that have arrived their destinations and been removed from the scenario.

  • Departed list — IDs of the vehicles that have departed from their sources and been added to the scenario.

Dependencies

To enable this parameter, set Topic Category to Simulation.

Specify the vehicle data to read from the SUMO scenario as one of these options:

  • Position — 2D position of the vehicle in the scenario.

  • Acceleration — Acceleration of the vehicle.

  • Max allowed speed — Maximum allowed speed of the lane the vehicle is on.

  • Angle — Angle or yaw of the vehicle.

  • Distance to starting point — Distance of the vehicle from the starting point.

  • Lateral speed — Lateral speed of the vehicle.

  • Position3D — 3D position of the vehicle in the scenario.

  • Slope — Slope of the vehicle at its current position in the scenario.

  • Speed — Speed of the vehicle.

  • Speed mode — Speed mode of the vehicle.

  • Vehicle profile — ID of the SUMO class of the vehicle.

Dependencies

To enable this parameter, set Topic Category to Vehicle.

Specify the simulation visualization data to read from the SUMO interface as one of these options:

  • Schema — Schema of the simulation visualization.

  • Zoom factor — Zoom factor of the simulation visualization.

  • View IDs — View IDs of the open simulation visualizations.

  • SUMO version — SUMO application version and traffic control interface data.

Dependencies

To enable this parameter, set Topic Category to Visualization.

Specify the sample time of the simulation, in seconds, as a positive real scalar.

Version History

Introduced in R2026a

See Also

| | |

External Websites