This project adapts the core ideas of WayFAST to indoor mobile robotics: estimating traversability and surface difficulty by comparing commanded vs estimated motion. It combines state estimation, geometric projection, and learning-ready dataset construction in ROS 2 on a DJI RoboMaster EP Core with Intel RealSense D455.
The system integrates perception, estimation, and learning modules within a unified traversability prediction pipeline, validated through full data acquisition, state estimation, and geometric projection workflows.
- ROS 2 teleop + logging on RoboMaster EP Core (D455 RGB-D).
- EKF-based state estimation fusing odometry and IMU; per-frame traversability coefficients.
- Camera–base extrinsics + multi-timestep pose projection onto image plane for pixel-level labels.
- Learning-ready dataset (RGB-D, path masks, µ/ν coefficient maps, kinematics) and a ResNet-Depth-UNet training scaffold.
Hardware
- DJI RoboMaster EP Core
- Intel RealSense D455 (RGB-D)
- Jetson Nano (on-board), host workstation for development
Software
- ROS 2 (Humble recommended),
rclpy,robot_localization - OpenCV, NumPy, Matplotlib
- PyTorch (for the training scaffold)
Pipeline
- Collect RGB-D,
/cmd_vel,/odom, IMU via ROS 2 bags. - Fuse odometry + IMU with EKF for velocity/orientation estimation.
- Project future odometry windows into the current image via camera extrinsics to create path masks.
- Assemble synchronized training rows with RGB-D, path masks, µ/ν maps, and kinematics.
- Train (scaffold) ResNet-Depth-UNet for pixel-wise traversability (setup complete; training not run due to coefficient bottleneck).
The traversability estimation framework builds upon the physical relationship between commanded and measured motion to infer surface interaction.
Let
The traversability coefficient is defined as:
Under ideal traction,
This coefficient serves as a self-supervisory signal, enabling learning without manual labels.
An Extended Kalman Filter fuses odometry and IMU data to estimate the robot’s state:
The EKF prediction and update follow:
This provides smoothed velocity estimates
Future odometry poses are reprojected into the image plane using known camera intrinsics and extrinsics:
This maps multi-timestep trajectories to their corresponding RGB-D pixels, creating path masks for self-supervision.
A ResNet–Depth–UNet model predicts per-pixel traversability
The robot thus learns traversability directly from its own motion feedback—bridging state estimation, geometry, and learning for adaptive navigation.
JDSRobo/
│
├─ Sample Data/
│ ├─ camera_info/
│ ├─ cmd_vel/
│ ├─ odom/
│ ├─ final_training_data.csv
│ ├─ projection.csv
│ └─ Path images sample (future path without traversability coeff. scaling).mp4
│
├─ Scripts/
│ ├─ teleop.py # RoboMaster SDK teleop + IMU publish + /cmd_vel
│ ├─ record_rosbag.py # ROS-native teleop; print odom; bag recording (template)
│ ├─ analyze_coefficients.py # Teleop + odom sampling; histograms of v and µ = v_odom / v_cmd
│ ├─ teleop_EKF.py # 8-state EKF (x,y,θ,v,ω,biases); slip heuristic; plots + TF + /ekf_odom
│ ├─ extract_rosbag_to_data.py # rosbag2 → images/, odom.csv, cmd_vel.csv, camera_intrinsics.yaml
│ ├─ generate_projection_csv.py # For each image: future N-pose window (x,y,z,θ) → projection.csv
│ ├─ projection_path.py # Batch projection: future robot footprints → path/*.png (black canvas)
│ └─ projection_singleimage.py # Single-frame projection with debug prints and colored footprints
│
└─ Training/
├─ dataset.py
├─ train.py
├─ infer.py
├─ params.py
├─ resnet_depth_unet.py
└─ utils.py
- Ubuntu 22.04 + ROS 2 Humble
- Python 3.10+
- Recommended Python deps:
pip install opencv-python numpy matplotlib pandas pyyaml scipy torch torchvision
- RealSense SDK (for device-level tools) if capturing new data.
-
RoboMaster ROS 2 driver (example is spawned by the scripts; otherwise launch your own).
-
Manual teleop options:
- RoboMaster SDK teleop:
ros2 run your_pkg teleop.py
- ROS-native teleop (console):
(Use this as a template;
ros2 run your_pkg record_rosbag.py
ros2 bag record ...lines are provided in-script as comments.)
- RoboMaster SDK teleop:
-
For quick coefficient sampling with odom histograms:
ros2 run your_pkg analyze_coefficients.py
Press
qto quit and auto-plot histograms.
Edit paths in extract_rosbag_to_data.py to your bag URI, then:
python Scripts/extract_rosbag_to_data.pyOutputs:
Sample Data/images/image_<timestamp>.pngSample Data/odom/odom.csvSample Data/cmd_vel/cmd_vel.csvSample Data/camera_info/camera_intrinsics.yaml
python Scripts/generate_projection_csv.pyCreates Sample Data/projection.csv with x_window, y_window, z_window, theta_window (length N per image).
- Batch:
Saves masks to
python Scripts/projection_path.py
Sample Data/path/(white footprints on black backgrounds). - Single-frame debug:
python "Scripts/projection_single image.py"
python Scripts/teleop_EKF.pyPublishes /ekf_odom, broadcasts TF, and at shutdown saves:
velocity_and_traversability_comparison_plots.pngodom_and_coeff_histograms.png
Per-image future trajectory windows for projection.
timestamp(float) — image timestampimage_path(str) — relative path (e.g.,images/image_...png)x_window,y_window,z_window(list[float]) — future positions (length N)theta_window(list[float]) — future yaw angles (length N)
Learning-ready table (one row per example).
rgb_img,depth_img— image pathspath— projected path mask imagemu,nu— traversability coefficient map image pathslin_vel,ang_vel— sampled velocity arrays (stringified lists)x,y— odometry arrays (stringified lists)traversability— label/summary scalar or map (depending on your variant)timestamps— base timestamp
The training pipeline and data are complete and ready for execution once all relevant image data is collected and organized under the directories
/mu,/nu,/path,/color, and/depth.
-
EKF state estimation (teleop_EKF.py): 8-state filter
[x, y, θ, v, ω, b_ax, b_ay, b_ω]with IMU bias states, dynamic R tuning for simple slip heuristics. Publishes/ekf_odomand TF. -
Traversability coefficient: Simplified proxy [ \mu = \frac{v_\text{measured}}{v_\text{commanded}} ] computed from EKF or odom estimates; used for self-supervision.
-
3D projection: Known intrinsics K and extrinsics [R|t] from
base_link → opticalproject future robot footprints into the current image for pixel-level path supervision. -
Training scaffold (Training/): ResNet-Depth-UNet backbone, dataset loader for synchronized RGB-D + kinematics + masks.
- The closed-loop controller in RoboMaster EP held commanded and measured velocities close, yielding inconsistent µ.
- Possible remedies:
- Reduce or bypass internal velocity control (open-loop tests).
- Collect on varied surfaces with controlled disturbances (e.g., low-friction patches, ramps).
- Incorporate auxiliary cues (wheel current, contact microphones, tactile modules).
- Extend labels using visual slip estimators or re-projection consistency.
This repository documents a complete, training-ready pipeline for self-supervised traversability in mobile robotics, integrating state estimation, geometric calibration, and dataset engineering. It is intended as a reproducible foundation for research on terrain-aware navigation in resource-constrained robots.
- WayFAST: Navigation with Predictive Traversability in the Field (methodological inspiration)
- ROS 2
robot_localizationdocumentation - Intel RealSense D455 documentation
Muhammad Musab Ali Chaudhry — Lahore University of Management Sciences (LUMS)
Contact: 25100190@lums.edu.pk