Step 1: python-can virtual bus, send and receive
Humanoid actuator diagnostics simulator
open board →Explain out loud: what is a slice header and why can append surprise you?
Types, slices, maps, interfaces, errors
Concept
A slice is a view (pointer, length, capacity) over an array; appending may reallocate. Maps are reference types and not safe for concurrent writes. Interfaces are satisfied implicitly. Errors are values: return them, wrap with `fmt.Errorf("...: %w", err)`, inspect with errors.Is / errors.As.
Why it matters in robotics: Fleet services ingest messy telemetry. Clear error values beat panics when one robot sends a bad payload.
Exercise · 55 min
Write `ParseTelemetry(line string) (Reading, error)` for lines like `robot7,knee_l,71.2,3.4`. Return distinct, wrapped errors for wrong field count, bad number, and unknown joint. Write a table-driven test with at least 6 cases.
Quiz
Q1. s := make([]int, 3, 3); t := append(s, 4). Do s and t share memory?
Q2. What does %w do in fmt.Errorf?
Q3. How does a type satisfy an interface in Go?