Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

muety/tafviz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚙 tafviz

Extremely simple and lean 2D visualization of traffic scenarios in 350 lines of JavaScript. Reads a CSV object list and an optional map (simple polylines stored as GeoJSON) and plays the scenario right in your browser without any dependencies. Written by hand. Work in progress.

Demo available here.

Recording.2025-04-17.at.11.04.46.webm

Usage

python -m http.server

Go to http://localhost:8000.

Input Data

Object list

By default, the scenario format of TAF-BW is used, which is mostly the same as used by the INTERACTION dataset. However, by customizing the column names (see config.js), any CSV format that includes all of the 8 required fields can be read.

Note: A scenario origin point in lat / lon world coordinates is required when wanting to visualize on the map.

Map

The optional map is read as a simple set of polylines for maximum flexibility. No Lanelet2 or OpenDrive format required. This allows to use self-drawn or auto-generated maps, which are not necessarily 100 % consistent.

Lanelet2 / OSM to GeoJSON

You can use GDAL to convert a Lanelet2 map from OSM format to GeoJSON.

OSM_USE_CUSTOM_INDEXING=NO ogr2ogr -f GeoJSON k729.geojson k729.osm lines

Alternatively, you can use this web UI to perform the conversion right in your browser without installing any dependencies (thanks, @bugra9 for porting GDAL to WASM). Set the options as follow:

gdal3.js Options

If you end up with an empty file, use JOSM instead (File -> Save As...).

Pre-converted versions of the official maps are to be found at data/.

Details

For proper visualization, metric coordinates (no lat / lon) are used internally. Thus, input lat / lon coordinates (by default, WGS84 is assumed) are automatically converted to web mercator projection.

Example Data

To Do

  • Code cleanup
  • Error handling

See it in action

screencast.webm

Disclaimer

This project is not affiliated with FZI Forschungszentrum Informatik Karlsruhe.

License

This repository contains a modified subset of data originally created by FZI Forschungszentrum Informatik, used under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).

About

Extremely simple and lean 2D visualization of traffic scenarios in 350 lines of JavaScript.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •