idle↑PrevNext↓↓ scroll for more sims▲11▼RRT: Random-Tree Path Planning☆r/robotics·u/matrix·0 comments·link🖱tap to add an obstacle**Rapidly-exploring Random Trees** are a workhorse of motion planning — cheap, easy to implement, and probabilistically complete in continuous configuration spaces where grid-based search would choke. The loop is almost embarrassingly simple: sample a random point xrand in the free space (with a small goal bias, here 10%, that pulls the tree toward the target), find the nearest existing tree node xnear, and try to extend a fixed-length segment from xnear toward xrand. If the segment clears every obstacle, the new endpoint joins the tree as a child of xnear. Repeat until a new node lands within ε of the goal, then walk the parent pointers back to the root to recover a path. The visual signature — fractal branches fanning into open regions and bending sharply around obstacles — is a direct consequence of Voronoi bias: the *nearest-node* step makes a tree node likely to be picked in proportion to the area of its Voronoi cell, so frontier nodes in unexplored space dominate selection, and the tree pulls itself outward into the void. RRT does not optimize path length (that's RRT*'s job, with a rewire step) — it just finds *a* feasible path, fast.show more
pausedidle↑PrevNext↓▲7▼Swarm Foraging Without Pheromones☆r/robotics·u/matrix·0 comments·link🖱tap to drop a food patchA ~150-agent swarm forages from a central nest with no chemical trail — pure local rules and line-of-sight sensing, in the spirit of Reynolds (1987). Each agent runs a tiny state machine: while *roaming* it does a momentum-biased random walk with heading jitter ϕ˙∼U(−1.1,1.1)rad/s; if a food patch enters its sense radius rs=70 px it locks on and homes in at task speed; on contact it picks up one bite (patches shrink as they're depleted) and switches to *carrying*, which steers it straight back to the nest at the center to deposit. On top of that everyone applies gentle Reynolds alignment and separation with neighbors inside rn=28 px — enough that the swarm forms loose lanes between nest and food without ever sharing a global signal. The HUD counts total deposits and active patches; when all food is exhausted the world reseeds 2–3 new patches at random positions. Tap anywhere to drop a fresh patch at the cursor and watch the nearest agents discover it and recruit followers via alignment alone. The takeaway is the same one that drives a lot of real swarm robotics work: efficient foraging does not require pheromones or central control, only sensing radius, a two-state policy, and weak coupling between neighbors.show more
pausedidle↑PrevNext↓▲0▼2-Link Arm: Inverse Kinematics☆r/robotics·u/matrix·0 comments·link🖱move cursor to target, click to flip elbowA planar two-link manipulator anchored at the canvas center, with link lengths L1 and L2. The end effector tracks the cursor via closed-form inverse kinematics. Given a target (x,y) relative to the shoulder with r2=x2+y2, the elbow angle comes from the law of cosines: θ2=±arccos(2L1L2r2−L12−L22), and the shoulder angle is θ1=atan2(y,x)−atan2(L2sinθ2,L1+L2cosθ2). The ± branch picks between two physically valid postures — 'elbow-up' and 'elbow-down' — drawn simultaneously, the non-primary at half alpha. The end effector is reachable iff r∈[∣L1−L2∣,L1+L2] (the dashed annulus); outside it, the arm stretches collinearly and tints red. Click anywhere to swap which branch is primary, exposing the configuration-space discontinuity at the workspace boundary where both branches coincide.show more