Code for the paper "Asymptotically Optimal Ergodic Coverage on Generalized Motion Fields". We present a trajectory planner for ergodic coverage over time-varying distributions defined by dynamic particle flows (e.g., cattle herds, ocean currents, vortex fields) using Maximum Mean Discrepancy (MMD).
conda create -n temp python=3.12
conda activate temp
# Core
pip install jax jaxlib jaxopt numpy matplotlib scipy
# Geometry (3D experiment)
pip install trimesh open3d
# Ocean / geo data
pip install cartopy cmocean cmcrameri imageio dill svgpath2mplA herd of cows flows toward feeding sinks under repulsion and damping dynamics. The ergodic agent plans a trajectory that covers the herd's evolving spatial distribution.
Generate the flow and save data:
cd cattle_feeding
conda run -n temp python cattle_flow.pyRun the ergodic planner:
conda run -n temp python make_traj.pyParticles orbit a vortex center with wall repulsion. The ergodic agent tracks the rotating distribution.
Generate the vortex flow:
cd vortex_flow
conda run -n temp python flow_animate.pyRun the ergodic planner:
conda run -n temp python make_traj.pyWhale pods are advected through real HYCOM ocean current data. The agent plans an observation path that maximizes cumulative encounter probability over the mission horizon.
Run the ergodic planner:
cd whale_search
conda run -n temp python make_traj.pyOcean current data (
whale_search/flow_data/flow_data.pkl) must be present. The flow field is loaded from HYCOM Gulf of Mexico velocity snapshots.
MIT — see LICENSE.