Skip to content

Examples

The workspace ships with examples/ — seven ready-to-run notebooks that take you from reading a sensor to training a deep-learning racer. Each notebook explains itself as it goes: read a cell, run it, watch the robot react. Supporting files (web pages, models, configs) live in examples/assets/.

How to run a notebook

  1. Run the simulator and open the workspace (a real kit's workspace is seeded with the same examples/ folder).
  2. In the file explorer, open a notebook — say examples/line-tracing.ipynb.
  3. When VS Code asks for a kernel, pick Python 3 (PhysiCar AI) — ROS 2 and every library the examples use are already set up in it.
  4. Run the cells top to bottom. Driving loops run until you press ⏹ (interrupt) — the notebook then stops the car for you.

Live views open in app.physicar's MYAPP tab (they serve on port 5000, one at a time). Broke a notebook? Reset Examples in the PHYSICAR AI panel's settings restores the originals.

The notebooks

Two are references — runnable tours of the interfaces everything else builds on:

  • PhysiCar ROS 2 — the robot: every ROS 2 topic and Web API endpoint — sensors, control, audio.
  • PhysiCar SIM — the simulator: teleport, worlds, traffic lights, reset, evaluation. (simulator only)

Five are projects — each builds one complete robot behavior:

  • Line Tracing — follow the yellow line with a color filter and P-control. No learning — your first autonomous drive.
  • Object Detection — detect objects with YOLOv8 and chase one.
  • Navigation — map the track with the LiDAR (SLAM), then click a destination and the car drives itself there (Nav2).
  • Racing Deep Learning — one CNN, two teachers: supervised learning from your driving, reinforcement learning from a reward.
  • Agent — chat and voice agents that drive the robot through LLM tool calling.
  1. PhysiCar ROS 2 — the robot's interfaces; every project wraps them
  2. PhysiCar SIM — worth an early skim if you practice in the simulator
  3. Line Tracing — the perception → decision → control loop, at its simplest
  4. Object Detection — the same loop, with a neural network doing the seeing
  5. Navigation — the standard ROS 2 stack: SLAM, then Nav2
  6. Agent — wrap the robot's API into tools an LLM can call
  7. Racing Deep Learning — the deepest one: train the driver yourself, both ways

Most notebooks run unchanged on a real kit — they only talk to the robot's local interfaces. PhysiCar SIM and the reinforcement-learning half of Racing Deep Learning need the simulator.

Learn more

Start the simulator → Start with a virtual robot. Robot endpoints → Web API. ROS 2 topics → ROS2 interface reference.

AI