I had not touched unicycle kinematics since a robotics elective years ago and the muscle memory was not there.
Start by clarifying the problem constraints and assumptions, then outline a modular design with separate components for agent state, motion model, collision detection, and simulation loop. Explain the forward Euler integration and collision check per timestep, and discuss how to efficiently detect overlaps and handle edge cases.
Pro tip: Mention that collision detection can be optimized using spatial partitioning (e.g., uniform grid or sweep-and-prune) to avoid O(n²) checks, and that you would validate the simulation with simple test cases like two agents on a collision course.
Ask about agent count, speed/turn rate ranges, collision shape (circle vs. point), timestep size, and simulation horizon. Confirm whether agents can have different speeds and turn rates.
Define state as (x, y, theta) and update using unicycle model: x += v*cos(theta)*dt, y += v*sin(theta)*dt, theta += omega*dt. Note that forward Euler is first-order accurate.
For each timestep, check pairwise distances between agents. If distance < 2*radius (for circular agents), report collision. Use spatial partitioning if many agents.
Iterate timesteps up to horizon. At each step, update all agents, then check collisions. Return the first timestep with collision, or 'no collision' if none.
Talk about accuracy vs. timestep size, O(n²) vs. spatial partitioning, and handling of simultaneous collisions or agents starting in collision.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.