1. Introduction
There are multiple efforts to develop mathematical models for planning robot trajectories, whether in teleoperated systems, swarm robotics, multi-agent robotics, or leader–follower systems [
1,
2,
3,
4,
5,
6]. Path planning and formation control in multi-agent and leader–follower systems remain active research areas, as shown in reviews [
7,
8,
9]. Several techniques can be used to maintain a formation in a group of robots, such as artificial potential fields where the leader is usually assigned with a target destination and the followers receive the desired position and use local information to track this position by using a distance-bearing control or relative coordinates [
10,
11]; differential games schemes which involve hierarchical dynamic optimization, by using the tracking cost function for the leader robot and the formation cost functions for follower robots, where the leader makes decisions anticipating the optimal response of the followers [
12]; complex Laplacian technique where weighted edges are employed to represent the relative positioning of robots in a 2D plane, with the condition that for achieving a desired formation the graph modeling the interaction must be 2-rooted [
13]; predictive control techniques focused on handling the future dynamics of both the leader and followers reducing computational load as each follower solves its own local optimization problem to minimize the difference between its current state and the desired position relative to the leader [
14]; Voronoi fast marching scheme which combines the advantages of Voronoi diagrams (safety) with the computational efficiency of the fast marching method and with this scheme a safe path for the leader is computed while the followers adjust their positions according to the leader maintaining a prescribed separation [
15]; tacit navigation methods which rely on local relative sensor data, rather than global data, to infer the leader’s path [
16]; genetic algorithms applied to optimize the multi-level decision-making in leader–follower schemes, where as in the predictive techniques the leader maximizes their objective while anticipating the optimal response of the followers [
17]; or the A* algorithm where the leader uses the A* to calculate the optimal route, while the followers track the leader’s position using local controllers (typically artificial potential fields), thus combining a global path planning with local tracking [
18,
19,
20], all of which are used in path planning and formation control for multi-agent systems.
In multi-agent systems, the leader–follower scheme is widely used with various approaches like the Virtual Train Model [
21], the Fast Marching algorithm [
15], or tracking algorithms [
22]. These methods aim to address common issues in the leader–follower scheme, such as trajectory tracking error accumulation when the distance between the leader and follower is large or when the leader makes sharp directional changes. Another important aspect of the leader–follower scheme is tracking the leader’s pose, which is usually achieved through two main approaches: visual measurements and odometry [
23].
This work proposes a dual approach to the A* algorithm for the leader–follower scheme; the main goal is to develop a robust algorithm to generate follower trajectories based solely on the leader’s linear acceleration (
Figure 1). Unlike many applications based on the A* algorithm that aim to plan the trajectory of a single robot by minimizing distances [
24,
25,
26,
27,
28,
29], this work introduces a leader–follower scheme that uses the eight-possibility star and measures the leader’s acceleration to determine the path the follower should take.
The algorithm’s robustness is sought about the initial and relative pose of the leader regarding the followers, so that the leader can be placed in any pose without needing a fixed frame of reference. The leader’s pose is tracked by measuring its acceleration with an inertial sensor and transmitting it to the followers within a finite set of possibilities, and the followers around it can replay its trajectory, velocity, and acceleration. Animals inspire this idea in flocks, litters, swarms, anthills, or packs, where a leader establishes the group’s direction and speed (
Figure 2).
While the conventional A* algorithm aims to minimize the cost of finding the best path for establishing a trajectory by minimizing distances, as shown in [
30] (which uses a dynamic window for multi-robot path planning), the proposed dual approach to the A* algorithm, although decision-making also involves choosing among eight options or cells, the goal is not to minimize distance; instead, the focus is on analyzing the direction of acceleration. Moreover, this modified A* algorithm is not used to plan a trajectory to avoid obstacles; rather, it is employed to plan a follower trajectory based on the leader’s acceleration.
Another comparison that could easily arise with this proposal is with the Bellman–Ford and Dijkstra algorithms [
31], whose objective is to find the shortest path from a single origin; however, this system differs from these algorithms in that it does not seek the shortest path by minimizing distance. The objective is to determine the direction of acceleration to infer the leader’s movement, with the added advantage that the leader can be at any position, since the system does not require a specific leader position to plan the follower trajectory.
Another element with which it can be compared is Breadth First Search (BFS), a graph traversal algorithm that has proven more suitable for parallel processing [
32,
33]. The BFS algorithm involves searching within a pre-established tree, set of nodes, or graph. In this case, this work is distinguished by the fact that the graph being traversed always has the same configuration; that is, there is only one configuration of eight possibilities, and the selection is made from that configuration each time.
The main advantage of the proposed algorithm is that it does not require a fixed orientation between the leader and the follower, which provides several benefits. The first is operational flexibility, which allows any robot in the group to act as the leader in its situation—that is, the one with the best position and greater autonomy. It also makes reconfiguring formations easy without the need to program complex routes. This is useful in industrial settings where it is necessary to prioritize loads based on position and exchange leadership based on the element with the best visibility, angle, or proximity to the goal position. Relying on inertial sensors reduces the need for infrastructure like GPS or markers for absolute positioning. Overall, this algorithm offers greater flexibility and lower operating costs for mobile or collaborative fleets, being especially beneficial in dynamic environments.
2. The Mathematical Model
A* algorithm is a search algorithm defined on a finite graph taking the form , where g(n) is the cost of the path from the node labeled with zero up to the last node labeled with n, and h(n) is a heuristic function that estimates the minimum cost path from node n to the goal.
Although A* algorithm is well-known and has been successfully applied in several path planning scenarios, it is still under investigation, in search of speed and optimality in its execution. In [
19], A* algorithm and its modifications are evaluated for stand-alone mobile robots in specific scenarios, focusing on computational time and path optimality. The performance of a heuristic approach to the eight-star algorithm for a stand-alone mobile robot is evaluated in [
20] with a focus on path planning cost. Another way to improve the efficiency of the eight-star method is by means of image processing techniques as shown in [
34] or by the jump search method and pruning as shown in [
35].
Here a dual approach to the A* algorithm is proposed, with the objective to generate consistent trajectories for a leader–follower scheme based only on the acceleration vectors of the leader’s trajectory. The operation of the algorithm is as follows.
As usual, consider the canonical unit vectors.
Let us consider a particle moving on the plane following a path parameterized by a curve
, where
. Assume
and
have continuous derivatives up to the second order on
. Let us consider the following situation: We know only a finite set of accelerations of the particle. As a result, the particle’s path can be estimated by using a polygonal in such a way that we can assume the particle is moving with constant accelerations on each line segment. To fix ideas, suppose that an IMU is placed on the particle, and the accelerations are recorded for each unit of time
for each nonnegative integer
. As a result, in the future, we will consider time to be discrete, and we can replace the
instant
simply by
. Let
be the acceleration obtained by an IMU at time
, then let
be the acceleration data from an IMU. Set the initial velocity as
and set the velocity at time
as
Let us estimate the velocity at the instant
assuming that the particle has constant acceleration between
and
. Hence, the rectangular coordinates of velocity at time k are given recursively by the equations
We shall also consider the magnitudes of velocity and acceleration; thus, we set
With
and
, we define our reference unit vectors as:
Such vectors can be visualized as
Figure 3 shows:
Now, define the real number
as
The number measures the greatest component of into the reference unit vectors; hence, chooses the closest direction among all the reference unit vectors to .
To effectively construct a displacement, we must introduce a control coefficient
defined as
In such manner, we define the displacement at time
as
Now, we can define recursively the positions of the particle on the path as follows. First, set
Hence, if
is defined, then set
We assert that the proposed algorithm in this work is a dual approach to the A* algorithm. To prove it, first define:
Each estimated path with
nodes is obtained, selecting
elements of
. Hence, the space of all possible paths with
nodes is the
-Cartesian product
. That is,
We define the cost to select
once we estimate
as
The previous equation permits us to define the total cost function
by
for each
in
. Recall that the proposed algorithm requires us to calculate:
Each
implies the existence of a unique
such that
. Thus, the sequence
defines a path
. We claim that
achieves its minimum value at
. In fact, let
be an arbitrary path, it follows by the definition of
that:
from which we obtain that
Inequality (23) proves the claim that the proposed algorithm is a dual model of the A* algorithm.
3. Test Patterns Simulations
To test the algorithm under different conditions, staggering the degree of complexity, it starts with simple geometry trajectories of a single pattern and later with more complex patterns, such as words. The first proposed geometry is a pinwheel shape:
This figure was generated using Matlab
® 2025 software by means of a time vector and its corresponding Equations (25) and (26) for the x and y point pairs; 2000 intermediate values were used.
From these expressions, the trajectory shown in
Figure 4a is derived. Once the pattern to follow is established, the second derivative with respect to time of these expressions is calculated to obtain only the acceleration components, Equations (27) and (28), simulating the linear acceleration measurement of an Inertial Measurement Unit, which results in:
This second derivative is normalized using a maximum function, and then Algorithm 1 from
Section 3 is executed:
| Algorithm 1 A* Dual Approach |
Basis vectors i = [1; 0] j = [0; 1] e0 = i e1 = (sqrt(2)/2)(i + j) e2 = j e3 = (sqrt(2)/2)(j − i) e4 = −i e5 = −(sqrt(2)/2)(i + j) e6 = −j e7 = (sqrt(2)/2)(i − j) Initialize the Array Point = matrixlength (length(ax), 8) mx = vectorlength(ax) r = vectorlength(ax) For k since 1:length(ax) v = [ax(1,k); ay(1,k)] Point(k,1) = dot(v, e0) Point(k,2) = dot(v, e1) Point(k,3) = dot(v, e2) Point(k,4) = dot(v, e3) Point(k,5) = dot(v, e4) Point(k,6) = dot(v, e5) Point(k,7) = dot(v, e6) Point(k,8) = dot(v, e7) mx(k) = max(k,:) r(k) = indicates where Point(k,:) == mx(k) End Initialize P as matrix 2 × length(A) with zeros l = 0 For o since 2 to length(r): l = l + 1 Select for r(l): case 1: P(:, o) = P(:, o − 1) + mx(o − 1) * e0 case 2: P(:, o) = P(:, o − 1) + mx(o − 1) * e1 case 3: P(:, o) = P(:, o − 1) + mx(o − 1) * e2 case 4: P(:, o) = P(:, o − 1) + mx(o − 1) * e3 case 5: P(:, o) = P(:, o − 1) + mx(o − 1) * e4 case 6: P(:, o) = P(:, o − 1) + mx(o − 1) * e5 case 7: P(:, o) = P(:, o − 1) + mx(o − 1) * e6 case 8: P(:, o) = P(:, o − 1) + mx(o − 1) * e7 End Normalize P P(1, :) = P(1, :) / maximum(abs(P(1, :))) P(2, :) = P(2, :) / maximum(abs(P(2, :))) Plot |
Figure 4a,b shows the reconstructed pattern using the algorithm for vector P. The reconstruction of this pattern demonstrates the algorithm’s ability to create curved trajectories that coincide at a central point. Observe that the pattern in
Figure 4 has the same morphology in its three helices. However, during reconstruction, the trajectory’s direction is estimated based on the orientation of the defined unit vectors. All figures were normalized to remove units; the normalization value was selected for each figure to make the morphology as stylized as possible, clearly highlighting the differences or similarities between the trajectory and the route.
The second pattern is a spiral (
Figure 5a) where the curvature gradually widens. This figure was generated using Matlab
® software by means of a time vector and its corresponding Equations (29) and (30) for the x and y point pairs; 1000 intermediate values were used. In this example, the algorithm can reconstruct the trajectory (
Figure 5b) with greater fidelity, the more closed the curve is. Observe that the fidelity of the reconstruction decreases when the radius of curvature increases; this is because the acceleration, Equations (31) and (32), in the plane of motion is more constant to the acceleration of a more closed curvature; when the acceleration has fewer changes, the estimate looks more like a straight line.
The third pattern is a trajectory with less curvature (
Figure 6a) to observe the reconstruction in areas that have more linear trajectories (
Figure 6b). This figure was generated using MATLAB software from a time vector and the corresponding Equations (33) and (34) for the x and y point pairs; 500 intermediate values were used.
The reconstruction trajectory is a set of straight lines with much more abrupt changes for curves whose morphology is similar to a tracked trajectory. Still, it is more convenient to facilitate the control of the follower over the leader when using simple configurations such as the differential.
Subsequently, a more complex pattern (
Figure 7a) was worked on when rebuilding a line (
Figure 7b) with many twists and turns. This pattern was created as follows: the word
love was plotted on graph paper, and the
x and
y coordinates were recorded. Then, this vector was differentiated twice by calculating the differences between adjacent values twice. Using the points from the difference calculation, the A* dual approach from
Section 3 was applied, resulting in the patterns shown in
Figure 7. We developed this test to push the algorithm to its limits, creating a pattern with curvatures and connections resembling cursive writing and exploring applications such as handwriting. In this composite figure, observe that in the case of simple curvatures such as the letter l and the letter v, the reconstruction of the algorithm is accurate, sticking more faithfully to the original stroke, while in the case of the vowels e and o, crossing the exact points of coincidence where the trajectory overlaps and there are abrupt changes, the reconstruction moves away from the original path.
It is important to note that this algorithm is based on the eight-way star diagram, similar to the traditional A* algorithm. However, they are not directly comparable because the star diagram is not used for optimal route planning but to approximate the leader’s trajectory based solely on its linear acceleration. The original A* algorithm relies on knowing the initial position, which is unavailable here because the focus is solely on linear acceleration. This simplifies the sensing system by eliminating the need-to-know details of the propulsion system, such as tires or tracks.
Another observable element is that the complexity of the tests increased gradually; in the first test, 2000 samples were used, followed by 1000 samples in the second, 500 in the third, and finally, a unit time increment was applied. This demonstrates the algorithm’s ability to adapt to different sampling scenarios and varied intervals.
The main advantage of this algorithm is that it reduces measurement interference at the leader because it does not depend on the relative position between the leader and the follower; in other words, the leader does not need to be in front of the follower. Another benefit is that it is unaffected by wheel or track slippage, as it requires only knowledge of the movement’s acceleration, not its position.
4. Experimental Patterns
Once the algorithm had been tested against theoretical patterns, it was tested with two experiments. The first experiment involved an autonomous car with a pre-loaded trajectory, acting as a leader. Its linear acceleration data was collected and then sent to the reconstruction algorithm to get the original trajectory. The second experiment consisted of a leader with a completely random route; in this case, a person walking acted as the leader and carried an accelerometer. The follower was a vehicle with an Ackerman configuration that determined its route based on the tracking algorithm’s results from the mathematical model in
Section 3. The experiments were performed at a sampling frequency of 10 Hz and over a 2 G range. In the first experiment, the car moved on a ceramic floor, and in the second experiment, it was performed on a cement slab of a basketball court.
The first experiment is the vehicle with a differential configuration shown in
Figure 8a with a preloaded trajectory (
Figure 8b). The vehicle’s purpose is to travel the marked trajectory. The vehicle’s electronic system comprises an MPU5060 sensor to measure linear acceleration, an ESP32 card as the master to read accelerometer data, a battery voltage regulator, and controller cards for the motors. The vehicle’s route begins at the start marker in
Figure 8b and ends at the finish marker in the same figure. The vehicle’s direction of movement is as indicated by the path in
Figure 8b. This vehicle is programmed to follow the path of the red line in
Figure 8b. With the linear acceleration sensor (MPU6050) placed at the top, the linear acceleration of the leader, in this case, the vehicle, is sensed, and the data is sent to a computer that has the task of reconstructing the vehicle’s route; the result of the reconstruction using the mathematical model of
Section 3 is shown in
Figure 9.
Note that the vehicle’s movement is entirely autonomous. That is, this vehicle is a leader. The reconstructed trajectory is that of
Figure 9; said trajectory is the one that the followers should reproduce. Observe that the initial curvature of the starting point (Zone A,
Figure 8b) and the last pronounced curve (Zone B,
Figure 8b) are similar in concavity to the intermediate part of the trajectory, and the reconstruction (
Figure 9) traces a trajectory of similar morphology. In contrast, the straight areas of the trajectory are reconstructed with the same trend.
In this second experiment, it was observed that the follower’s direction is easier to control in the Ackerman configuration because the follower’s radius of gyration does not allow trajectory changes to be as abrupt as in a differential configuration. So, the probability of establishing a course using only the top of the star is higher. In this experiment, it is notable that the person can walk to the right, left, and even behind the follower, and the follower can follow the leader’s path.
The evaluation of trajectory consistency in experimental tests still needs to be done from a spatial location perspective, as only the leader’s acceleration is currently measured. This is because the work occurs in an open, uncontrolled environment without a predefined map, such as the grid mapping used in the conventional A* algorithm. This is a current limitation of the experimental setup.
The experiment is set up in a scenario where the leader is either a remotely controlled mobile robot or a person guiding follower robots. In this setup, the leader’s exact spatial position is unknown; only its acceleration is measured. Based solely on this measured acceleration, the followers are instructed to imitate the leader’s path.
5. Deviation Between the Leader’s and Follower’s Routes
To calculate the deviation between the leader’s trajectory and the follower’s trajectory, the deviation was calculated by 37 and 38:
, are the ideal coodinates, while , are the coordinates the algorithm estimated, and is the number of samples. While is the deviation on the and is the deviation on the .
As shown in
Table 1, a significant error is observed in x in the case of the pinwheel. This occurs because, near the intersection of the three wings, the curves tend to become straight lines with slopes 0/0.5. In this figure, the algorithm is unable to reproduce the smoothness of the stroke at the triple intersection. However, what truly causes the deviation in the x-axis to increase by up to two orders of magnitude compared to the y-axis is that, in the left part of the figure where the pinwheel’s petal is longer, the algorithm assumes the same acceleration direction along nearly the entire length of the petal, completely ignoring the upper and lower curvature, which causes the error to skyrocket. In the case of the spiral, the algorithm’s behavior improves significantly; the error is lower than for the other figures on both axes. This is because the radius of curvature increases and changes direction closer to the star. For the open trajectory pattern, the problem occurs around the most extended trajectory, where a change in slope is almost invisible to the eye, since the algorithm approximates it in two sections that differ significantly. Note that both for the open path in its longest section and for the pinwheel in its longest petal, where the algorithm approximates a shallow curve with the same straight line, the deviation between the paths skyrockets, revealing a limiting element of the algorithm. In the case of the pattern of the word love, a similar error is observed at the pinwheel; in the area where the points intersect to form the letter l, the approximation fails and causes the error to be more significant. This helps us identify two limiting factors of the algorithm: when a curve overlaps itself and when the curve has low curvature, approaching a straight line.
6. Discussion
The algorithm can generate consistent trajectories in real time without requiring the leader and follower to be coincident in orientation, and it is not necessary for the leader to always be in front of the follower or the cluster of followers, since the algorithm is invariant to this characteristic.
This algorithm is for cases in which the leader has extremely random trajectories, and the field of movement is vast due to its wide operational versatility, since it does not depend on environmental variables such as lighting or on systems of perception to locate the leader. For example, a reconstruction consistent with the spiral pattern is observed, which has a gradually increasing change in curvature, as seen in
Figure 12.
It would be possible to identify each letter or stroke by measuring deviations. If it is possible to estimate a normal distribution, it would likely be possible to correct the algorithm to predict the trace based on the first k-traces. In the future, an algorithm could be proposed to identify and predict the user’s stroke.
Limitations were observed in the algorithm, such as when a route overlaps itself; the algorithm has difficulty reconstructing it, and the reconstructed path results in a displacement, as shown in
Figure 13 and
Figure 14. This also explains the greater deviation in the results of
Table 1.
Following initial theoretical tests, the reconstruction algorithm was validated in two practical leader–follower scenarios. In the differential vehicle experiment, the reconstructed trajectories retained the main morphological features of the primary path: the concavities in the curved zones A and B, and the straight segments maintained their trend. This shows that the mathematical model accurately captures the overall shape of the trajectory from linear acceleration data at 10 Hz/±2 g under consistent motion conditions and with low noise.
The experiment with a human-guided vehicle demonstrated its real-time applicability and robustness to the most variable and unrestricted leader movements, including lateral movements and even those behind the follower.
The quantitative errors expose the systematic limitations of the algorithm. The significant deviations along the x-axis of the spiral pattern and the failures at self-intersections—for example, the pattern center and the letter “l” in the word pattern—highlight that the model struggles when the curvature changes rapidly or when overlapping trajectories produce ambiguous acceleration signals. Likewise, long, shallow curves are approximated as straight segments, leading to large deviations when small slope changes are not captured at the given resolution. The relatively low error in the spiral pattern indicates that performance improves when the curvature changes more gradually and smoothly.
The preservation of the overall trajectory morphology, real-time viability at 10 Hz, and practical operability with both mechanical and human guides are key advantages. Limitations include sensitivity to low-curvature segments when they are nearly straight, an inability to resolve overlapping or self-intersecting curves, and observed anisotropic errors, suggesting that the model’s assumptions about acceleration direction and segmentation introduce bias.
This proposal has some limitations, both theoretical and practical. Theoretically, when the leader follows a trajectory overlaid on itself, the follower can do the same; however, the crossing point is delayed or advanced depending on the acceleration curvature of the original trajectory, as shown in
Figure 13, where the trajectory crossings are shifted. In practice, it is observed that when the follower has a large turning radius, the leader must move at low speeds to maintain tracking; otherwise, the follower cannot reproduce the leader’s sudden changes in direction. On another note, the main advantage of this approach is that it does not require knowledge of the leader’s exact trajectory; only its linear acceleration is needed. This provides a significant benefit in cases of wheel slippage or when machine vision cannot be used due to environmental conditions and limited power.
7. Conclusions
This work aims to demonstrate that a dual approach to the A* algorithm can generate a trajectory with sufficient fidelity to the leader for the followers.
The algorithm creates a trajectory described by the superposition of unit vectors. Because trajectories are standardized, teleoperated controls for assistive robotics, online writing applications, collaborative robotics, etc., can be implemented. One element that affects the algorithm’s performance is the friction that the vehicles present with the ground since these distance their natural behavior from the mathematical model. Another factor that contributes to increasing the deviation between the real curve and the ideal one is the different nature of the systems that reproduce it; for example, for the perfect traces generated in simulation, a clearer closeness is observed between the two curves, while when the trajectory is carried out with the vehicle, various factors influence the phenomenon. For example, the speed at which the car moves versus the sampling speed of its acceleration is relevant; another important factor is the turning radius of the following vehicle, since although it is observed in the example of the person and the car with Ackerman steering to be successful, it is necessary to measure the speed at which one walks concerning the reaction capacity of the following vehicle.
The reconstruction algorithm effectively recovers the main shape of the leader’s trajectories from linear acceleration measurements taken at 10 Hz/±2 g, making it suitable for real-time leader–follower applications with both robotic and human leaders.
Ackerman-configured trackers provide better controllability and smoother tracking than differential trackers. However, the movement must be slower and more steady for the Ackerman configuration to trace curves, as the turning radius is considerably larger.
The primary failure modes include overlapping trajectories, in which acceleration signals become ambiguous, and long, low-curvature segments, in which the algorithm approximates smooth curves with straight lines, leading to significant positional errors. To enhance accuracy, future work should focus on increasing temporal and spatial resolution or implementing multisensory fusion, such as adding a gyroscope, magnetometer, or visual odometry. Incorporating curvature-sensitive segmentation or adaptive modeling can also help better manage smooth and rapidly changing curvatures, while developing disambiguation strategies for intersecting trajectories—such as using prior map or context information or additional sensors—is advisable. With these enhancements, the method demonstrates clear potential for low-cost, real-time trajectory transmission and follower control in robotics and human–robot interaction environments.