Skip to main content
Robotics & Embedded4 min read (726 words)

Engineering Autonomous Field Robotics: ROS 2, LiDAR SLAM, and Edge Compute in Unstructured Agricultural Terrains

SN

Soyebuzaman Naim

Robotics, Applied AI & Full-Stack Engineer

February 14, 2026
ROS 2SLAMLiDARSensor FusionEdge AI

Engineering Autonomous Field Robotics: ROS 2, LiDAR SLAM, and Edge Compute in Unstructured Agricultural Terrains

Autonomous mobile robots in industrial warehouses operate in structured, flat environments with known landmarks. When deploying a differential-drive ground robot in outdoor agricultural environments—such as uneven furrowed soil, fluctuating canopy density, and variable outdoor lighting—standard assumptions break down immediately.

In this deep dive, I share the architecture, sensor fusion mathematics, and real-time ROS 2 pipeline engineered for autonomous navigation in unstructured field terrains.


#1. The Core Engineering Challenge: Wheel Slip & Degraded Odometry

In outdoor soil, wheel encoders experience significant non-systematic error from rotational slip (s_r > 15%) and irregular tire deformation. Relying solely on wheel odometry produces catastrophic trajectory drift within a 5-meter run.

Warning & Edge Case
In agricultural furrows, dead-reckoning odometry drift is exponential. Sensor fusion must reject momentary encoder velocity spikes during wheel free-spinning.
text
                          +-------------------------+
                          |   Wheel Encoders (50Hz) |
                          +------------+------------+
                                       |
                                       v
+------------------------+      +---------------+      +-------------------------+
| 6-DOF IMU (BNO085)    +-----> |  EKF Node     | <----+ 2D LiDAR (RPLIDAR S2)   |
| Raw Accel / Gyro (100Hz)|     | (robot_loc)   |      | LaserScan / Cartographer|
+------------------------+      +-------+-------+      +-------------------------+
                                        |
                                        v
                          +-------------------------+
                          | /odometry/filtered      |
                          | (Continuous 50Hz Odom)  |
                          +-------------------------+

#2. Sensor Fusion Architecture with Extended Kalman Filtering

To produce a continuous, high-rate state estimate, we implement a multi-rate Extended Kalman Filter (EKF) using the robot_localization package in ROS 2 Humble.

##State Vector Definition

Our system tracks 15 states in the odom frame:

text
x = [ x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az ]^T

##Differential Equation for 2D Planar Ground Projection

For a differential drive robot with wheel separation L and wheel radius R:

cpp
// Custom ROS 2 Differential Kinematics Node
void OdometryPublisher::calculate_kinematics(double left_ticks, double right_ticks, double dt) {
    double d_left = (left_ticks * 2.0 * M_PI * WHEEL_RADIUS) / TICKS_PER_REV;
    double d_right = (right_ticks * 2.0 * M_PI * WHEEL_RADIUS) / TICKS_PER_REV;

    double d_center = (d_right + d_left) / 2.0;
    double d_theta = (d_right - d_left) / WHEEL_BASE;

    // Runge-Kutta 2nd Order Integration for Pose
    pose_x_ += d_center * std::cos(pose_yaw_ + d_theta / 2.0);
    pose_y_ += d_center * std::sin(pose_yaw_ + d_theta / 2.0);
    pose_yaw_ += d_theta;

    // Dynamic Covariance Inflation during high angular velocity
    covariance_matrix_[0] = (std::abs(d_center) > 0.01) ? 0.002 : 0.0001;
    covariance_matrix_[35] = (std::abs(d_theta) > 0.05) ? 0.05 : 0.001;
}

#3. 2D LiDAR SLAM Optimization under Dynamic Foliage

Standard Cartographer or Gmapping SLAM can fail when crop leaves sway in crosswinds, creating "phantom obstacles" and dynamic scan-matching variance.

##Multi-Stage Scan Filtering Pipeline

Pipeline StageAlgorithm / NodeTarget LatencyPurpose
Stage 1: Range Clippinglaser_filters/BoxFilter< 1.2msRemoves robot chassis reflections and low-lying ground glare
Stage 2: Angular Slicinglaser_filters/ScanShadowsFilter< 2.5msEliminates grazing-angle beam dispersion along curved plant stems
Stage 3: Submap Scan MatchingCartographer Ceres ScanMatcher< 12msCorrelates points with high-probability obstacle priors
Tip & Best Practice
Setting Cartographer's min_range to 0.25m and tuning submaps.num_range_data = 60 ensures that temporary foliage flutter does not degrade the long-term occupancy grid map.

#4. Hardware Edge Architecture & Power Budgeting

The complete compute stack runs on a carrier board powered by a 24V 20Ah LiFePO4 battery pack with isolated DC-DC step-down converters (19V for Jetson, 12V for motor drivers, 5V for MCU/sensors).

yaml
# ROS 2 Nav2 Behavior Tree Tuning for Unstructured Dirt Tracks
recovery_plugins: ["spin", "backup", "wait"]
spin:
  plugin: "nav2_recoveries/Spin"
  max_rotational_vel: 0.45
  min_rotational_vel: 0.15
  rotational_acc_lim: 1.2
backup:
  plugin: "nav2_recoveries/BackUp"
  backup_dist: 0.35
  backup_speed: 0.12

#5. Key Lessons from Field Deployment

  1. 1
    Hardware-Level Sensor Synchronization: Never poll IMU data over unbuffered serial USB at high rates. Use hardware interrupt timers on an STM32 MCU transmitting synchronized packets over CAN bus.
  2. 2
    Dynamic Footprint Inflation: In crop rows, fixed circular inflation layers cause conservative stalls. Elliptical footprint models aligned with the chassis orientation allow tighter inter-row navigation without clipping plant stalks.
  3. 3
    Graceful Failover: When LiDAR scan match score drops below 0.45 (e.g. in tall dense monoculture fields with few unique features), the robot smoothly falls back to IMU/wheel EKF fusion with reduced linear speed limits until distinctive landmarks reappear.
SN

About the Author

Soyebuzaman Naim is a Computer Science & Engineering researcher at Southeast University specializing in autonomous field robotics (ROS 2 / LiDAR SLAM), edge computer vision with TensorRT, 3D WebGL architecture, and production RAG systems.

More Engineering Deep Dives

View all articles