2.4.1. IMU-Aided NDT Localization on Sloped Terrain
Tracked agricultural chassis are prone to slip when operating on sloped terrain, and relying solely on odometry may lead to accumulated pose errors. To mitigate this problem, this study adopts the Normal Distributions Transform (NDT) method for point cloud map construction and localization, while using IMU-derived attitude priors to enhance localization stability under hilly farmland conditions.
Figure 6 shows the proposed IMU-aided NDT localization process. Compared with localization based only on odometry, the proposed method uses IMU attitude information to constrain the point cloud transformation and then performs NDT scan-to-map matching to evaluate the consistency between the current scan and the map distribution, thereby obtaining a corrected pose estimate.
It should be noted that the IMU prior in this study is introduced as a direct initial-pose constraint rather than as an additional regularization term in the NDT objective function. Specifically, the IMU contributes to NDT localization in two aspects. First, roll and pitch information are used to compensate the current point cloud before NDT matching, so that sloped-ground point clouds are represented in a more consistent spatial relationship. Second, the IMU heading angle is combined with the odometry-based translational prediction to form the initial pose for NDT scan-to-map matching. This reduces the search range and improves matching convergence. The optimization objective of NDT remains the consistency between the current point cloud and the probability distribution of the map grids.
Let
be the planar position predicted by odometry at time step
, and let
be the heading angle measured by the IMU. The initial pose for NDT matching is defined as
where
is the initial pose for NDT scan-to-map matching. If the IMU heading angle contains short-term fluctuations, the initial heading can also be constructed using the optimized pose from the previous time step and the IMU heading increment, namely
. Therefore, the IMU prior does not replace the final NDT localization result; rather, it provides a more reliable initial state for NDT optimization. The final pose is still determined by point cloud-to-map matching.
During the mapping stage, the attitude-compensated and coordinate-transformed Leishen C16 point clouds are divided into two-dimensional or local three-dimensional grid cells. Each NDT grid stores the mean and covariance of the points within the cell. Suppose that the
-th grid contains
points. The mean and covariance are computed as
where
is the point cloud mean of the
-th grid,
is the covariance matrix, and
is a regularization term used to avoid covariance singularity. These grid-wise Gaussian distributions form a probabilistic map for subsequent scan-to-map matching.
During the localization stage, the current scan is projected under a candidate pose
, initialized by
, and the Mahalanobis distance between the transformed scan points and the corresponding NDT map grids is calculated. The NDT matching cost is defined as
where
is the number of points in the current scan,
is the point cloud transformation determined by the candidate pose
,
is the index of the NDT grid containing the
-th transformed point, and
and
are the mean and covariance of the corresponding grid, respectively. A smaller cost indicates better consistency between the current scan and the local probability distribution of the map.
The optimized pose at time step
is obtained as
where
is the optimized pose, and
is the local search space centered on the IMU–odometry initial pose
. Compared with NDT localization without prior information or NDT initialized only by odometry, the proposed method reduces the initial-pose deviation through IMU attitude constraints and decreases the probability of matching divergence or local misalignment under sloped-terrain slip conditions.
In summary, the proposed IMU-aided NDT localization process consists of four steps: obtaining translational prediction from odometry, compensating the Leishen C16 point cloud using IMU roll and pitch information, constructing the NDT initial pose using odometry and IMU heading, and optimizing the pose through scan-to-map matching. In this way, the localization problem caused by track slip on sloped terrain is converted into a consistency optimization problem between the current scan and the probabilistic point cloud map. This improves pose estimation stability for tracked agricultural chassis operating in hilly farmland.
2.4.2. Slope-Adaptive Ground Segmentation and Obstacle Clustering
For path planning of a tracked agricultural chassis, it is necessary to accurately distinguish traversable ground points from non-ground obstacle points. In hilly farmland, LiDAR point clouds contain ground points, obstacle points, and outliers caused by measurement noise. If the ground-segmentation threshold is too small, continuous sloped ground may be incorrectly classified as obstacles, reducing the available traversable space. Conversely, if the threshold is too large, low obstacles may be incorrectly classified as ground points, thereby reducing obstacle-avoidance safety. Therefore, the key challenge of ground segmentation on sloped terrain is to adaptively adjust the ground continuity criterion according to terrain slope variation.
In this study, the Ray Ground Filter algorithm is used for slope-adaptive ground segmentation. The algorithm organizes point clouds into radial rays according to their azimuth angles and determines whether each point belongs to the ground by evaluating the height continuity between adjacent points along the same ray. Different from the fixed-threshold strategy used in the baseline algorithm, the proposed method introduces the IMU-derived slope angle into the Ray Ground Filter, allowing the ground continuity threshold to vary with terrain slope.
Let
denote the horizontal coordinates of the
-th point in the local point cloud. Its polar representation is given by
where
is the horizontal distance from the point to the LiDAR origin, and
is the azimuth angle of the point. The point cloud is divided into multiple rays according to
, and the points on each ray are sorted in ascending order of
.
The baseline algorithm uses a fixed threshold for ground segmentation. This strategy can perform well on flat or slightly sloped terrain, but it is prone to misclassifying continuous sloped surfaces as obstacles under large-slope conditions. To address this problem, the proposed method constructs a slope-adaptive ground continuity threshold based on the IMU-derived slope angle:
where
is the ground continuity threshold,
is the equivalent slope angle estimated by the IMU,
is the local terrain undulation margin used to compensate for surface unevenness and sensor noise, and
and
are the lower and upper bounds of the threshold, respectively. The clipping function prevents the segmentation from becoming overly strict when the estimated slope is too small and prevents low obstacles from being incorrectly merged into ground points when the estimated slope is too large.
It should be emphasized that the output of the clipping function in Equation (9) is an angle. After applying the tangent function,
becomes a dimensionless quantity. This quantity is not a height threshold in the conventional sense; rather, it represents the allowable ground-slope variation rate, namely the maximum allowable height variation per unit horizontal distance:
Thus, can be directly compared with the measured height variation rate between adjacent points. When the terrain slope increases, increases and also increases, allowing larger height variation between adjacent ground points. This reduces the probability of misclassifying continuous sloped ground as obstacles. When the terrain is relatively flat, remains small, maintaining a stricter ground continuity criterion and reducing the risk of classifying low obstacles as ground points.
Let
be the height of the current point,
be the height of the previous ground reference point, and
and
be their corresponding horizontal distances from the LiDAR origin. The ground-point judgment criterion is defined as
where
is the height difference between the current point and the previous ground reference point,
is the effective horizontal distance between the two points, and
is a small positive value used to avoid division by zero. The left-hand side of Equation (11) represents the measured height variation rate, while the right-hand side represents the allowable ground-slope variation rate determined by the IMU-derived slope prior. If the measured height variation rate is lower than
, the current point is classified as a ground point; otherwise, it is assigned to the non-ground point set and used as a candidate point for subsequent obstacle clustering.
Through Equations (9)–(11), the IMU-derived slope angle is converted from an attitude measurement into a geometric criterion for point cloud segmentation. This enables the Ray Ground Filter to adapt to slope changes instead of relying on a fixed empirical threshold. Compared with fixed-threshold segmentation, the proposed method is more suitable for hilly farmland with significant slope variation and can reduce false obstacles and loss of traversable space caused by slope-induced ground misclassification.
After ground segmentation, Euclidean clustering is applied to the non-ground point set to extract obstacle candidates. Points with spatial distances smaller than a specified clustering radius are grouped into the same obstacle cluster. Let
denote the
-th cluster and
be the number of points in this cluster. The cluster center is calculated as
and the approximate cluster radius is defined as
where
is the center of the
-th obstacle cluster,
is its approximate radius, and
is the coordinate of a point in the cluster. The cluster center and radius are used for obstacle representation, obstacle inflation, safety clearance calculation, and perception accuracy evaluation. To reduce the influence of noise and isolated outliers, candidate clusters are further filtered according to point-number thresholds and radius constraints, removing clusters with too few points or abnormal sizes.
In summary, the proposed slope-adaptive point cloud processing procedure consists of four steps: organizing the attitude-compensated Leishen C16 point cloud into radial rays, calculating the allowable ground-slope variation rate using IMU-derived slope information, performing adaptive ground-point judgment along each ray, and applying Euclidean clustering to non-ground points. The role of this module is not simply to increase the number of detected clusters, but to improve the reliability of obstacle representation by reducing slope-induced ground misclassification. The resulting obstacle centers and radii provide more stable inputs for path cost calculation, obstacle inflation, dynamic safety clearance evaluation, and subsequent local avoidance.
2.4.3. Slope-Aware Path Planning and Dynamic Obstacle Avoidance
The baseline global path planner adopts the Dijkstra algorithm to search for the minimum-cost path from the start point to the target point in the grid map. In the baseline algorithm, only the Euclidean norm between adjacent grid nodes is used as the edge cost, which is defined as
where
is the edge cost from node
to node
in the baseline algorithm, and
and
are the position vectors of two adjacent grid nodes. The notation
denotes the Euclidean norm, and therefore
has the physical unit of meters.
To address this limitation, a slope–cross-slope joint path cost model is constructed in this study. The proposed edge cost integrates path length, slope risk, cross-slope risk, and obstacle proximity, and is defined as
where
is the integrated edge cost from node
to node
,
is the Euclidean distance between adjacent grid nodes,
is the normalized slope risk function at node
, and
is the cross-slope risk function related to the chassis heading
. In addition,
is the distance from node
to the nearest obstacle boundary,
,
, and
are dimensionless weighting coefficients, and
is the attenuation parameter of the obstacle potential field.
The dimensional consistency of Equation (15) was explicitly checked. The Euclidean edge length has units of meters. The bracketed factor is dimensionless because , , and are dimensionless, while , , and are dimensionless weighting coefficients. The ratio is dimensionless when is expressed in meters. Therefore, retains the unit of equivalent path length in meters.
Slope risk function
Let
denote the local slope angle at node
, and let
denote the maximum safe slope angle of the chassis. The normalized slope risk function is defined as
where
can be obtained from the IMU-derived slope estimate, the simulated slope map, or the local terrain height difference. The parameter
represents the safe slope limit of the tracked agricultural chassis. In this study, the maximum climbing capability of the chassis is no more than
; therefore,
is used in the simulation. The value of
ranges from 0 to 1. A smaller local slope corresponds to a lower slope risk, whereas a local slope approaching the safe slope limit corresponds to a higher slope risk.
In Equation (15), is used instead of to enhance the penalty for high-slope regions. For mild slopes, the quadratic term increases slowly and avoids excessive sensitivity to slight terrain variation. For steep slopes, the quadratic term increases more rapidly, encouraging the planner to avoid high-risk slope regions. This design follows the engineering principle that low-slope areas are generally passable, whereas high-slope areas should be treated more conservatively.
Cross-slope risk function
Considering only the slope magnitude is insufficient to characterize the driving risk of a tracked agricultural chassis on sloped terrain. For the same slope surface, the main risk during uphill or downhill motion is longitudinal slip, whereas lateral sideslip and rollover risk increase when the chassis moves across the slope. Therefore, a heading-related cross-slope risk function is further introduced.
Let
denote the steepest downslope direction of the local terrain at node
, and let
denote the current or planned motion direction of the chassis. The angular difference between these two directions is defined as
where
normalizes the angle to the range
. When the motion direction is parallel or anti-parallel to the steepest downslope direction, the chassis mainly moves uphill or downhill. When the motion direction is approximately perpendicular to the steepest downslope direction, the chassis moves across the slope. Based on this relationship, the cross-slope risk function is defined as
where
describes the lateral component of the chassis motion relative to the slope direction. When
or
, the chassis moves along the slope direction and the cross-slope risk is relatively low. When
, the chassis moves across the slope, and
approaches 1, resulting in a high cross-slope risk. Multiplying this term by
ensures that cross-slope risk is jointly determined by slope magnitude and motion direction. On flat terrain, cross-slope risk remains low even if the motion direction is perpendicular to the slope direction; on steep terrain, cross-slope motion is strongly penalized.
In a two-dimensional grid simulation, if the slope direction is known,
can be directly assigned according to the simulated terrain. If a terrain height map is available, the steepest downslope direction can be calculated from the local height gradient as
where
and
are the terrain height gradients in the
and
directions, respectively. The negative gradient direction represents the steepest downhill direction of the local terrain.
Obstacle potential term
In addition to slope and cross-slope risks, the planned path should maintain a sufficient distance from obstacle boundaries to account for chassis width, perception uncertainty, and tracking errors. Therefore, an exponential obstacle potential term is used to represent the near-field risk of obstacles:
where
is the obstacle potential cost,
is the distance from node
to the nearest obstacle boundary, and
is the attenuation parameter. The obstacle potential cost is high when the node is close to an obstacle and decreases rapidly as the distance increases. The exponential function is used because obstacle-related risk has a strong near-field characteristic: strong penalties should be imposed near obstacle boundaries, while distant obstacles should not excessively influence the path search. The weighted obstacle potential contribution in Equation (15) is
.
Accordingly, Equation (15) can be interpreted as a combination of four factors. The first term, , prevents unnecessary path-length increase. The slope risk term encourages the path to avoid steep regions. The cross-slope risk term suppresses cross-slope motion under high-slope conditions. The obstacle potential term encourages the path to maintain a safe distance from obstacle boundaries. Compared with the baseline algorithm that only considers geometric distance, the proposed cost model explicitly introduces terrain traversability and obstacle safety into the edge cost, making the planned path more suitable for execution by a tracked agricultural chassis in hilly farmland.
The cumulative-cost update of the Dijkstra algorithm is expressed as
where
is the minimum cumulative cost from the start point to node
,
is the set of neighboring nodes of
, and
is the integrated edge cost calculated using Equation (15). Through Equations (14)–(21), the planner considers not only path length but also slope safety, cross-slope risk, and obstacle proximity during path search.
Local re-planning for dynamic obstacle avoidance
The global planner mainly handles static obstacles and terrain-related risk. However, dynamic obstacles may suddenly enter the planned path and require a faster safety response. To improve the response capability under dynamic obstacle scenarios, a local A* re-planning strategy is introduced on the basis of the global path. When the LakiBeam1L single-line LiDAR detects that a dynamic obstacle has entered the forward safety zone, a local grid window is constructed around the current chassis position, and the dynamic obstacle is inflated according to the chassis size and safety margin.
The evaluation function of the local A* planner is defined as
where
is the evaluation value of node
,
is the cumulative cost from the local start point to node
, and
is the heuristic distance from node
to the local target point
. The local target point is usually selected as a reference point on the global path ahead of the current chassis position, so that the chassis can return to the global path after avoiding the dynamic obstacle.
The inflated dynamic obstacle region is defined as
where
is the grid point to be evaluated,
is the position of the dynamic obstacle,
is the dynamic obstacle radius,
is the equivalent safety radius of the chassis, and
is the dynamic safety margin. Grid cells satisfying Equation (23) are regarded as dynamically non-traversable regions. This inflation process accounts for obstacle size, chassis envelope, and dynamic avoidance margin, preventing the local path from passing too close to the dynamic obstacle.
The local obstacle-avoidance process is as follows. First, the LakiBeam1L LiDAR determines whether a forward dynamic obstacle has entered the velocity-dependent safety zone. If the trigger condition is satisfied, the local cost map is updated by inflating the dynamic obstacle within the local grid window. Then, the local A* planner searches for a temporary avoidance path in the updated local cost map. After bypassing the obstacle, the chassis returns to the original global path when the safety condition is restored. If no feasible local path exists within the local window, the chassis executes deceleration or stopping to ensure safety.
2.4.4. Slope-Adaptive Path Tracking and Near-Field Safety Control
This study adopts the Pure Pursuit algorithm for path tracking and introduces a slope-adaptive velocity regulation mechanism in the proposed method. Pure Pursuit selects a look-ahead target point on the reference path according to the current chassis position and the look-ahead distance, and then calculates the desired curvature based on the target point angle. In the proposed method, slope and heading error factors are further incorporated into the velocity command. Specifically, the linear velocity is reduced when the terrain slope increases or when the steering demand becomes larger. This strategy aims to reduce sideslip and trajectory oscillation during turning on sloped terrain. In addition, when the LakiBeam1L single-line LiDAR detects a dynamic obstacle risk, the system further constrains the velocity and triggers local re-planning.
Let
denote the look-ahead distance,
denote the current linear velocity of the chassis,
denote the basic look-ahead distance, and
denote the velocity gain. The look-ahead distance is defined as
Let
denote the angle of the look-ahead target point in the chassis coordinate system. The desired curvature of Pure Pursuit is calculated as
where
is the desired path-tracking curvature, and
is the angle between the look-ahead target point and the current heading direction of the chassis. A larger target point angle indicates a higher steering demand and therefore a larger desired curvature.
To reduce the risk of sideslip and tracking oscillation on sloped terrain, a slope-related velocity ratio
is defined as
where
is the slope-related velocity ratio,
is the slope angle estimated by the IMU,
is the slope threshold at which velocity reduction begins,
is the safe slope limit of the chassis, and
is the minimum allowable velocity ratio near the maximum slope. The clipping function constrains the velocity ratio within a reasonable range.
In this study, the maximum climbing capability of the tracked agricultural chassis is no more than ; therefore, is adopted. Considering that the chassis can still maintain relatively stable motion on mild slopes, is used as the initial slope threshold for velocity reduction. To avoid excessive speed on steep slopes, which may cause sideslip and tracking oscillation, is used. According to Equation (26), when , , and the chassis maintains the normal tracking velocity. As approaches , gradually decreases and is finally limited by . Thus, the slope-related velocity ratio is determined by the chassis slope capability and the minimum safe velocity ratio, rather than by an arbitrary empirical coefficient.
In addition to slope, steering demand also affects the stability of a tracked agricultural chassis on sloped terrain. When the chassis turns sharply on a slope, a large look-ahead target angle may increase the risk of lateral slip and trajectory oscillation. Therefore, a heading error-related velocity ratio is defined as
where
is the heading error-related velocity ratio,
is the heading error velocity regulation coefficient, and
is the minimum allowable velocity ratio under heading error constraints. This equation indicates that a larger target point angle leads to a lower linear velocity, thereby reducing the risk of sideslip during sharp turning on sloped terrain.
The linear and angular velocity commands are defined as
where
and
are the commanded linear and angular velocities, respectively;
and
are the maximum and minimum linear velocities; and
is the maximum angular velocity. Equations (26)–(29) show that the controller jointly regulates the linear velocity using the slope factor and the heading error factor, and then calculates the angular velocity according to the desired curvature. The design principle is to reduce the linear velocity when the slope is steep or the path curvature is large, thereby decreasing sideslip and oscillation during slope traversal and turning. When the slope is mild and the path is relatively smooth, the chassis maintains a higher velocity to avoid overly conservative motion. This control law is an engineering-oriented strategy for sloped agricultural scenarios, and its effectiveness is evaluated through system-level simulations in this study.
Meanwhile, the LakiBeam1L single-line LiDAR is used for forward near-field dynamic obstacle safety detection. Let
denote the relative distance between the dynamic obstacle and the chassis center, and let
denote the relative bearing angle of the dynamic obstacle with respect to the chassis heading. They are calculated as
where
is the chassis position,
is the dynamic obstacle position, and
is the heading angle of the chassis. The value
represents the distance between the dynamic obstacle and the chassis center, while
represents the obstacle bearing relative to the forward direction of the chassis.
To account for the influence of motion velocity on braking distance and avoidance distance, a velocity-dependent safety distance is defined as
where
is the basic safety distance,
is the perception and control response time,
is the allowable deceleration,
is the equivalent safety radius of the chassis, and
is the equivalent radius of the dynamic obstacle. Equation (32) consists of the basic safety distance, the distance traveled during the response time, the braking distance, and the geometric safety radii. Therefore, it explicitly reflects the fact that a higher velocity requires a larger safety distance.
The dynamic obstacle triggering condition is defined as
where
is the half-angle of the forward detection sector. When Equation (33) is satisfied, the dynamic obstacle is considered to have entered the forward safety zone of the chassis, and the system switches to the near-field safety control mode.
Under the near-field safety control mode, the system first reduces the velocity command and triggers local re-planning if a feasible avoidance path exists. If the obstacle continues to approach and the remaining distance is insufficient for safe avoidance, the chassis executes a stopping command. In this way, conventional path tracking and near-field safety intervention are handled in a hierarchical manner: Pure Pursuit provides the reference tracking command, slope-adaptive velocity regulation reduces terrain-induced motion risk, and the LakiBeam1L-based safety trigger provides high-priority intervention for dynamic obstacles.
In summary, the proposed path-tracking and safety control procedure consists of four steps: selecting a look-ahead target point and calculating the desired curvature, computing the slope-related and heading error-related velocity ratios, generating the constrained linear and angular velocity commands, and applying near-field safety intervention when a dynamic obstacle enters the velocity-dependent safety zone. The purpose of this control strategy is not to minimize travel time, but to improve trajectory stability and dynamic safety clearance for tracked agricultural chassis operating under hilly farmland conditions.