Skip to content

PhysiCar SIM

examples/physicar-sim.ipynb tours the simulation API — everything under /sim/api/ that exists only in the simulator: teleporting the car, switching worlds, traffic lights, resets, on-screen overlays, evaluation runs. Sections are ordered by how often you'll reach for them; Navigation and the reinforcement-learning half of Racing Deep Learning lean on what this notebook shows.

This one is simulator-only — the setup cell checks for a running simulator and stops with a notice if there isn't one.

Inside the notebook

Section What you run
Status & time /status, /clock — sim time, real time, real-time factor
Vehicle GET /pose, and POST /pose to teleport. The car always lands upright — so this also rescues a flipped car
World & objects world snapshot, the track's centerline and boundaries (plotted with matplotlib), the object list, and moving objects by name
Traffic lights read states, set red/green — green→red passes through 3 seconds of yellow
Reset POST /reset — moved objects, lights, and the car snap back to their start poses, instantly. The go-to reset between training episodes
Display brightness (0.2–2.0, applied to the viewer and the robot camera alike) and text overlays on the /sim view
Monitoring GET /state — everything that changes, in one call; GET /events — the live SSE stream
Evaluation what the button on the /sim view calls: get the config, run, stop
Worlds list installed worlds, switch, install a published world by its ID

Run it

  1. Start the simulator and open examples/physicar-sim.ipynb from the file explorer.
  2. Pick the Python 3 (PhysiCar AI) kernel when asked.
  3. Run the setup cell, then explore section by section — keep the SIMULATOR tab of app.physicar visible to watch each call take effect.

Watch out

  • POST /reset is instant and pose-only; POST /respawn reloads the whole world and takes several seconds. Reach for reset first.
  • Only World Builder objects and traffic lights can be moved by name — walls and the track itself refuse.
  • While a light passes through yellow (3 s), new commands to it are rejected — wait it out.

🛠 Mission: teleport the car to the far side of the track, flip a light to red, then call POST /reset and watch everything snap home.

Learn more

How the simulator works → PhysiCar Sim. Build and publish your own world → Build your own track (World Builder). Start the simulator → Start with a virtual robot.

AI