Flow matching for joint-position actions

AngularFM

Flow Matching on Joint Circles
for Robot Manipulation

Revolute-joint angles are phases on a circle. AngularFM generates robot actions there: the network reads phases, predicts one angular velocity per joint, and every sampling step is a rotation that keeps the state on the circle.

Noise sampled around the current joint angles rotates into an action chunk. Every intermediate state stays on the joint circles.

RoboTwin 2.0

94.7%

average success over 50 bimanual tasks, clean and randomized scenes

LIBERO

98.2%

average success over four suites

Rotation-sensitive suite

74.6%

controlled comparison: sine–cosine 71.2%, raw scalar 64.1%

Real world

47/ 60

successful trials on a Franka FR3 and an AgileX Cobot Magic

00 Abstract

Many robot policies, including vision-language-action models and world action models, generate actions using diffusion or flow matching. For a fixed robot, generating joint-position targets avoids inverse kinematics. Revolute-joint angles can be represented on the unit circle \(\mathbb{S}^1\), motivating three design criteria: continuous representations, consistency with circular geometry, and manifold-preserving generation. The raw scalar representation cuts the circle open and maps it to an interval on the real line, introducing a discontinuity and distorting angular distances. The sine–cosine representation restores continuity, but unconstrained Euclidean flow matching can produce off-manifold predictions that decode to incorrect joint angles. We therefore propose AngularFM, a flow matching method that represents each joint angle as a phase on \(\mathbb{S}^1\) and learns an angular velocity field over flow time to generate joint-position targets. Starting from noise sampled around the current joint angles, AngularFM evolves each phase along its circle, satisfying all three design criteria by construction. We introduce a suite of rotation-sensitive manipulation tasks and show that AngularFM improves the overall success rate. It also achieves high success rates on LIBERO and RoboTwin 2.0 and outperforms baselines on six real-world tasks using Franka and AgileX robots.

01 Motivation

A joint angle is a point on a circle. Where should a policy generate it?

Diffusion and flow matching are increasingly used to generate robot actions, and for a fixed robot, generating joint-position targets directly avoids the inverse-kinematics step. For a revolute joint, angles that differ by \(2\pi\) share the same rotational phase, and these phases are naturally represented on the unit circle \(\mathbb{S}^1\). This circular structure should guide both how joint angles are encoded and how they are generated, which leads to three design criteria.

CRITERION 1Continuous representations

The encoding varies continuously with rotation. Turning a joint a little never makes its code jump.

CRITERION 2Consistency with circular geometry

Equivalent angles share one code, and phases that are close on the circle stay close in the representation.

CRITERION 3Manifold-preserving generation

While a sample evolves from noise into an action target, it stays on the circle at every step.

ARaw scalar + Euclidean flow matching

Cut the circle open, and neighbours end up far apart.

The raw scalar representation treats a joint angle as a number on the real line. Wrapping it into a fixed interval gives every phase a single label, at the price of a seam: where the interval closes, the label jumps by a full turn. Two phases on either side of the seam are close on the circle yet far apart numerically, so the distance between labels no longer reflects circular proximity.

  • Discontinuous at angular wraparound
  • Inconsistent with circular proximity
Distance on the circle 0.50rad
Distance on the line 0.50rad
Drag p or q on the circle
BSine–cosine + Euclidean flow matching

A continuous code, but nothing keeps the sample on the circle.

Encoding the angle as \((\cos q, \sin q)\) removes the seam and respects circular distances. Euclidean flow matching, however, denoises in the whole plane. It starts from Gaussian noise \(\mathbf{x}_0 \sim \mathcal{N}(0, I_2)\) and follows straight lines \(\mathbf{x}_s = (1-s)\,\mathbf{x}_0 + s\,\mathbf{z}_1\) towards the target phase \(\mathbf{z}_1\).

Neither the source nor the paths are confined to the circle, and after finite-step sampling the generated endpoint can remain off it. Joint angles then have to be recovered with \(\operatorname{atan2}\), which can amplify the prediction error, the more so the closer the endpoint lies to the origin.

  • Continuous phase representation
  • Unconstrained, off-manifold state

