The backend ships a staticDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/avl_tree_car/llms.txt
Use this file to discover all available pages before exploring further.
obstacles_types.json file that defines the ten obstacle types available in the simulation. The frontend fetches this file at startup to know which sprite to render for each obstacle node and how much damage a collision with that obstacle inflicts on the car’s battery. Every obstacle inserted into the AVL tree carries a type_id that maps directly to one of these ten entries.
How to fetch
The file is served as a static JSON asset atGET /data/json/obstacles_types.json. No authentication is required.
The array of obstacle types is returned inside the
data field of the standard BaseFlaskResponse envelope. The message value is the literal string the server produces (including the “conent” typo present in the source).Obstacle types
The table below lists all ten obstacle types, their numeric IDs, and the damage value each one inflicts on the car upon collision.| ID | Type | Damage |
|---|---|---|
| 1 | Cone | 0.5 |
| 2 | Rock | 1 |
| 3 | Tree | 10 |
| 4 | Tire | 5 |
| 5 | Nail | 4 |
| 6 | Trunk | 6 |
| 7 | Person | 3 |
| 8 | Car | 15 |
| 9 | Bicycle | 7 |
| 10 | Chair | 6 |
Using type_id in API requests
When adding a single obstacle node directly via POST /avl/node/add, send the numeric type_id field rather than the string type name. The server constructs an Obstacle object using the (x, y, type_id) tuple and inserts it into the AVL tree.
x: 100, y: 20. The same numeric ID is used for POST /avl/node/remove to identify the obstacle to delete.
There are two different field names depending on which endpoint you call:
type(string, e.g."rock") — used in theobstaclesarray of thePOST /avl/add/configsbatch payload.type_id(integer, e.g.2) — used inPOST /avl/node/addandPOST /avl/node/removefor single-node operations.
Obstacle with a None value for the missing field.Damage values
Damage values are consumed exclusively by the frontend for collision handling. When the car sprite overlaps an obstacle’s collider rectangle, the frontend looks up thedamage value for that obstacle’s type_id and subtracts it from the car’s battery level. Higher damage means a steeper battery drain per collision:
- Low damage (0.5 – 1): Cone, Rock — minor road debris, barely affects the run.
- Medium damage (3 – 7): Person, Nail, Tire, Chair, Trunk, Bicycle — significant hazards that require active avoidance.
- High damage (10 – 15): Tree, Car — critical obstacles; a single hit can end the simulation run.