A shopping cart looks mechanically simple, yet its four swivel casters expose nearly every important idea in planar rigid-body kinematics. The frame can translate, rotate, or do both at once. Each wheel occupies a different point on that frame, so each wheel generally sees a different velocity and must choose its own steering direction and rolling speed.
This makes the shopping-cart model one of the most useful generalizations for planar robotic platforms. It begins with the motion of the rigid platform rather than with a particular drive layout; differential-drive, Ackermann-steered, independently steered, and omnidirectional platforms then emerge by imposing their specific wheel constraints on the same velocity field.
The central question is therefore not merely how fast the cart moves. It is how one motion of the rigid frame becomes four local wheel motions. The answer follows from the velocity field of a rigid body and requires only a coordinate frame, a rotation, and a derivative.
Pose of the Cart
Motion takes place in a fixed world frame \(W\). Attach a body frame \(B\) to the cart at a reference point \(G\), usually its geometric center. The world position of \(G\) is the vector
\[ \mathbf p= \begin{pmatrix}x\\y\end{pmatrix}, \]
and the body heading is \(\theta\). Together, \((x,y,\theta)\) describe the planar pose. A point fixed to the body has constant body coordinates
\[ \mathbf r_i= \begin{pmatrix}r_{i,x}\\r_{i,y}\end{pmatrix}. \]
Its world position is
\[ \boxed{\mathbf p_i=\mathbf p+R(\theta)\mathbf r_i}, \qquad R(\theta)= \begin{pmatrix} \cos\theta & -\sin\theta\\ \sin\theta & \cos\theta \end{pmatrix}. \]
The rotation matrix changes only the coordinates used to describe the offset. The vector \(\mathbf r_i\) does not stretch or bend, which is precisely the rigid-body assumption.
The world frame locates the cart center G. The body-frame vector r_i locates a wheel point P_i relative to G.
How Rotation Moves a Point
Translation gives every point the same velocity \(\dot{\mathbf p}\). Rotation is different: a point farther from \(G\) sweeps a larger circle and therefore moves faster. This can be made exact by differentiating the position equation.
Introduce the quarter-turn matrix
\[ J= \begin{pmatrix}0 & -1\\1 & 0\end{pmatrix}. \]
Multiplying by \(J\) rotates a vector counterclockwise by \(90^\circ\): \(J(a,b)^\mathsf T=(-b,a)^\mathsf T\). Direct differentiation gives
\[ \frac{dR}{d\theta}=R(\theta)J=JR(\theta). \]
Because \(\mathbf r_i\) is fixed in the body frame, the time derivative of its world position is
\[ \begin{aligned} \mathbf v_i =\dot{\mathbf p}_i &=\dot{\mathbf p}+\dot\theta R(\theta)J\mathbf r_i\\ &=\mathbf v_G+\omega J\boldsymbol\rho_i, \end{aligned} \]
where \(\omega=\dot\theta\) and \(\boldsymbol\rho_i=R(\theta)\mathbf r_i\) is the wheel offset in world coordinates. Thus the planar rigid-body velocity field is
\[ \boxed{\mathbf v_i=\mathbf v_G+\omega J\boldsymbol\rho_i}. \]
The two terms have distinct meanings. The first carries the whole cart in one direction. The second is tangent to the circle centered at \(G\), because \(J\boldsymbol\rho_i\) is perpendicular to \(\boldsymbol\rho_i\). Its magnitude is \(|\omega|\lVert\boldsymbol\rho_i\rVert\), so distance from the center converts angular speed into linear speed.
A wheel-point velocity is the vector sum of the center translation and the local tangential velocity caused by rotation.
The Instantaneous Center of Rotation
Suppose \(\omega\ne0\). There is exactly one point \(C\) in the plane whose instantaneous velocity is zero. Substituting that condition into the velocity field gives
\[ \mathbf 0=\mathbf v_G+\omega J(\mathbf p_C-\mathbf p). \]
Since \(J^{-1}=-J\), solving for the point yields
\[ \boxed{\mathbf p_C=\mathbf p+\frac{1}{\omega}J\mathbf v_G}. \]
This point is the instantaneous center of rotation (ICR). At that instant, every body point moves perpendicular to the line joining it to \(C\), exactly as if the complete cart were rotating about \(C\). For example, if \(\mathbf v_G=(1,0)^\mathsf T\) and \(\omega=1\), then \(J\mathbf v_G=(0,1)^\mathsf T\): the ICR lies one unit above \(G\), and counterclockwise rotation about it moves \(G\) to the right.
As \(\omega\) approaches zero, the ICR recedes without bound. Pure translation can therefore be understood as rotation about a point at infinity, but the velocity-field equation remains the numerically useful model.
At one instant, all wheel velocities are tangent to circles centered at the ICR. Their directions differ because the wheel centers lie on different radial lines.
Expressing the Motion in Body Coordinates
Wheel locations are normally measured in the body frame, so it is convenient to express the translational velocity there as
\[ \mathbf v_B=R(\theta)^\mathsf T\mathbf v_G =\begin{pmatrix}v_x\\v_y\end{pmatrix}. \]
Rotation commutes with \(J\) in the plane. The velocity at wheel \(i\), now entirely in body coordinates, becomes
\[ \boxed{ \mathbf v_i^B= \begin{pmatrix} v_x-\omega r_{i,y}\\ v_y+\omega r_{i,x} \end{pmatrix}}. \]
The triple \(\boldsymbol\xi=(v_x,v_y,\omega)^\mathsf T\) is the body twist. It describes every instantaneous planar motion of the frame. Once this three-number command is known, all wheel commands follow independently.
Rolling Without Side Slip
Let a wheel point along the unit vector
\[ \mathbf t_i= \begin{pmatrix}\cos\alpha_i\\\sin\alpha_i\end{pmatrix}, \]
and let its lateral direction be
\[ \mathbf n_i=J\mathbf t_i =\begin{pmatrix}-\sin\alpha_i\\\cos\alpha_i\end{pmatrix}. \]
An ideal wheel can roll along \(\mathbf t_i\), but it cannot move sideways along \(\mathbf n_i\). The no-side-slip condition is therefore
\[ \boxed{\mathbf n_i^\mathsf T\mathbf v_i^B=0}. \]
A freely swiveling caster satisfies this constraint by aligning its wheel plane with the local velocity. When \(\lVert\mathbf v_i^B\rVert>0\), its steering angle is
\[ \boxed{\alpha_i=\operatorname{atan2} \left(v_y+\omega r_{i,x},\;v_x-\omega r_{i,y}\right)}. \]
The signed rolling speed is the projection onto the wheel direction,
\[ u_i=\mathbf t_i^\mathsf T\mathbf v_i^B, \]
and a wheel of radius \(R_i\) needs spin rate
\[ \boxed{\dot\varphi_i=\frac{u_i}{R_i}}. \]
The caster turns until its rolling direction t_i follows the local velocity. The no-slip model forbids any component along the lateral normal n_i.
Four Wheels, One Twist
Consider a rectangular cart with half-length \(a\) and half-width \(b\). In body coordinates, the four wheel locations are
\[ \mathbf r_1=(a,b)^\mathsf T,\quad \mathbf r_2=(a,-b)^\mathsf T,\quad \mathbf r_3=(-a,b)^\mathsf T,\quad \mathbf r_4=(-a,-b)^\mathsf T. \]
For the wheel at \((r_{i,x},r_{i,y})\), compute
\[ w_{i,x}=v_x-\omega r_{i,y}, \qquad w_{i,y}=v_y+\omega r_{i,x}. \]
Then the complete inverse-kinematics map is
\[ \boxed{ \alpha_i=\operatorname{atan2}(w_{i,y},w_{i,x}), \qquad \dot\varphi_i=\frac{\sqrt{w_{i,x}^2+w_{i,y}^2}}{R_i}} }. \]
This map is local but not independent in a physical sense: all four results come from the same three-component twist. Arbitrary wheel angles and speeds generally contradict one another and would require one or more wheels to slip.
Equivalent Wheel Directions
A wheel line has no intrinsic forward end. The pair \((\alpha_i,u_i)\) produces exactly the same contact-point velocity as
\[ (\alpha_i+\pi,-u_i). \]
An actively steered module can exploit this equivalence. Given its previous steering angle \(\alpha_{i,0}\), compare the wrapped changes
\[ \Delta_0=\operatorname{wrap}(\alpha_i-\alpha_{i,0}), \qquad \Delta_1=\operatorname{wrap}(\alpha_i+\pi-\alpha_{i,0}). \]
Choose the candidate with the smaller absolute change and reverse \(u_i\) when the second candidate wins. This avoids unnecessary half-turns and is often called steering optimization or shortest-path steering. It applies directly when the wheel is centered on its steering axis. A trailing caster is directional: after a reversal, it must swivel continuously toward the new velocity direction rather than switching between the two equivalent wheel lines instantaneously.
Important Special Motions
Pure translation
If \(\omega=0\), every wheel receives the same velocity \((v_x,v_y)^\mathsf T\). All casters become parallel and spin at the same linear speed when their radii are equal. Sideways translation is kinematically possible for swivel casters, even though real casters require time and force to turn into the new direction.
Pure rotation
If \(v_x=v_y=0\), then \(G\) is the ICR and \(\mathbf v_i^B=\omega J\mathbf r_i\). Every wheel points tangent to a circle centered at \(G\), and its speed is \(|\omega|\lVert\mathbf r_i\rVert\).
A wheel on the ICR
If a wheel center coincides with the ICR, its local velocity is zero. Its rolling speed is zero and \(\operatorname{atan2}(0,0)\) has no defined angle. A controller must retain the previous steering angle or choose another documented convention.
Near-zero velocity
Very small velocity components make the computed steering direction sensitive to noise. In practice, preserve the previous angle whenever \(\lVert\mathbf v_i^B\rVert<\varepsilon\), with \(\varepsilon\) chosen from encoder resolution and expected disturbance levels. This deadband removes chatter without changing the model away from rest.
Recovering the Cart Motion from the Wheels
The inverse problem maps a body twist to wheel states. The forward problem asks whether measured wheel states describe one consistent rigid-body motion. For each wheel,
\[ \begin{pmatrix}v_{i,x}\\v_{i,y}\end{pmatrix} = \underbrace{ \begin{pmatrix} 1 & 0 & -r_{i,y}\\ 0 & 1 & r_{i,x} \end{pmatrix}}_{B_i} \begin{pmatrix}v_x\\v_y\\\omega\end{pmatrix}. \]
If steering angle and signed rolling speed are known, the measured wheel velocity is \(\widehat{\mathbf v}_i=u_i\mathbf t_i\). Stack all \(B_i\) matrices into \(B\) and all measured wheel velocities into \(\widehat{\mathbf v}\). With more than two wheels the system is overdetermined, so the least-squares estimate is
\[ \boxed{ \widehat{\boldsymbol\xi} =(B^\mathsf TB)^{-1}B^\mathsf T\widehat{\mathbf v} }. \]
The residual \(\lVert B\widehat{\boldsymbol\xi}-\widehat{\mathbf v}\rVert\) measures inconsistency caused by slip, wheel deformation, steering error, or sensor noise. In software, solve the least-squares system with a QR or singular-value decomposition rather than forming the inverse explicitly.
Updating the Pose
A body-frame twist must be rotated into the world frame before updating position:
\[ \dot{\mathbf p}=R(\theta) \begin{pmatrix}v_x\\v_y\end{pmatrix}, \qquad \dot\theta=\omega. \]
For a twist held constant over a time step \(\Delta t\), exact integration avoids the drift introduced by an Euler step. Let \(\psi=\omega\Delta t\). For \(\omega\ne0\),
\[ \mathbf p_{k+1}=\mathbf p_k+R(\theta_k) \begin{pmatrix} \dfrac{\sin\psi}{\omega} & -\dfrac{1-\cos\psi}{\omega}\\ \dfrac{1-\cos\psi}{\omega} & \dfrac{\sin\psi}{\omega} \end{pmatrix} \begin{pmatrix}v_x\\v_y\end{pmatrix}, \]
\[ \theta_{k+1}=\theta_k+\psi. \]
At \(\omega=0\), use the continuous limit \(\mathbf p_{k+1}=\mathbf p_k+R(\theta_k)(v_x,v_y)^\mathsf T\Delta t\). A small- \(\omega\) branch or stable sinc-based implementation prevents cancellation in floating-point arithmetic.
Implementation Recipe
for each wheel i:
wx = vx - omega * ry[i]
wy = vy + omega * rx[i]
speed = hypot(wx, wy)
if speed > epsilon:
candidate = atan2(wy, wx)
targetAlpha, direction = wheelTarget(candidate, alpha[i], centeredOnAxis)
turn = wrap(targetAlpha - alpha[i])
alpha[i] += clamp(turn, -maxCasterRate * dt, maxCasterRate * dt)
wheelRate[i] = direction * speed / radius[i]
else:
wheelRate[i] = 0 The order matters: compute the rigid-body velocity at the wheel center, resolve the stationary singularity, choose the steering target, rate-limit the physical swivel motion, and only then convert linear speed to wheel spin. In the interactive implementation, centerWheelsOnSwivelAxis selects the two models. Its default value is false, which draws trailing casters and lets them rotate toward a reversed velocity. Setting it to true centers each wheel on the swivel axis and permits the same wheel line to roll forward or backward without a 180-degree steering movement.
Interactive Cart
The cart above can be pushed with a mouse or touch gesture. The pointer keeps pulling it toward the marked target, while keyboard inputs add to that motion: the arrow keys or WASD contribute forward force and rotation, and Q or E contribute lateral force. Turning dissipates some translational momentum instead of replacing the current movement. Watch the four casters during a combined translation and turn. Each one follows its own local velocity even though all four velocities come from one body twist. Once the cart settles inside the velocity deadband, the casters retain their last direction until the next impulse gives them a new velocity to follow.
What the Ideal Model Leaves Out
A real shopping-cart caster has trail: its wheel contact point lies behind the swivel axis. Ground forces acting through that offset create the torque that aligns the wheel. Alignment therefore takes time and can oscillate, especially at speed. Bearing friction, finite wheel width, tire compliance, load distribution, floor roughness, and caster flutter are also absent from the ideal equations.
Those effects belong to dynamics because they require forces, masses, moments of inertia, and constitutive models. The kinematic model answers a narrower and very useful question: if the frame has a specified instantaneous motion and rolling is ideal, what direction and speed must every wheel have? Within that scope, the velocity field, wheel constraint, singular cases, and consistency test form a complete model.