Generation in the plane 26 samples of one joint target

Endpoints off the circle26 / 26
Mean angle error–
Largest–

Decoding with atan2 drag the endpoint

atan2 returns the direction of the endpoint as seen from the origin and discards its distance. The closer the endpoint lies to the origin, the more a small shift changes the decoded angle.

Distance from the origin–
Decoded angle error–

Schematic illustrations. In “Generation in the plane”, every sample moves with its ideal straight-line velocity plus a fixed error of the chosen size. In “Decoding with atan2”, the endpoint of one sample is placed at different positions.

CAngularFM on \(\mathbb{S}^1\)

Generate on the circle: rotate from the current state to the target.

AngularFM keeps the sine–cosine phase as the network input but replaces the two unconstrained planar velocity components with one angular velocity per joint and future step. Noise is sampled around the current joint angle, training paths follow the shortest arc to the target, and sampling integrates the predicted angular velocities as rotations. Source, intermediate states and endpoint all lie on the circle, with no projection.

  • Continuous phase representation
  • Shortest-arc flow paths
  • Manifold-preserving generation
Source spread (rad) 0.71
Mean arc length (rad) –
On the circle at every step: source, intermediate states, endpoint 12 / 12
Drag the current angle around the circle
The three formulations against the three criteria. Raw scalar generation runs on the real line rather than on the circle, so the third criterion is not assessed for it.
Formulation Continuous
represen­tations
Consistency with
circular geometry
Manifold-preserving
generation
Raw scalarangle as a number on the real line
Sine–cosinewith Euclidean flow matching in the plane
AngularFMphases in, angular velocities out

02 Method

One angular velocity per joint, integrated as a rotation.

AngularFM places the source distribution, the training paths and the sampler on the joint circles, and restricts the learned velocity field to their tangent directions. Four pieces make this work.

01

Phase in, angular velocity out

Each joint angle enters the network as a phase \({\mathbf{z} = (\cos q, \sin q)}\). A planar velocity splits into a radial part \(\alpha\,\mathbf{z}\) and a tangential part \(\omega K\mathbf{z}\), where \(K\) rotates a planar vector counterclockwise by \(\pi/2\). Staying on the unit circle removes the radial part, so the network predicts a single angular velocity for every joint and future step, \(\boldsymbol{\omega}_\theta(\mathbf{Z}_s, s, o) \in \mathbb{R}^{H \times n}\).

\[\mathbf{v} = \alpha\,\mathbf{z} + \omega K\mathbf{z},\quad \alpha = 0 \;\Rightarrow\; \dot{q} = \omega\]

02

State-anchored source

Generation starts from noise around the measured joint angles instead of a uniform distribution on the circle. All future steps of a joint share its current phase as the centre and keep independent perturbations; \(\kappa\) sets the precision of the angular noise.

\[q_0^{h,i} = q_{\mathrm{cur}}^{i} + \epsilon^{h,i},\quad \epsilon^{h,i} \sim \mathcal{N}(0, \kappa^{-1})\]

03

Shortest-arc training paths

Source and target phases are connected along the shortest arc between them. The signed length \(\Delta\) of that arc is the constant angular velocity of the path, and the network regresses it directly. Below, \({\mathbf{u}(q) = (\cos q, \sin q)}\) and \(\operatorname{ang}\) is the signed shortest angular displacement between two phases.

\[\begin{aligned}\Delta &= \operatorname{ang}\!\big(\mathbf{u}(q_0), \mathbf{u}(q_1)\big)\\[2pt] \mathbf{z}_s &= \mathbf{u}(q_0 + s\Delta)\\[2pt] \mathcal{L} &= \mathbb{E}\big[\,w(s)\,\lVert \boldsymbol{\omega}_\theta(\mathbf{Z}_s, s, o) - \boldsymbol{\Delta} \rVert_F^2\,\big]\end{aligned}\]

04

Rotation sampling and phase lifting

Every sampling step rotates the phase by \(\Delta s_k\,\omega_k\), the predicted angular velocity times the step size. Rotations preserve the unit norm, so no projection is needed. The generated phases are then lifted, step by step, to the nearest real-valued joint targets, which keeps the chunk continuous for the controller.

