arXiv:2610.24256cs.ROOct 2026

Manuscript Offprint

arXiv:2610.24256

TrajEdit: Real-Time Flow-Matching Trajectory Adaptation via FlowEdit and CBF Safety Filter

Wondmgezahu Teshome, Arya Honarpisheh, Octavia Camps, Mario Sznaier

Wondmgezahu Teshome, Arya Honarpisheh, Octavia Camps, Mario Sznaier

Abstract—Safe, real-time motion planning is especially difficult when a dynamic obstacle actively pursues the ego agent, requiring rapid adaptation as the environment changes. We present TrajEdit, a hierarchical trajectory planner for pursuit-evasion that combines flow matching, trajectory editing, and safety filtering. Rather than regenerating trajectories from scratch at every step, TrajEdit follows the current plan under nominal conditions and adapts its remaining portion through FlowEdit as the pursuer approaches, and falls back to a control barrier function safety filter if the adversarial agent is within a safety threshold. Our use of FlowEdit for trajectory editing reduces computation time while maintaining a comparable success rate. We evaluate TrajEdit in 2D pursuit-evasion with static obstacles and an adversarial pursuer, demonstrating high success rates with low capture and collision rates, while achieving computational time savings over full replanning baselines.

I. INTRODUCTION

Autonomous robots navigating changing environments must reach their goals while avoiding moving obstacles [1]. Pursuit-evasion adds an adversarial element, as the pursuer actively attempts to capture the robot [2]. The pursuer's motion can make an existing trajectory unsafe, requiring timely responses to new observations. The planner must therefore balance responsiveness with the computational cost of updating its trajectory.

Classical motion planners address these requirements through geometric search and local obstacle avoidance. RRT-Connect [3] searches for a feasible path by growing trees from the start and goal. RRTX [4] maintains and repairs a search graph as obstacles change. Artificial potential fields combine goal attraction with obstacle repulsion [5]. Conventional formulations can encounter local minima, and extensions use virtual targets to restore progress toward the goal and modified repulsive fields to improve obstacle avoidance [6]. The velocity obstacle (VO) method [7] uses relative positions and velocities to identify motions that would lead to collision and select an avoidance velocity. The computational demands of online search and the local minima of potential fields motivate learning motion policies and trajectory priors from data.

Learning-based methods have been applied to both action selection and trajectory generation. Reinforcement learning (RL) has been used to learn evasive actions from visual observations [8] and has been combined with imitation learning for goal-directed escape among obstacles [9]. Generative models learn distributions over trajectories. Diffuser [10] generates plans through iterative denoising, and Motion Planning Diffusion [11] combines learned trajectory priors with guidance from planning costs. In pursuit-evasion, diffusion has also been combined with a local RL policy to coordinate global planning and evasive behavior [12]. Repeated denoising can become costly when plans must be updated frequently. Flow matching [13] offers an alternative by learning a continuous velocity field and generating samples through an ordinary differential equation. FlowMP [14] applies this approach to robot motion planning and reports lower inference times than diffusion baselines in its evaluated settings.

An additional strategy is to update the remaining portion of the active plan as new observations arrive, rather than regenerate the entire trajectory from scratch. Warm starts allow a diffusion planner to perturb and refine its previous trajectory under updated observations [15]. RAMP [16] uses limited denoising and artificial potential fields to refine trajectories in pursuit-evasion. Adaptive online replanning [17] selects between retaining a plan, repairing its remaining portion, and generating a replacement. Other approaches distribute denoising across execution steps, either by refining a plan with increasing noise levels along its horizon [18] or by maintaining a queue of partially denoised actions with feedback guidance [19]. These methods establish the value of trajectory reuse and incremental updates. Our focus is on how conditional flow editing can update the remaining trajectory as the observed scene changes.

For this purpose, we adapt FlowEdit [20], originally proposed for image editing, to trajectory adaptation. FlowEdit constructs an editing path using differences between learned velocity fields under source and target conditions, without first inverting the source sample to noise. Related work has applied conditional flow editing to human motion under changes in text or skeleton conditions [21]. Here, the conditions change as the ego agent and pursuer move. We use the previous and current conditions to edit the unexecuted portion of the plan while retaining its goal. The same learned flow model supports initial generation and subsequent editing, allowing the planner to update an existing trajectory without generating a new one from noise at every step.

Unlike image editing, this application also requires consideration of safety. Control barrier functions (CBFs) provide a way to constrain control inputs using a specified safe set [22]. Recent work has incorporated these constraints into flow matching. SafeFlow [23] adds barrier corrections during trajectory generation, while SafeFlowMatcher [24] first predicts a path and then refines it through a separate correction phase. In both methods, barrier corrections act within the

This work was supported in part by NSF grant CMMI–2208182 and ONR grant N00014-21-1-2431. The authors are with the Department of Electrical and Computer Engineering, Northeastern University, Boston, MA, USA.

Figure

Fig. 1: Overview of TrajEdit. (1) The scene and plan endpoints define the condition c. (2) The flow-matching backbone integrates vθv_{\theta} from noise to a plan τ\tau. (3)–(5) At each step, the CBF filter acts if no plan is accepted or if the evader or its next waypoint is within rescr_{esc} of the pursuer, and the plan is then regenerated. Otherwise, the evader follows the plan, which is kept while the pursuer stays at least rer_{e} away and enough of the plan remains, and edited if not. In (4), dark blue marks the remaining plan, light blue its executed part, and grey a discarded plan; dashed arrows indicate feedback, τ[k+1]\tau[k+1] is the next waypoint of τ\tau.

trajectory-generation process, and their navigation evaluations use static obstacles. In pursuit-evasion, the planner must update its plan as the pursuer moves while responding to immediate capture risk during execution.

To coordinate plan updates with immediate evasion, we propose TrajEdit, a hierarchical planner for pursuit-evasion. Under nominal conditions, the ego agent follows the current trajectory. As the pursuer approaches, FlowEdit adapts the remaining plan to the new observation. When immediate evasion is needed, the CBF safety filter intervenes and the planner attempts to generate a new trajectory from the updated state. Our contributions can be summarized as follows:

• A unified framework for pursuit-evasion that adapts FlowEdit to online trajectory editing and integrates CBF safety filtering during execution. Selective reuse and editing of the remaining trajectory avoid full regeneration at every update, addressing computational efficiency alongside safety.

• A systematic evaluation of TrajEdit against existing planning methods, together with ablation studies of its key components, to assess both task performance and computational efficiency.

References (34)