The FCD (floating car data) export contains location and speed along with other information for every vehicle in the network at every time step. The output behaves somewhat like a super-accurate high-frequency GPS device for each vehicle. The outputs can be processed further using the TraceExporter tool for adapting frequency, equipment rates, accuracy and data format.
Instantiating within the Simulation#
The simulation generates this output when setting the option --fcd-output <FILE>. <FILE> is the name of the file the output will be written to. Any other file with this name will be overwritten, the destination folder must exist.
By default, fcd-output is enabled for all vehicles and persons in the simulation with output in each simulation step. Using device assignment options or parameters (i.e. --device.fcd.probability 0.25) the set of vehicles which generate fcd output can be reduced. The output period can be set by using option --device.fcd.period <TIME>. To delay output (i.e. until some warm-up time has passed), the option --device.fcd.begin <TIME> may be used.
The generated XML file looks like this:
<fcd-export> <timestep time="<TIME_STEP>"> <vehicle id="<VEHICLE_ID>" x="<VEHICLE_POS_X>" y="<VEHICLE_POS_Y>" angle="<VEHICLE_ANGLE>" type="<VEHICLE_TYPE>" speed="<VEHICLE_SPEED>"/> ... more vehicles ... </timestep> ... next timestep ... </fcd-export>
|timestep||(simulation) seconds||The time step described by the values within this timestep-element|
|id||id||The id of the vehicle|
|type||id||The name of the vehicle type|
|speed||m/s||The speed of the vehicle|
|angle||degree||The angle of the vehicle in navigational standard (0-360 degrees, going clockwise with 0 at the 12'o clock position)|
|x||m or longitude||The absolute X coordinate of the vehicle (center of front bumper). The value depends on the given geographic projection|
|y||m or latitude||The absolute Y coordinate of the vehicle (center of front bumper). The value depends on the given geographic projection|
|z||m||The z value of the vehicle (center of front bumper).
Note: This value is only present if the network contains elevation data
|pos||m||The running position of the vehicle measured from the start of the current lane.|
|lane||id||The id of the current lane.|
|slope||degree||The slope of the vehicle in degrees (equals the slope of the road at the current position)|
|signals||bitset||The signal state information (blinkers, etc). Only present when option --fcd-output.signals is set.|
When the option --fcd-output.geo is set, the written (x,y)-coordinates will be the lon/lat geo-coordinates.
By default fcd-output returns location values in meter with a precision of 1cm. (changeable by setting option --precision) If you set option --fcd-output.geo the values are lon,lat as decimal values with a precision of 6 decimal places (changeable by setting option --precision.geo)
Person and Container Output#
Any persons or container in the simulation will cause output of he following form:
<fcd-export> <timestep time="<TIME_STEP>"> <vehicle .../> ... <person id="..." x="..." y="..." angle="..." type="..." speed="..." edge="..." slope="..."/> ... <container id="..." x="..." y="..." angle="..." type="..." speed="..." edge="..." slope="..."/> ... </timestep> ... next timestep ... </fcd-export>
If persons or containers are transported within a vehicle, their
<container> elements will be written as child elements of that
Filtering / Restricting Output#
The generated output files can become quite large. To write gzipped output files, simply name the output file with an
Restricting the set of vehicles that generate output#
Output can be restricted to specific vehicle types or vehicle ids by controlling the set of vehicles that are equipped with the fcd-device. The following example restricts output to a single vehicle called ego:
The following example restricts fcd-output to a single flow out of the whole simulation
--device.fcd.probability 0 ...
<flow ...> <param key="has.fcd.device" value="true"/> </flow>
Restricting the locations#
Output can be restricted to a specific set of edges by loading a list of edges from a file with option --fcd-output.filter-edges.input-file <FILE>. The file format for this is the same as the one when saving selections in netedit:
edge:id1 edge:id2 ...
Restricting output by sensor range#
When not all vehicles are equipped with an fcd-device, other ehicles and persons in a radius around the equipped vehicles can be included in the output by setting option --device.fcd.radius to the desired range in m.
- --fcd-output.geo will toggle output coordinates to WGS84 (for geo-referenced networks)
- --fcd-output.signals will add signal state information to the output
- --fcd-output.distance will add kilometrage information to the output
- --fcd-output.acceleration will add acceleration data to the output (also lateral acceleration when using the sublane model
- --fcd-output.max-leader-distance FLOAT will add attributes leaderGap, leaderSpeed, leaderID whenever a vehicle has a leader within the given distance. Otherwise, leaderID will be "" and leaderGap, leaderSpeed will be -1.
- --fcd-output.params KEY1,KEY2,... adds generic parameters to the output (supports device and carfollowmodel parameters as well as arbitrary user-define values)
- --fcd-output.attributes ATTR1,ATTR2,... restricts written attributes to the given list (to reduce output). The following attributes are special:
- all: enables all attributes
- vehicle: add a vehicle attribute to each person (and thereby distinguish riding from walking persons).
- odometer: write odometer value for each vehicle (distance driven since departure)
- posLat: write lateral position on lane for each vehicle