This repository contains the official implementation of
LongNav-R1: Horizon-Adaptive Multi-Turn RL for Long-Horizon VLA Navigation
Yue Hu, Avery Xi, Qixin Xiao, Seth Isaacson, Henry X. Liu, Ram Vasudevan, Maani Ghaffari
Clone this repo with submodules:
git clone --recursive https://@github.com:UMich-CURLY/LongNav-R1.git
Install habitat in a separate conda env.
# initialize conda
conda create -y -n habitat python=3.11
conda run -n habitat python -m pip install --upgrade pip setuptools wheel
conda run -n habitat pip install --upgrade urllib3
# habitat-sim
git clone --branch v0.3,3 https://github.com/facebookresearch/habitat-sim.git && \
cd habitat-sim && \
conda run -n habitat pip install -r requirements.txt && \
conda run -n habitat python setup.py install --headless --with-cuda --bullet
# habitat-lab
git clone --branch v0.3.3 https://github.com/facebookresearch/habitat-lab.git && \
cd habitat-lab && conda run -n habitat pip install -e habitat-lab
conda run -n habitat pip install torch==2.7.0 torchvision==0.22.0 torchaudio==2.7.0 --index-url https://download.pytorch.org/whl/cu128
Apply for HM3D access to get an api token id and secret. Then run data_scripts/setup_dataset.sh to download the dataset and setup the folder structure.
The code requires the datasets in a data folder in the following format:
LongNav-R1/
data/
scene_datasets/
versioned_data/
datasets/
objectgoal_hm3d/
vlobjectnav_hm3d/
objectgoal_hm3d is used for object-goal navigation, and vlobjectnav_hm3d is used for language descriptive target navigation.
Initialize the main conda environment.
conda create -n longnav python=3.10.16
conda activate longnav
Install dependencies.
# Flash attention
pip install flash-attn --no-build-isolation
# Verl
git submodule update --init --recursive
cd verl && pip install --no-dependencies -e .
Install.
cd ../
pip install --no-dependencies -e .
This allows ray to resolve the interface correctly.
Two basic tests are currently available to validate your install. The code should be run with the longnav conda env active.
eval smoke test (tests the rollout collection)
python3 tests/eval_smoke.py
rl smoke test (tests one RL training step)
python3 tests/rl_smoke.py
These may be referenced for integrating new Envs.
Run our framework with a dummy environment (doesn't require habitat dependencies)
python3 -m longnav.scripts.train_dummy.py
python3 -m longnav.scripts.train_rl +checkpoint=sft +dataset=hm3d_train +experiment=train +resources=octo +training=hapo task.run_name=my_awesome_training_run
python -m longnav.scripts.eval +checkpoint=longnav +dataset=hm3d_val +experiment=eval +resources=octo task.run_name=my_awesome_eval_run
Serve the FAST API:
python3 -m longnav.serve
See the client example for API usage.
Config schemas are defined via data class in config_schema.py.
Config overrides are defined within the config directory which provides presets that can be composed.
- sim.workspace: directory containing "data", see habitat lab datasets
- resources.num_vlms and resources.num_sims: number of workers for policy and simualator respectively. the former must be less than your number of GPUs. the latter is recommended to be 1+num_vlms. when training, num_vlms must divide the number of rollouts (default 16) or the code will hang.
- task.run_name: run name used for wandb, default behavior is to resume.
- resources.osm_gb: size of ray objectstore, tune according to available shared memory and spilling situation
See dummy env structure for reference. Any compatible Env may be used by the rollout collection orchestration to produce rollouts for training steps.
At a high level, the Env Actors return dictionaries of standard RL outputs. However, RGB observation is separated out for better Ray performance.
If you find this code useful in your research then please cite
@inproceedings{hu2026longnavr1,
title={LongNav-R1: Horizon-Adaptive Multi-Turn RL for Long-Horizon VLA Navigation},
author={Hu, Yue and Xi, Avery and Xiao, Qixin and Isaacson, Seth and Liu, Henry X. and Vasudevan, Ram and Ghaffari, Maani},
booktitle={Robotics: Science and Systems (RSS)},
year={2026},
note={RSS 2026}
}
If you have any problem with this code, please feel free to contact phyllis1sjtu@outlook.com.