\[\begin{aligned}\hat{q}_{s_{k+1}} &= \hat{q}_{s_k} + \Delta s_k\,\omega_k\\[2pt] \bar{q}^{\,h} &= \bar{q}^{\,h-1} + \operatorname{ang}\!\big(\mathbf{u}(\bar{q}^{\,h-1}), \mathbf{u}(\hat{q}_1^{\,h})\big)\end{aligned}\]

Linear components stay Euclidean. Gripper commands and other linear action components keep standard Euclidean flow matching; the network models all joints and future steps jointly.

Built on Fast-WAM-Joint. A Wan2.2-5B backbone with a 1B-parameter action expert. Each chunk holds \(H = 32\) actions and is generated with \(N = 10\) sampling steps.

03 Results

Strong on standard benchmarks, and ahead where joints rotate the most.

We evaluate on LIBERO and the full RoboTwin 2.0 benchmark, isolate the effect of the joint-angle formulation on a rotation-sensitive task suite, and ablate the source distribution.

RoboTwin 2.0

Fifty bimanual tasks under clean and randomized conditions. AngularFM reaches 95.20% and 94.24%, the highest among the listed methods in both, with an average 2.5 points above LingBot-VA and 4.1 points above its Fast-WAM-Joint base.

Reported success rates in percent. The axis starts at 50.

LIBERO

Four suites with forty tasks in total. AngularFM averages 98.2%, within 0.3 points of the highest reported average.

Reported success rates in percent. The axis starts at 50.

Where the formulation matters: task subsets of RoboTwin 2.0

Sine–cosine with Euclidean flow matching lifts the seven rotation-sensitive tasks from 82.6% to 86.4%, yet falls 7.7 points below the raw scalar model on the complementary 43 tasks. A continuous representation helps, but it is not sufficient when generation is left unconstrained. AngularFM achieves the highest success on both subsets.

Controlled comparison on the rotation-sensitive suite

All three formulations are trained only on the seven-task suite (2,800 demonstrations) with the same backbone, demonstrations, training budget and execution settings. AngularFM has the highest mean on every scene set: 74.6% overall, against 71.2% for sine–cosine and 64.1% for raw scalar.

Mean over three training seeds; whiskers show the sample standard deviation. Overall: nine seed and scene-set evaluations, 1,260 rollouts per method.

Anchoring the source at the current state

With the architecture and the rotation-based sampler unchanged, replacing a uniform source on the circle by the state-anchored one at \(\kappa = 0.5\) raises success from 60.7% to 66.0%. Concentrating the source further reaches 76.2% at \(\kappa = 4\).

Success rate on the rotation-sensitive suite. CMAE: circular mean absolute error on validation windows, in radians.

04 Real-world experiments

Six rotation-sensitive tasks on two robots.

We run AngularFM on a single-arm Franka FR3 and a dual-arm AgileX Cobot Magic. The tasks involve object reorientation, orientation alignment during placement and coordinated bimanual rotation. AngularFM succeeds in 47 of 60 trials (78.3%), compared with 42 for \(\pi_{0.5}\), 38 for the raw scalar model and 32 for the sine–cosine model.

Success counts over ten trials per task

AngularFM is the best or tied-best method on every task except rack flipping, and it is never below the raw scalar or the sine–cosine model. Raw scalar and sine–cosine are the two Fast-WAM-Joint baselines.

The joints behind each task

Representative rotation-sensitive tasks on the Franka FR3 and the AgileX Cobot Magic, with the joints involved in each task. In block insertion, the cylinder enters only if it arrives aligned above the hole, so success depends on the final joint targets. The motion relies mainly on base rotation (J1) and the reach of J2 and J4.

Four of the real-world tasks with the joints they rely on: block insertion uses the base pan J1 and the reach of J2 and J4 on the Franka; shoe placement uses the wrist roll of J6 and J7; flipping a cup onto the rack uses the tilt of L3 and L5 and the wrist roll L6 on the AgileX; plate placement keeps the wrist upright with R3 and R5 and slots the plate with L3, L5 and L6.

Swipe sideways to see the whole figure.