# Getting Started with UrbanV2X Start with **`hkstp_s_02`**, a 379-second HKSTP sequence. These examples use its released files and calibration: RTKLIB demo5 for GNSS, VINS-Fusion in monocular–inertial mode with cam2, and FAST-LIO2 with HDL-32E. The supplied adapter creates local ROS bags from PNG/BIN/CSV files; it does not change the source release. ## 1. Download only the inputs you need Install `huggingface_hub` in your download environment, then run: ```python from huggingface_hub import snapshot_download snapshot_download( repo_id="polyutaslab/UrbanV2X", repo_type="dataset", local_dir="UrbanV2X", allow_patterns=[ "demos/hkstp_s_02/**", "hkstp_s_02/calib/**", "hkstp_s_02/imu.csv", "hkstp_s_02/reference_original.csv", "hkstp_s_02/gnss/f9p/**", # RTKLIB "hkstp_s_02/camera/cam2/*.png", # VINS-Fusion "hkstp_s_02/lidar/hdl32/*.bin", # FAST-LIO2 ], ) ``` Remove the camera or LiDAR pattern if you only need GNSS. Then prepare the example directory: ```bash cd UrbanV2X/demos/hkstp_s_02 ln -s ../../hkstp_s_02 data ``` The examples below run from this directory. Use a Python environment compatible with ROS Noetic for the ROS scripts; the download environment can be separate. ## 2. GNSS: RTKLIB demo5 The rover input is `gnss/f9p/observations.obs`, with `broadcast.nav`. Obtain **HKST** base observations and applicable navigation files for **13 August 2026, 08:00–09:00 UTC** directly from [Hong Kong Lands Department SatRef](https://www.geodetic.gov.hk/en/rinex/downv.aspx). Follow the [provider's usage terms](../hkstp_s_02/gnss/hkst/README.md); the base data are not included in this repository. With Git, a C compiler and Make installed: ```bash bash scripts/run_rtk.sh /path/to/hkst-observations.obs /path/to/navigation-files/* ``` The script builds the pinned **RTKLIB demo5 b34L** revision and uses `configs/rtklib_demo5.conf`. This is dual-frequency kinematic post-processing with combined forward/backward solutions, a 15° elevation mask, base coordinates from the RINEX header, and UTC output. Results are written to `results/rtklib_demo5.pos`. Check the quality column rather than assuming a fixed RTK solution. The tested run produced **379 solutions: 376 float, 3 DGPS, and no fixed solutions**. This example demonstrates data ingestion and processing, not a claim of centimetre-level accuracy. Upstream: [RTKLIB demo5](https://github.com/rtklibexplorer/RTKLIB). ## 3. Prepare the ROS examples The tested environment is Ubuntu 20.04, ROS Noetic, OpenCV 4.2 and Ceres 1.14. With ROS Noetic configured, install the required development packages: ```bash sudo apt-get install build-essential cmake git libceres-dev \ python3-numpy python3-opencv python3-yaml \ ros-noetic-rosbag ros-noetic-cv-bridge ros-noetic-image-transport \ ros-noetic-pcl-ros ros-noetic-tf ros-noetic-eigen-conversions bash scripts/build_ros.sh source /opt/ros/noetic/setup.bash source ros_ws/devel/setup.bash python3 scripts/configure.py --data data --output configs ``` The build script pins upstream revisions and applies the supplied OpenCV/Noetic and build-order compatibility patches. The estimator algorithms are unchanged. For the Velodyne-only FAST-LIO example, it builds the official Livox message definitions without the hardware driver. ## 4. Visual–inertial odometry: VINS-Fusion ```bash python3 scripts/make_rosbag.py --data data --mode vins --output vins_input.bag python3 scripts/run_ros_demo.py --mode vins --bag vins_input.bag \ --config configs/vins.yaml --output results/vins --port 11531 --rate 1 ``` The adapter uses all 3,790 cam2 images and 151,601 IMU samples. Images become grayscale at 1100 × 870 for this demo, with matching half-scale intrinsics; they are not cropped or undistorted. The published `imu_to_cam2` transform is inverted to obtain VINS's `body_T_cam0`. The `aug13` camera–IMU offset is applied through `td`. Extrinsics and time offset are held fixed; no loop-closure node is launched. The output `results/vins/trajectory.tum` has columns `t x y z qx qy qz qw`. Logs and `run.json` record execution and trajectory coverage. Use a fresh output directory for a rerun. Upstream: [VINS-Fusion](https://github.com/HKUST-Aerial-Robotics/VINS-Fusion). ## 5. LiDAR–inertial odometry: FAST-LIO2 ```bash python3 scripts/make_rosbag.py --data data --mode fastlio --output fastlio_input.bag python3 scripts/run_ros_demo.py --mode fastlio --bag fastlio_input.bag \ --config configs/fastlio.yaml --output results/fastlio --port 11532 --rate 1 ``` The adapter uses all 3,787 HDL-32E scans and 151,601 IMU samples. It maps the six BIN columns to PointCloud2 fields `x, y, z, intensity, ring, time`, retaining per-point offsets in seconds. FAST-LIO is configured for a 32-channel Velodyne and `timestamp_unit: 0`. It uses the published LiDAR-to-IMU rotation, translation and `aug13` time offset, with online extrinsic estimation disabled. Standard FAST-LIO downsampling operates inside the estimator; the source point clouds remain unchanged. The output is `results/fastlio/trajectory.tum`. Check `run.json` and `estimator.log` before using a trajectory. Lower `--rate` if your machine cannot keep up with playback. Upstream: [FAST-LIO2](https://github.com/hku-mars/FAST_LIO). ## Executed example results The complete released input streams were replayed at 1× speed. The table reports output coverage after estimator initialization; it is not an accuracy ranking. | Example | Outputs | UTC output interval on 2026-08-13 | |---|---:|---| | RTKLIB demo5 b34L | 379 solutions: 376 float, 3 DGPS, 0 fixed | 08:05:04.000–08:11:22.000 | | VINS-Fusion, cam2 + IMU | 1,881 poses | 08:05:06.839–08:11:22.842 | | FAST-LIO2, HDL-32E + IMU | 3,784 poses | 08:05:04.330–08:11:22.955 | ![Executed s_02 demo trajectories](../assets/s02_demo_trajectories.png) The GNSS plot uses geographic coordinates without fitted alignment. VINS and FAST-LIO are aligned using **only the first 200 metres of the reference trajectory**, measured by cumulative horizontal distance along its ENU positions from sequence start. Only time-matched poses inside this window are used to estimate a 2D rotation and translation. The resulting fixed transform is applied to the entire trajectory, with **no scale fitting and no later refitting**; the rest of the trajectory does not influence alignment. The dark reference segment in each plot marks the alignment window. VINS shows visible drift in this run. Reference-point lever arms have not been corrected, so these plots are not a substitute for a carefully specified accuracy evaluation. Download [VINS trajectory](../demos/hkstp_s_02/results/vins/trajectory.tum), [FAST-LIO trajectory](../demos/hkstp_s_02/results/fastlio/trajectory.tum), or [GNSS solution coordinates](../demos/hkstp_s_02/results/rtklib_track.csv). The [summary](../demos/hkstp_s_02/results/demo_summary.json) and [version record](../demos/hkstp_s_02/results/provenance.json) accompany the runs. VIO/LIO trajectories passed finite-value, strictly increasing timestamp, and unit-quaternion checks. Output cadence and initialization mean pose counts differ from input frame counts. ## Timing and evaluation - PNG and BIN filenames are integer UTC microseconds. The adapter uses these timestamps; IMU CSV timestamps use the same unit. - Do not subtract a GPS–UTC offset from camera or LiDAR filenames. RINEX has its own declared time system. - `reference_original.csv` retains the original GNSS/INS reference point and attitude convention. It is not automatically the IMU-centre trajectory produced by VINS or FAST-LIO. - Record initialization coverage, time alignment, lever arms, coordinate transforms and any trajectory alignment when reporting accuracy. Successful playback alone is not an accuracy benchmark. For cooperative experiments, download `roadside/rsi2_a/lidar/*.pcd` and `roadside/rsi2_b/lidar/*.pcd`. Their filenames use bag-record UTC microseconds, while point timestamps remain on the native device clocks; see the [roadside notes](../hkstp_s_02/roadside/README.md).