主要内容

Writer

Write selected topic to SUMO scenario

Since R2026a

  • SUMO Writer 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 Writer block writes vehicle or visualization information to a SUMO™ scenario. Use the Topic Category parameter to select which data to write to the scenario.

You can set the Topic Category parameter to Vehicle or Visualization. For example, when you select the Vehicle topic, the block writes data associated with the vehicle, such as the actor ID, velocity, and angular velocity, to the SUMO scenario.

Examples

Ports

Input

expand all

ID of the vehicle to write to or track in the SUMO scenario, specified as a string scalar.

Example: "Vehicle_1"

Dependencies

To enable this port, set Topic Category to Vehicle or set Topic Category to Visualization and then set Visualization Topic to Track Vehicle.

Data Types: string

Position of the vehicle along the x-axis, in meters, specified as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

Data Types: double

Position of the vehicle along the y-axis, in meters, specified as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

Data Types: double

Yaw of the vehicle, in degrees, specified as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

Data Types: double

ID of the route edge on which to position the vehicle, specified as a string scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

  • Select Use Route Flag parameter.

Data Types: string

Index of the lane of the route on which to position the vehicle, specified as a numeric scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

  • Select Use Route Flag parameter.

Data Types: uint32

Route mapping of the vehicle position, specified as an integer in the range [0, 7]. Each bit of the binary equivalent of the specified integer represents whether the vehicle position maps to an available route, edge, or lane of the road network.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

  • Select Use Route Flag parameter.

Data Types: uint8

Distance offset relative to front the vehicle, in meters, specified as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Min gap.

Data Types: double

Speed of the vehicle, in meters per second, specified as a real-valued scalar.

Dependencies

To enable this port:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Speed.

Data Types: double

Speed mode of the vehicle, specified 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.

Data Types: uint32

ID of the visualization in the SUMO interface in which you want to view the simulation, specified as a string scalar.

Dependencies

To enable this port, set Topic Category to Visualization.

Data Types: string

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

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to Zoom factor.

Data Types: double

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

Dependencies

To enable this port:

  • Set Topic Category to Visualization.

  • Set Visualization Topic to Schema.

Data Types: string

Parameters

expand all

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

  • Vehicle — Writes vehicle data to the SUMO scenario

  • Visualization — Writes visualization data to the SUMO scenario

Specify the vehicle data to write to the SUMO scenario, specified as one of these options:

  • Position — Position of the vehicle in the scenario.

  • Min gap — Distance offset relative to the front vehicle, in meters.

  • Speed — Speed of the vehicle, in meters per second.

  • Speed mode — Speed mode of the vehicle.

Dependencies

To enable this parameter, set Topic Category to Vehicle.

Specify the visualization data to write to the SUMO scenario, specified as one of these options:

  • Zoom factor — Zoom factor of the visualization view.

  • Track Vehicle — Specifies to track the vehicle during simulation.

  • Schema — Schema of the simulation visualization view.

Dependencies

To enable this parameter, set Topic Category to Visualization.

Select this parameter to enable the Edge ID, Lane and Keep Route input ports, which you can use to position a vehicle in the scenario by specifying the route information.

Dependencies

To enable this parameter:

  • Set Topic Category to Vehicle.

  • Set Vehicle Topic to Position.

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

Version History

Introduced in R2026a

See Also

| | |

External Websites