The course site
make site # render docs/ into site/
make site-serve # and look at it: http://localhost:8109/
What it is
A course, not a manual. Six stages, all free for now. Stages 4–6 are
tiers, planned at $5 each once the course matures; their YAML records
that next to price: free, and putting the price back is all it takes
to show it again. Every stage opens with what you will be able to do by
the end, and closes with a project that has a definition of done.
Every lesson has the same shape, so a student learns where to look:
| part | YAML key | what it is |
|---|---|---|
| objective | objective |
one sentence: what you will be able to do |
| why | body |
the reasoning, usually through something that went wrong here first |
| do it | steps |
numbered; each a do, an optional run, an optional expect |
| checkpoint | checkpoint |
how you know it worked |
| when it goes wrong | pitfalls |
symptom → cause → fix |
| terms | concepts |
term + meaning; collected into the glossary page |
| check yourself | quiz |
q + a; answers fold away in <details>, which needs no script |
| stretch | exercise |
a task, with an optional hint and answer |
| going deeper | read |
docs in docs/, linked by their rendered page |
| try it in the lab | lab |
optional: a brief and tasks, each a do the browser lab checks with a check; see The lab |
Plus minutes, so stage and course durations are summed, never
typed — the same rule as the robot's inertia tensors.
The curriculum is DATA, in course/*.yaml. Adding a lesson is adding a
block to a YAML file; the generator knows nothing about any particular
lesson. That is the same reasoning that puts the robot's dimensions in
YAML rather than in the xacro.
It is validated before it is rendered
make course-check
A lesson that tells a student to run make foo when the Makefile has
no foo, or links a doc that has been renamed, is a broken lesson that
looks finished. So before rendering, the generator checks:
- every stage, lesson and project has the fields its page renders
- every
make <target>in a step, a pitfall's fix or inline code exists in the Makefile — prose is not checked, only code - every doc a lesson links or reads exists in
docs/ - lesson ids and glossary terms are unique, and stages are numbered in file order
- every lab task's
checknames a joint, a pose and a step size the robot actually has, read from its profile and the teleop
Every problem is reported at once, not the first. A failure stops
make site, the CI course job, and the deploy build — so a broken
curriculum never replaces the one already being served. The checker was
mutation-tested when it was written: four planted faults, four named
errors.
One site, one course, one robot
The site is 3VN Robotics. Its front page, site/index.html, lists
the courses it offers: one for now, Robotics Software Engineering,
taught on the SO-101. The course lives in its own folder,
site/robotics-software-engineering/, topic pages included, so a
second course would be a second folder rather than a rewrite. The
project's documentation sits at the top level beside the front page,
as the reference both link into.
The course and its robot are data, in course/course.yaml: the course's
id (its folder), title, tagline and summary, and a robot: block with
the price, what the robot teaches and where it stands. It is not a
stage, so the builder reads it apart from the numbered files.
Every lesson is written for the SO-101. A lesson whose steps cannot be
written yet, because the code under them does not exist, carries
planned:, a sentence saying what it waits for:
- id: prove-the-grasp
title: Prove the grasp — and what is still open
objective: ...
body: | # the idea is shown in full
...
planned: >- # and so is what it is waiting for
Needs the jaws switched back from boxes to meshes. ...
A planned lesson needs its objective, reasoning and tags, and may carry terms; its steps, checkpoint and pitfalls are neither required nor shown, because a half-written step is worse than none. Its page says it is planned and why; the map greys it out; the stage ladder marks it.
Coverage is counted, never claimed. make course-check prints how
many lessons are written and how many planned, and the robot's page has
the same count per stage.
It used to be several robots
Until 2026-11-27 the course was taken on one of two arms, the 3VN Arm 1
or the SO-101, with a copy of the site per robot and a version of each
lesson per robot under flavors:. With one robot that machinery was
dead weight, and worse, a place for another robot's text to hide. So
validation now refuses flavors, scope, needs and only with
a message saying why, rather than ignoring them.
Nothing was lost. The 3VN Arm 1's version of every lesson, and the
builder that rendered it, are in git at commit 2f71290;
course/archive/ keeps its robot card and the Make your own robot
side track; and the robot itself is still in the tree and still tested,
one argument away: make sim PROFILE=threevn_arm_v1. See
course/archive/README.md.
Old addresses keep working, with a meta refresh, which the CSP allows:
site/so101/... and site/3vn-arm1/... land on the same page in the
course folder, as do the top-level course pages from before that.
Lessons that were removed, the mobile-base lessons and the side track,
land on the course's front page.
The project's documentation is still rendered, underneath, as reference that lessons link into. The course is the front page and the docs are the appendix, rather than the other way round. Docs about the 3VN Arm 1 are grouped at the end of the reference under their own heading, so they stay findable without reading as part of the course.
Finding your way around
The site is two things, and the header names them: Course, which you follow in order, and Reference, which you look things up in. Between them is Lab, one page rather than a half: the course's robot, to drive in the browser (below). Every page sits in a frame of three columns:
- A map down the left. On a course page it is the course: every
stage folds, the stage this page belongs to is open, and this page is
marked. Planned lessons are greyed (a screen reader hears "planned").
Under the stages: the lab, topics, glossary, the robot, and the reference. On
a reference page the map is the reference itself, in the reading
order of
CURRICULUMinscripts/build_site.py, then any doc it does not name, then the decisions, with a link back to the course. The front page has no map: it is the site's, not the course's, and reads at reading width. - The page. Reference pages now carry what lessons always had: a
breadcrumb above (
Reference / The system) and previous/next below, in the map's order.reference.htmlis the reference's own index;docs/reference.mdwould collide with it, somake course-checkrefuses one. - "On this page" on the right, built from the page's
<h2>s, when it has three or more. Lesson sections get their ids here; docs keep the ones markdown gives them.
Below 1240 px wide the outline is dropped; below 900 px the map folds behind a Menu button. Opening a panel without a script takes a checkbox and its label, so that is what the button is: the checkbox is visually hidden but focusable, and the label shows its focus ring.
The header never moves. It is the same width on every page, and
every control in it (tabs, theme, Menu) is --control tall, so moving
between pages changes nothing above the page. Below 900 px it is two
fixed rows: brand, theme and Menu, then the tabs. To fit the theme switch, the preview badge goes below
460 px and Menu becomes its icon alone below 400 px.
The theme switch. Auto, Light and Dark, at the right of the header.
Auto follows the reader's system setting; Light and Dark override it on
every page, kept in localStorage so the choice outlasts the tab. It is
three radios and a second script, theme.js (THEME_JS), loaded in
<head> without defer so the chosen theme is on <html> (as
data-theme) before the first paint, with no flash of the other one.
The switch only shows where that script ran: without it nothing could
carry the choice to the next page, so the system setting decides, as
before.
The tabs remember. Leave a lesson for the reference and come back
by the Course tab, and you land on that lesson, where you stopped
reading; the same the other way. The open tab still goes to its half's
front page. That needs memory, so it is a script,
nav.js (NAV_JS in the generator), and sessionStorage, so it lasts
as long as the browser tab. Because the header does not follow the
page, a reader scrolls back up to reach the tabs, so where the page is
when it is left means nothing: what is kept is where the reader last
stopped scrolling, anywhere below the top 300 px. Back, forward and
reload keep the spot; any other way into a page starts at its top.
Without the script, the tabs are plain links to each half's front page.
Tiers are shown, not enforced. The lock badge and the price are visible; nothing checks them. There are no accounts and no payment, so anyone with the link reads everything.
It also publishes the parts that do not work. The index says so in a banner, and the grasp lesson ends on an open problem. A course that only shows the finished half teaches the wrong thing about engineering.
Three constraints, all from where it is served
It sits behind the shared 3VNSYSTEMS Caddy, at a public path,
3vnsystems.com/robotics/, which dictates more than it looks like:
- Every link is relative. The site lives under
/robotics/today, an older unlisted path still serves it for links shared before it went public, and it may live at a bare domain tomorrow. Perprojects-for-businesses/README.md, each move is meant to be a config change rather than a rewrite, so nothing may hardcode the prefix. - Nothing needs JavaScript, except the lab. The enforced CSP is
script-src 'self'with no'unsafe-inline', so an inline<script>would be blocked, and a file served beside the pages is not.nav.jsandtheme.jsonly make the tabs remember and the theme switch work (above); everything else is links,<details>and one checkbox, and works with them blocked. The lab cannot draw a robot without a script, so it is the one page that needs one: an ES module and three.js, both served beside it, so the CSP holds. Without JavaScript the lab page is a plain page: the joints, their ranges and the poses, and the lessons that have tasks, each linking to the lesson where its tasks are written out. Styles are inline becausestyle-srcdoes permit'unsafe-inline'. The server sendsnosniff, so the files must keep arriving as JavaScript: nginx's own MIME types do that. - Two themes. Paper by day and blueprint by night, following the
reader's system setting through
prefers-color-schemeunless they pick one with the switch (above). Blueprint's colours are written once (DARK) and used for both. The accents are the three strokes of the 3VN mark. Headings use the system's serif and code its monospace, so no font is downloaded. The robot's drawing (ROBOT_ART) is inline SVG coloured by the stylesheet, so it follows the theme; a robot without one gets no picture. - noindex everywhere, plus
robots.txtwithDisallow: /, plus anX-Robots-Tagheader from nginx. One of the three may be ignored by a given crawler; all three being ignored is unlikely.
Public, but not yet indexed. Since 2026-11-15 the course and its repository are public and free. The noindex keeps an unfinished course out of search results until it is ready to be found; it hides nothing, and nothing on the site is secret.
Deploying it
The image is built and deployed from 3vn-infra, not from here:
Actions → Course site → Run workflow in that repo
(.github/workflows/robotics-course.yml), with a commit from this
repo's main (blank means the tip of main).
That run checks this repo out, takes the newest commit at or before the
one given that changed the site, and runs the same stages as every
other product: scan, build docker/Dockerfile.site, push
ghcr.io/narsi97/robotics-course-site:sha-<commit>, then deploy it to
the shared host, health-checked and rolled back if it isn't healthy. A
commit already in the registry is deployed as is, not rebuilt. Going
back is the same button with the previous good commit.
Why there: this repository is public, and GitHub lets a private repo's
reusable workflows be called only from private repos, so this repo
can't call 3vn-infra's pipeline. It also means nothing in this public
repo can reach a host. What runs here
(.github/workflows/course-site.yml) is the check on every PR and
merge that touches the site: make course-check, make site, and a
docker build of the image that is never pushed. No secrets, so fork
PRs are safe to run.
The service (robotics-course-site in 3vn-infra's
docker/compose.prod.yml) and its Caddy route live in 3vn-infra too.
What is NOT served
The simulation. Gazebo needs far more than this box has — 1 vCPU and
2 GB against a simulator that wants 6 GB and four cores — and
docs/learning-path.md is honest that the simulation runs on your own
machine. The site is the reading half of the course. The doing half
stays local, which is also where the robot is.
The lab is not an exception to that. It is static files, about 3.6 MB, and every bit of it runs in the reader's browser: the server only hands over a page, a script and some meshes. It is kinematic, not physical, and says so.
The lab
make site # fetches what the lab needs the first time, then builds it
make site-serve # http://localhost:8109/robotics-software-engineering/
The SO-101 in the browser, inspired by playgrounds like bambot.org but built from this project's own sources, so it teaches the same robot the lessons do. It is not a page off to one side: every lesson has its simulation inline, under "In the simulation", between the reasoning and the steps. The Lab tab is the same simulation with everything on, for free play.
The world grows with the course
Each stage file has a scene: block: the features its lessons'
simulations add, and a caption for lessons with nothing to tick off.
A stage keeps everything the stages before it showed:
| stage | adds |
|---|---|
| 1 Your environment | nothing: the arm, to turn and look at |
| 2 Describing a robot | sliders (and the named poses), frames, the states and tf views |
| 3 Making it move | teleop (keys and buttons), bench contact, record and replay |
| 4 Make it trustworthy | nothing new |
| 5 Make it real | the servo bus view |
| 6 Make it capable | a cube on the bench, an overhead camera and its picture, the dataset view |
A lesson can add more with lab: scene: [...]. make course-check
refuses a task that needs a feature its lesson's scene does not have
yet, so a stage-2 lesson cannot ask for the teleop. Stage 6's later
lessons are planned: their scene is real (the cube, the camera's
render, a recording as 30 fps episode rows you can download), and what
would need a trained model says it is planned rather than pretending.
A stage's finished scene
A stage's scene: can also name final: features, with a
final_caption: they show only in the stage's finished scene, never in
its lessons, nor on the Lab page, whose panels own the corners the
prompt sits in. That scene is the one under "In the simulation" on the
stage's own page, and on the front pages, where a card per stage under
the simulation swaps it in (lab.js loads a fresh copy of itself for
the new scene, and the old one stops and gives back its WebGL context).
Stage 6's is sort: two red and two blue blocks, a tray at each side,
and the stage's prompts, each a sentence plus the tray each colour
goes to. Close the jaw on a block and it rides with the tool; open it
and the block drops straight down, into a tray if it is over one. No
physics, as everywhere else.
The reader can sort them, or type a prompt and press Run: a scripted policy, labelled as one, does it. A parser that knows red, blue, all, the rest, left and right reads the prompt (and says what it read, or that it read nothing); the arm's own solver turns each point into joint angles, the jaw pointing down as far as the arm allows; and every move is a goal to the same trajectory controller the keys use, so each joint keeps its speed limit. A key, a slider or game mode takes the controls back and stops it. It is geometry, not learning: a policy trained from demonstrations is still a planned lesson.
The leader arm
The Lab page has a Leader panel beside Arm: a second Web Serial port for a leader arm, read only. It never turns a leader servo's torque on or sends it a goal. It has its own calibration, kept in the browser apart from the follower's (Record zero, then each joint's direction), and while it is connected the sim copies it through the controllers, at each joint's speed limit, and the Arm panel stops copying the follower into the sim. Arm the follower and it follows the sim, at that panel's slow cap: leader, sim, follower. Record captures a leader demonstration like any other. A leader built like the SO-101's uses the follower's servo ids and baud, which is what the panel assumes. Tested against simulated buses in the page, never a real leader.
In a lesson the block costs nothing until it is needed: lab.js is
small, and three.js and the meshes are fetched only when the block
nears the screen. It is inert until clicked into, so the wheel scrolls
the page and the keys type as usual while the reader reads; clicking
outside lets go.
What is in it:
- Upstream's meshes on upstream's joints.
scripts/build_lab.pyreadsvendor/so101/so101.urdffor links, origins, axes and position limits, and packs each STL into an indexed mesh with 16-bit positions: 16.1 MB of STL becomes 2.9 MB. - Limits, poses and calibration from the profile. Speed limits are
the datasheet derated, the same arithmetic as
describe.py, so a long move takes as long in the page as on the arm. The pose buttons are the profile'sposes. The servo ids, zero counts and directions are the profile'sjoints. - The keys of
make drive, and its rules, with its jog steps read out ofteleop.py: a jog adds to the last target, clamps at the limit and says so, the jaw moves in quarters between the profile's closed and open (not onto its hard stop), and a drive key says there is no base. All but Tab: in a page Tab moves focus, and taking it would trap a keyboard user in the view. The same teleop as buttons, for a touch screen or a mouse: − and + beside each joint's slider (the jaw's open and close it in quarters), a step control, and a base pad that says there is no base. They call the same functions as the keys and repeat while held, as a held key does, so every task can be done without a keyboard. A held key or a dragged slider keeps the arm moving, because each new goal is spliced onto the joint's position and speed, as the trajectory controller splices a new trajectory onto the current state. - Game mode (
G, or the Game button; on by default on the Lab page): the keys move the gripper through space instead of one joint at a time. ↑/↓ along X, ←/→ along Y, W/S along Z, the base frame's axes (REP-103: X forward, Y left, Z up), drawn as arrows on the jaw with their keys, and a line dropped to the bench. Q/E tilt and A/D roll the wrist, Space opens or closes the jaw, Shift goes faster. The joints follow by differential inverse kinematics: each frame, a numerical Jacobian of the tool's position and a damped least-squares solve, in steps of 1/60 s so a slow frame does not cut corners. It is velocity control, so letting go or leaving the window brakes. It starts from thereadypose: home is the arm at full stretch, where the tool cannot go straight up or out. The course's own solver,solve()inkinematics.py, is the Solve the arm lesson; this is a small local one. Its key guide is a keyboard drawn on the bench floor, keys lighting as they are held: drag it anywhere on the bench (it turns to face the camera), hide it withKor the Keys button, and it stays where it was left, per robot, in the browser's storage. - An inspector that prints what the real tools would:
ros2 topic echo /joint_states,tf2_echo base_link gripper_frame_link, and the 26-byte SYNC WRITE thatFeetechSystemInterfaceputs on the bus every cycle, built asfeetech_protocol.hppbuilds it. - Frames, a joint ring and the bench. Each joint's own axes; a ring round the selected joint's axis with an arrow the way positive turns; any link driven into the bench turns red.
- Record and replay of the arm's setpoints: the germ of a dataset.
The lab names no joint, limit or pose of its own. Change the profile or fetch a newer upstream, and it follows on the next build.
Lessons give it tasks
A lesson can carry a lab: block. Its page then shows a Try it in the
lab card, and lab.html?task=<lesson id> opens the lab with the
lesson's brief and a checklist the page ticks as the arm moves:
lab:
brief: >-
The keys of `make drive`, and its rules.
tasks:
- do: Press `1` to select `shoulder_pan`, then hold `.` until it will not go further.
check: {joint: shoulder_pan, at: upper}
- do: Press `h` to home the arm.
check: {did: home, pose: home}
Tasks are checked in order: only the current one can tick, so a
later task cannot finish itself because the arm happens to start where
it asks. Every key in a check must hold at the same moment, and a
did must happen while its task is the current one (a key pressed in
the second before the previous task ticked counts too). Once met, a task
stays met, and progress is kept in localStorage. The keys:
| key | holds when |
|---|---|
joint + at: upper / lower |
the joint is on that limit |
joint + above / below |
the joint is past that many radians |
pose |
the arm is in that named pose, and still |
tool |
x_above … z_below: the tool frame, in metres, in the base frame |
contact: true |
some part of the arm is into the bench |
step |
that teleop step size is selected |
view |
frames, states, tf or bus is open |
did |
home (the h key, or the pose button that sends the arm where h does), jog, no-base, record or replay has happened |
make course-check refuses a check it does not know, a joint or pose the
profile does not have, a step size the teleop does not have, a number
that is not one (YAML's true and .nan included), and, when the
description has been fetched, an above or below the joint can never
pass, so a task cannot ask for something the arm cannot do. Lab text is
lesson text: a Make target it names or a doc it links is checked like a
step's.
Every lesson has its own environment: all 46 carry a lab: block,
two to four tasks tied to what that lesson teaches. Where a lesson is
about software with no motion in it (Docker, CI, releases, deployment),
its tasks do the robot-side counterpart (what a test asserts, done by
hand and read back in the inspector; the motor gate as the limits the
arm will not pass) and its brief says what the browser does not show.
Stage 1 lessons add the features they need with lab: scene:; stage 6's
planned lessons use the cube, the camera, Game mode and the dataset
view, and say which part is planned. Every tool position a task asks for
was checked reachable by sweeping the arm's joint space with forward
kinematics, since make course-check checks names, not reach.
The code behind it
Some lessons are about code more than motion, so the lab has a Code tab. It shows two things, from the repository itself:
- A trace of what you just did. Jog a joint, send a pose, move the
jaw: the chain of the repository's code that would carry it on the real
stack, one span a layer, like a distributed trace. A jog runs
Teleop._on_jogand_send_arm, then the controller manager's config (enforce_command_limits) andarm_controller, thenFeetechSystemInterface::write,writeGoalsandencodeSyncWrite. Each span's note has the values the model computed written in (the target and whether it was clamped, the trajectory point, the 26 bytes), its snippet with real line numbers, and a link to the file on GitHub at the commit the site was built from. - The tests a lesson is about. The test's own code, beside a live verdict: the state it asserts, checked against the simulation as you move. A test suite people actually run shows the limits test; Tests that cannot lie shows the named-poses test and its planted partner that must fail.
course/traces.yaml holds it as data: traces (spans naming a file and
a symbol, and a note with {values}) and tests (a symbol and a check
in the lab's check syntax). Nothing is copied: the build extracts each
snippet by symbol (a Python function or Class.method via its syntax
tree, a C++ function with its comment block, a YAML key path), so the code
shown is the code that runs. make course-check fails if a symbol is
gone, a lesson's lab: code: names a trace or test that does not exist,
or a test's check needs a feature the lesson's simulation lacks. A lesson
opts in with lab: code: [jog, clamp-holds]; the Lab page shows every
trace. Nine lessons do today.
The page does not run this code (it runs a JavaScript model), and the
panel says so. Running the repository's pure-Python modules in the
browser (Pyodide, with kinematics.py computing the tool pose the tests
use) is the next step that would make part of it genuinely the same code.
Another robot
Nothing in the lab is the SO-101 by name. course/course.yaml's
robot: profile: names the robot profile it draws, and from that
profile and its description it takes everything else:
- What it needs: a profile like
so101_follower.yaml, with adescription: urdf:(STL meshes, named beside the URDF or aspackage://paths),arm:joints with base and tool frames, agripper:with open and closed, and namedposes:. - What it uses if present: a
joints:block with each servo's id, zero count and direction (the servo bus view; without it the view says there is none), theservos:datasheet andlimit_derate:(the speed limit; without them the URDF's), and an optionallab:block:start_pose(where Game mode starts; defaultready) anddirect_joints(the arm joints Q/E and A/D turn directly; default the last two on an arm of five or more, the last on an arm of four). - What it works out: the world is sized from the arm's own reach and forward direction at home, so the cube, the overhead camera, the key guide, the gizmo and Game mode's speeds fit any size of arm; Game mode's solve uses every arm joint not driven directly, however many.
Tried by building the site for a variant in a scratch copy: the SO-101's
description with its joints renamed, the wrist roll fixed (four arm
joints), package:// mesh paths, no servo block and a lab: block of
its own. It built, drew, started in its own pose, and moved its gripper
along each axis. A lesson's tasks name the course robot's joints and
poses, so they are checked against its profile: a course on another
robot writes its own.
A real arm, from the page
The Lab page has an Arm panel: connect a real SO-101's bus adapter
over USB, in Chrome or Edge on a computer (Web Serial; it needs HTTPS or
localhost). It speaks the same packets as the C++ driver
(scripts/lab/serial.js against feetech_protocol.hpp, byte for byte),
at the profile's baud, and is loaded only when the panel connects.
Lessons never show it.
Driving a motor from a page skips every layer the course builds between a command and a servo, so the page has its own gate, in the course's order:
- Connect is read only. The sim follows the arm; nothing is written.
- It drives only on a calibration measured in the page. The
profile's zero counts and directions are labelled assumed, and a wrong
direction drives a joint the wrong way the first time anything moves
(Find zero). With the arm limp: Record zero in the zero pose,
then each joint's ±? and a small move by hand the way its arrow
points. The numbers are kept in the browser, per robot, and printed as
the profile's
joints:lines, because measured numbers belong in the profile. - Arming is a typed word, MOVE, as the deploy gate is
DEPLOY. The first goal is where the arm already is, then torque on. The arm then follows the sim, every goal clamped to the URDF's limits and to 0.5 rad/s a joint, whatever the sim does. - Anything else holds. Esc, the Hold button, the tab hidden, the window losing focus, a servo silent for three cycles, or a servo more than 0.25 rad behind its goal for 0.6 s (blocked, or turning the wrong way): it stops following and holds where the arm is, torque on. Release torque is separate and takes two presses, because the arm falls when it goes limp.
Nothing in the page stops the arm hitting the bench or a person: it is a kinematic gate, not a collision check, and the panel says so before it arms. Tested headless against a simulated bus with a calibration unlike the profile's (read-only connect, arming refused uncalibrated, the calibration recovered, the first goal equal to the present counts, the speed cap, a jammed joint held, Esc, focus loss, the two-step release). No real servo has answered it yet.
What it is not
It is kinematic. Joints move towards their last target at no more than their derated speed limit, which is what a position-controlled servo does with nothing in its way. There is no gravity, no inertia, no load and no contact force: a link in the bench is coloured, not stopped. Every lesson card says so, and the steps under it are still the real thing.
How it is built and served
make site depends on a file each fetch leaves behind, and runs the
fetch when that file is missing or older than its script, so bumping a
pin (an edit to the script) is fetched on the next build.
scripts/fetch_so101.sh pins one upstream commit, checks the URDF's
checksum, and moves the URDF into place only after every mesh it names,
so a fetch cut off part-way leaves nothing that looks finished.
scripts/fetch_lab.sh pins three.js r170 and checks the checksum of
each file it takes, and records the release it fetched, so a changed
version is downloaded and checked rather than skipped. The build
rewrites the orbit controls' from 'three' to a relative path, because
an import map is an inline script and the CSP refuses it. The site image
runs both fetches in its build stage.
Served compressed and cached. The site image's nginx gzips text,
JSON and the meshes (the first simulation is 3.7 MB raw, about 2.1 MB on
the wire) and lets browsers keep lab/ for a week. That is safe only
because every URL into lab/ carries ?v=, a hash of the lab's files
computed by the build: change anything and every URL changes, so a
learner never mixes new pages with last week's script. Pages themselves
are revalidated on each visit, as before. Nothing else is needed from
the server: the simulation runs in the learner's browser.
Licences travel with the files. lab/three/ has three.js's own MIT
LICENSE beside the code, and a NOTICE. lab/meshes/ has the Apache
License 2.0 (the project's own LICENSE is that text) and a NOTICE that
quotes upstream's and says what was changed for the browser: repacked,
quantised, nothing else.
A checkout that has not fetched them still builds: the lab page says
what is missing (every mesh, not only the URDF) and how to get it, and
nothing else on the site changes. A mesh that is there but cut short is
reported the same way rather than crashing the build. That is what the
course job in .github/workflows/ci.yml builds, since it runs the
builder without fetching; the course-site workflow runs make site,
which fetches, and builds the whole lab.
Normals are computed in the browser, creased at 30° so printed parts
keep their edges. three.js has a function for that, toCreasedNormals,
and it took 50 s on these meshes, measured: CAD exports fan dozens of
thin triangles round one vertex. The lab's own version, over typed
arrays and a vertex-to-face index, takes 0.4 s.
The lab's debugger
The Code panel is on every simulation whose arm can be moved: the home
and stage pages, the lessons and the Lab page. After a jog, home, pose or
jaw command it shows the path that command takes through the repository
(course/traces.yaml). Step through it walks that path: the line
halted on, the variables set so far in that function, and the functions
before and after. With Debug: pause before the arm moves ticked, the
command is held until the walk reaches its end or Continue is pressed.
While held, nothing changes, the arm's targets included, so a real arm
that follows the sim is not sent it either. Anything else that moves the
arm (a slider, a replay, game mode, a leader arm) drops the held command.
It is a walk along the path with the model's values, not a debugger attached to running code, and the panel says so. Only those four actions are traced: sliders, game mode, record and replay, and the sorting prompt are not.
Each span lists its stops: at (text on exactly one line of the
snippet, or make course-check fails), vars (what the code's variables
hold once the line has run) and when: clamped for a branch only taken
then.
Build guides: wiring and assembly
A robot can carry a wiring and assembly guide,
course/assembly/<profile>.yaml, named after the course robot's profile.
The builder (scripts/build_assembly.py) makes build.html (status,
steps, parts, wiring) and one build-<step>.html per step, and links
them from the course map. A robot without the file has no such pages.
Nothing in the schema is about one arm.
| Key | What it holds |
|---|---|
parts |
id, name, kind (printed, servo, fastener, electronic, cable, tool), qty; optional file, model, notes, ports. Each servo is its own part, with bus_id and joint |
ports |
id, kind (power, data, bus, signal); a power source states volts, an input accepts: [lowest, highest] |
connections |
from and to as part.port, and the cable part used |
steps |
id, group (prepare, assemble, wire, calibrate), title, summary, do, check, uses, tools, connects, sets_ids, fits, unclear, warnings, source, verified |
questions |
what nobody may guess: title, detail, settled_by |
make course-check refuses the file when:
- an entry has a key the schema does not know, which also catches a value with a comma left unquoted inside braces;
- the parts list and the steps disagree on any quantity, or a cable count disagrees with the wiring;
- a port holds two wires, a wire joins two kinds of port, or no step makes a connection;
- the servo bus has a gap or a branch, two servos share an id, or an id disagrees with the robot's profile;
- a servo on a bus is fitted before a step sets its id;
- a supply gives a voltage the controller, or a servo further down the bus, does not accept;
- a step that needs power is not on hold while the voltage is unresolved, or a step on hold carries anything to follow;
- a step says
verified: builtwithout a dated note from whoever built it.
It then runs scripts/test_assembly.py, which breaks the real file one
way at a time and expects each break to be refused.
On hold. An unanswered question goes in questions, with
volts: unresolved or accepts: unresolved on the ports it affects. A
step that depends on it takes hold: <question> and is published with the
question and no instructions. To settle it, put in the numbers, delete the
question, and write the held steps.
The wiring diagram shows what connects to what. It is not an electrical simulation and does not show cable routing, and the page says so.