A Graph-Based Hybrid Reconfiguration Deformation Planning for Modular Robots

The self-reconfigurable modular robotic system is a class of robots that can alter its configuration by rearranging the connectivity of their component modular units. The reconfiguration deformation planning problem is to find a sequence of reconfiguration actions to transform one reconfiguration into another. In this paper, a hybrid reconfiguration deformation planning algorithm for modular robots is presented to enable reconfiguration between initial and goal configurations. A hybrid algorithm is developed to decompose the configuration into subconfigurations with maximum commonality and implement distributed dynamic mapping of free vertices. The module mapping relationship between the initial and target configurations is then utilized to generate reconfiguration actions. Simulation and experiment results verify the effectiveness of the proposed algorithm.


Introduction
Self-reconfigurable modular robots represent a novel class of robots that can autonomously change their own shape by rearranging the connectivity of their component parts [1].This ability to dynamically reconfigure opens up new possibilities for adaptability and versatility in robot systems [2].A fundamental problem to achieve the ability is the reconfiguration deformation planning problem.The problem can be summarized as follows: given an initial configuration and a goal configuration, find a sequence of module moves that will reconfigure the robots from the initial configuration to the goal configuration [3].
Based on the different module unit structures and kinematic pairs, modular selfreconfigurable robots can be classified into three types: lattice-type, chain-type, and mobiletype.In lattice-type structures, the module units mostly have regular geometric shapes, are positioned in lattice points, and reconfigure by interacting with adjacent lattice points [4][5][6][7].However, lattice-type modular robots face challenges in generating autonomous locomotion in dynamic environments due to inherent structural constraints.For chain-type modular robots, the modules do not require regular geometric shapes.Multiple modules can connect to form hyper-redundant chain structures, which provide the system overall with mobility capabilities.There are already many research studies on chain-type robotic systems, such as [8][9][10][11][12].The mobile-type modular robotic system, in which each single module robot has independent movement capability, moves between modules to reconfigure in a dynamic environment.Some mobile-type robotic systems were developed in the past few years, such as [13][14][15].
The problem of deforming a modular robot autonomously from an initial to a goal configuration via motion actions on a module level is referred to as the Reconfiguration Deformation Problem.Due to constraints imposed by the modules' own structures, such as mobility degrees of freedom, number and compatibility of docking mechanisms, and physical connection constraints between multi-module units, the system has complex constraints that make reconfiguration deformation planning more than just simple path 1.
A graph theory-based graphical representation is utilized to describe the topology of modular robots.A distributed configuration recognition algorithm is proposed that uses the connection information between modules to identify the topological configuration of the robot system and generate a graph-based tree description; 2.
A hybrid algorithm is developed to segment configuration into multiple subconfigurations, which share maximum common subconfigurations between initial and goal configurations, and implement the distributed dynamic mapping of free vertices; 3.
A reconfiguration action generation method is proposed that utilizes the module mapping relationship in order to achieve reconfiguration.
The remainder of this paper is organized as follows.Section 2 provides an introduction to the hardware platform and simulation model.The graph-based representation and configuration recognition algorithm are explained in Section 3. Section 4 then presents the reconfiguration planning algorithm.Next, Section 5 shows the simulation and results.Section 6 shows the simulation result analysis.Section 7 provides an experiment in the real world.Finally, Section 8 discusses the conclusions and potential future work.

Hardware Platform
The MMRP (Modular Mobile Reconfigurable Platform) system [20] is a modular robotic system where each module is a complete mobile tracked robot with four connected arms as shown in Figure 1, containing onboard sensors, an STM32 microcontroller, a UWB positioning unit, and a 2.4 GHz NRF24L01 transceiver unit.
A cam-ball-type connection mechanism as shown in Figure 2, comprising an active connector and a passive connector, performs docking and undocking functions between modules.
Each MMRP module contains four docking faces (Top, Bottom, Left, and Right), with two active connectors located on the Top and Right faces, as well as two passive connectors located on the Bottom and Left faces.The connected faces are able to exchange data via contact point by serial communication.A cam-ball-type connection mechanism as shown in Figure 2, comprising an active connector and a passive connector, performs docking and undocking functions between modules.

Graph-Based Topology Representation
The modular reconfiguration and transformation task for modular robots can be described as follows: Given an initial configuration, each module undergoes a series of motions (including changes in position and reconfiguration of connections) to form a specified goal configuration.The research problem lies in mapping and allocating the start and end positions and connection states of each module between the initial and goal configurations.Graph-based topology representation can clearly express the compositional configuration relationships between modules in a modular robotic system.In particular, a modular robot configuration can be represented as an undirected graph ( , ) , where V is a set of vertices of the graph representing the modules and E is a set of edges rep- resenting the connections between two modules in V .In graph theory, a tree is an undi- rected graph in which any two vertices are connected by exactly one path, or equivalently a connected acyclic undirected graph [21].Due to the inherent nature of modular robots A cam-ball-type connection mechanism as shown in Figure 2, comprising an active connector and a passive connector, performs docking and undocking functions between modules.

Graph-Based Topology Representation
The modular reconfiguration and transformation task for modular robots can be described as follows: Given an initial configuration, each module undergoes a series of motions (including changes in position and reconfiguration of connections) to form a specified goal configuration.The research problem lies in mapping and allocating the start and end positions and connection states of each module between the initial and goal configurations.Graph-based topology representation can clearly express the compositional configuration relationships between modules in a modular robotic system.In particular, a modular robot configuration can be represented as an undirected graph ( , ) , where V is a set of vertices of the graph representing the modules and E is a set of edges rep- resenting the connections between two modules in V .In graph theory, a tree is an undi- rected graph in which any two vertices are connected by exactly one path, or equivalently a connected acyclic undirected graph [21].Due to the inherent nature of modular robots

Graph-Based Topology Representation
The modular reconfiguration and transformation task for modular robots can be described as follows: Given an initial configuration, each module undergoes a series of motions (including changes in position and reconfiguration of connections) to form a specified goal configuration.The research problem lies in mapping and allocating the start and end positions and connection states of each module between the initial and goal configurations.Graph-based topology representation can clearly express the compositional configuration relationships between modules in a modular robotic system.In particular, a modular robot configuration can be represented as an undirected graph G = (V, E), where V is a set of vertices of the graph representing the modules and E is a set of edges representing the connections between two modules in V.In graph theory, a tree is an undirected graph in which any two vertices are connected by exactly one path, or equivalently a connected acyclic undirected graph [21].Due to the inherent nature of modular robots (e.g., a module cannot connect to itself to form a self-loop), it is reasonable and convenient to represent configurations as trees.When there are closed-loop structures between several modules in the initial or target configurations, one edge of the closed-loop should be converted into a virtual connection to transform the configuration into an acyclic configuration.Therefore, this paper assumes all configurations are acyclic configurations.
Once a configuration represented by a tree graph G = (V, E) is described, a special vertex v 0 ∈ V can be designated as the root of the tree graph G = (V, E).At this point, G = (V, E) is a rooted tree graph with v 0 as the root.In a rooted tree G = (V, E), the parent of a vertex v ∈ V is the vertex connected to v on the path to the root and every vertex has a unique parent except the root, which has no parent.A child of a vertex v is a vertex of which v is the parent.In a tree graph, any vertex can be designated as the root, but in order to ensure the efficiency of the reconfiguration algorithm discussed below, a special vertex that serves as the root is essential to maximize traversal efficiency, i.e., the center point of the tree graph.
Theorem 1.The center of an acyclic graph always exists.It is a unique vertex or a unique pair of adjacent vertices such that removing that vertex (or pair of vertices) from the graph leaves a collection of components each having less than half of the vertices [22].
Given a tree G composed of n vertices and a random vertex v of G, G − v is the set of all rest components after removing v from the tree G.According to Theorem 1, v is the center vertex (root) if and only if G − v has no components composed of vertex numbers more than n/2.
Each MMRP robotic module has four docking faces.Connecting two unit modules via different faces results in different system configurations.Therefore, the corresponding docking face relationships between connected unit modules must also be considered.

Definition 1.
A connection between a parent vertex u's connector face F u and its child vertex v's connector face F v is defined as follows: For vertex v, and form the perspective of v, its parent, which is connected via v's connector face, F is denoted as and the mating connector face of Figure 3 shows an example of the connection between v 2 and its parent vertex v 0 .The connection shown in Figure 3 is connect(0L, 2R).From the perspective of vertex v 2 , its parent vertex connected via the v 2 's R face should be denoted as R , which corresponds to vertex v 0 in the global view.
uration.Therefore, this paper assumes all configurations are acyclic configurations.
Once a configuration represented by a tree graph ( , ) G V E = is described, a special vertex 0 v V ∈ can be designated as the root of the tree graph ( , ) G V E = .At this point, ( , ) G V E = is a rooted tree graph with 0 v as the root.In a rooted tree ( , ) G V E = , the parent of a vertex v V ∈ is the vertex connected to v on the path to the root and every vertex has a unique parent except the root, which has no parent.A child of a vertex v is a vertex of which v is the parent.In a tree graph, any vertex can be designated as the root, but in order to ensure the efficiency of the reconfiguration algorithm discussed below, a special vertex that serves as the root is essential to maximize traversal efficiency, i.e., the center point of the tree graph.
Theorem 1.The center of an acyclic graph always exists.It is a unique vertex or a unique pair of adjacent vertices such that removing that vertex (or pair of vertices) from the graph leaves a collection of components each having less than half of the vertices [22].
Given a tree G composed of n vertices and a random vertex v of G , G v − is the set of all rest components after removing v from the tree G .According to Theorem 1, v is the center vertex (root) if and only if G v − has no components composed of vertex numbers more than / 2 n .Each MMRP robotic module has four docking faces.Connecting two unit modules via different faces results in different system configurations.Therefore, the corresponding docking face relationships between connected unit modules must also be considered.

Definition 1.
A connection between a parent vertex u 's connector face u F and its child vertex v 's connector face v F is defined as follows: For vertex v , and form the perspective of v , its parent, which is connected via v 's connector face, F is denoted as F v  and the mating connector face of F v  is F  .Since the MMRP modules have heterogeneous docking mechanisms requiring an active docking face to connect with a passive face, there are only four viable connection arrangements: connect(uT,vB), connect(uL,vR), connect(uT,vL), and connect(uR,vB) between modules u and v .Connections connect(uT,vL) and connect(uR,vB) result in motion self-locking between the two connected modules.Therefore, in the MMRP system, connections are only available between the Top and Bottom faces and between the Left and Right faces.Since the MMRP modules have heterogeneous docking mechanisms requiring an active docking face to connect with a passive face, there are only four viable connection arrangements: connect(uT,vB), connect(uL,vR), connect(uT,vL), and connect(uR,vB) between modules u and v. Connections connect(uT,vL) and connect(uR,vB) result in motion selflocking between the two connected modules.Therefore, in the MMRP system, connections are only available between the Top and Bottom faces and between the Left and Right faces.

Configuration Recognition
After multiple modules are connected to form the initial configuration, the current topological configuration needs to be automatically identified, and a graph representation of the current configuration should be generated to facilitate subsequent reconfiguration planning.The modular robots connect to each other via docking mechanisms to form a tree graph topological structure.The surface of the docking mechanisms integrates contact point serial communication units, enabling half-duplex data interaction between adjacent parent-child modules.The parent-child relationships form the basis of the tree graph topological structure.By determining the parent-child relationships between adjacent modules and their corresponding connection relationships, the positions and orientations of the modules can be identified, allowing recognition and representation of the overall topo-Sensors 2023, 23, 7892 5 of 18 logical configuration.A configuration recognition algorithm that utilizes the distributed connection information between modules is proposed.
The input to this algorithm is all the modules comprising the current configuration.The output is the connection relationships between the modules in the current configuration.The basic idea is to use breadth-first search order starting from any non-leaf vertex module in the configuration to iteratively identify the parent-child connection relationships layer by layer, successfully recognizing the configuration when all leaf vertices are traversed.This configuration recognition progress can be finished in time O(|V|).The flowchart is shown in Figure 4.
planning.The modular robots connect to each other via docking mechanisms to form a tree graph topological structure.The surface of the docking mechanisms integrates contact point serial communication units, enabling half-duplex data interaction between adjacent parent-child modules.The parent-child relationships form the basis of the tree graph topological structure.By determining the parent-child relationships between adjacent modules and their corresponding connection relationships, the positions and orientations of the modules can be identified, allowing recognition and representation of the overall topological configuration.A configuration recognition algorithm that utilizes the distributed connection information between modules is proposed.
The input to this algorithm is all the modules comprising the current configuration.The output is the connection relationships between the modules in the current configuration.The basic idea is to use breadth-first search order starting from any non-leaf vertex module in the configuration to iteratively identify the parent-child connection relationships layer by layer, successfully recognizing the configuration when all leaf vertices are traversed.This configuration recognition progress can be finished in time ( ) O V .The flowchart is shown in Figure 4.All modules in the current configuration simultaneously start detecting the connection status of their own connection faces.Modules with only one connected face are identified as leaf modules.The communication ports of all connected faces are switched to Receiving Mode.Among non-leaf modules, one module is randomly selected to start sending configuration identification information, including its own ID and the ID of its current connected face.For a module with n total connected faces, after 1 n − connected faces receive the information, the remaining unreceived connection face switches to Sending Mode to continue transmitting the information.After all leaf modules receive the data, each module has collected the parent-child connection relationships and corresponding connection face information of the modules in the configuration.This information can be uploaded to the host computer to construct a graphical representation of the current configuration.Compared to the configuration recognition algorithm designed in [11], this algorithm only needs to detect the traversal results of leaf vertices to determine the convergence state of the configuration recognition process, which improves the efficiency of detecting the convergence state.All modules in the current configuration simultaneously start detecting the connection status of their own connection faces.Modules with only one connected face are identified as leaf modules.The communication ports of all connected faces are switched to Receiving Mode.Among non-leaf modules, one module is randomly selected to start sending configuration identification information, including its own ID and the ID of its current connected face.For a module with n total connected faces, after n − 1 connected faces receive the information, the remaining unreceived connection face switches to Sending Mode to continue transmitting the information.After all leaf modules receive the data, each module has collected the parent-child connection relationships and corresponding connection face information of the modules in the configuration.This information can be uploaded to the host computer to construct a graphical representation of the current configuration.Compared to the configuration recognition algorithm designed in [11], this algorithm only needs to detect the traversal results of leaf vertices to determine the convergence state of the configuration recognition process, which improves the efficiency of detecting the convergence state.
As discussed in Section 3.1, when a configuration is described as a tree graph, this tree graph must have one (or a pair) of central vertices serving as the root of the tree.A distributed method is proposed in [23] using the connection information between adjacent modules to find the root of a tree graph.This method requires coordinating the information transmission sequence between modules, and each module needs to complete a full graph traversal to obtain the number of all its child modules.For configurations with a large number of modules, the efficiency of this algorithm will be greatly reduced.Therefore, a centralized algorithm is adopted that sequentially removes non-leaf vertices from the tree graph on the PC side, calculates the number of vertices in each acyclic subgraph of the remaining graph, and locates the root node meeting the criteria.
Once the configuration graph G = (V, E) and its root node τ are determined, the parent-child relationships between any node v in the configuration will also be determined.The configuration can be viewed as the result of iterative growth from the root node τ layer-by-layer until the leaf vertices, as shown in Figure 5.In a rooted tree, the height of a vertex is defined as the length of the longest downward path from that vertex to a leaf.The root τ has the maximum height equivalent to the height of the tree, while leaf vertices have a height of 0.
mation transmission sequence between modules, and each module needs to complete a full graph traversal to obtain the number of all its child modules.For configurations with a large number of modules, the efficiency of this algorithm will be greatly reduced.Therefore, a centralized algorithm is adopted that sequentially removes non-leaf vertices from the tree graph on the PC side, calculates the number of vertices in each acyclic subgraph of the remaining graph, and locates the root node meeting the criteria.
Once the configuration graph ( , ) G V E = and its root node τ are determined, the parent-child relationships between any node v in the configuration will also be determined.The configuration can be viewed as the result of iterative growth from the root node τ layer-by-layer until the leaf vertices, as shown in Figure 5.In a rooted tree, the height of a vertex is defined as the length of the longest downward path from that vertex to a leaf.The root τ has the maximum height equivalent to the height of the tree, while leaf vertices have a height of 0.

Reconfiguration Planning Algorithm
According to the configuration identification method described in Section 3.2, the current and target configurations can be represented as ( , ) ( , ) respectively.The first step in configuration matching is to determine whether the goal configuration can be reconfigured from the current configuration.For the robotic system in this paper, each unit module has independent mobility, so it only needs to be determined that the goal configuration has the same number of unit modules as the current configuration, i.e., g c V V = .After confirming the configuration reconfiguring requirement is met, further configuration reconfiguration can be performed.There are various metrics to measure the efficiency of configuration reconfiguration strategies, such as minimizing the total movement distance of all modules or minimizing the number of reconnections.In practical applications, the docking process often involves time-consuming behaviors such as alignment correction and operating the connection mechanisms.Therefore, the reconfiguration strategy aims to maximize the reduction in reconnections between modules as much as possible, thereby improving overall reconfiguration efficiency.The core idea of our proposed reconfiguration algorithm is thus finding the maximum common subgraph (MCS) isomorphism between the initial and goal configurations, reducing the number of modules involved in docking operations during reconfiguration.

Reconfiguration Planning Algorithm
According to the configuration identification method described in Section 3.2, the current and target configurations can be represented as G c = (V c , E c ) and G g = (V g , E g ), respectively.The first step in configuration matching is to determine whether the goal configuration can be reconfigured from the current configuration.For the robotic system in this paper, each unit module has independent mobility, so it only needs to be determined that the goal configuration has the same number of unit modules as the current configuration, i.e., V g = V c .After confirming the configuration reconfiguring requirement is met, further configuration reconfiguration can be performed.
There are various metrics to measure the efficiency of configuration reconfiguration strategies, such as minimizing the total movement distance of all modules or minimizing the number of reconnections.In practical applications, the docking process often involves time-consuming behaviors such as alignment correction and operating the connection mechanisms.Therefore, the reconfiguration strategy aims to maximize the reduction in reconnections between modules as much as possible, thereby improving overall reconfiguration efficiency.The core idea of our proposed reconfiguration algorithm is thus finding the maximum common subgraph (MCS) isomorphism between the initial and goal configurations, reducing the number of modules involved in docking operations during reconfiguration.

Definition 2. Given two graph-based representations of modular robot configurations
thatG c and G g are isomorphic.The corresponding bijective mapping of vertices and edges is defined as f : ), the common subconfiguration with maximum common connections is called the Maximum Common Subconfiguration, with respect to v c and v g denoted as MCS(v c , v g ) with mapping f : To find the MCS, a DFS search algorithm is utilized, starting from the root to sequentially compare the docking face information of connected modules.This obtains the MCS(v 1 , v 2 ) between G c and G g relative to v 1 and v 2 .Figure 6 shows an example of the common subconfiguration and MCS between two configurations.
with mapping : ( , ) ( , ) To find the MCS, a DFS search algorithm is utilized, starting from the root to sequ tially compare the docking face information of connected modules.This obtains

Configuration Decomposition
When modular robots perform reconfiguration tasks, to reduce the number of m ules involving docking operations to ensure reconfiguration efficiency, the initial and g configurations need to be decomposed.The configurations are broken down into a m mum common subgraph with the most shared connection relationships between the tial and target configurations, along with several remaining subgraphs.
For a modular robot performing a reconfiguration task, let the initial and goal c figurations be ( , ) and potentially a set of detached free module vert

Configuration Decomposition
When modular robots perform reconfiguration tasks, to reduce the number of modules involving docking operations to ensure reconfiguration efficiency, the initial and goal configurations need to be decomposed.The configurations are broken down into a maximum common subgraph with the most shared connection relationships between the initial and target configurations, along with several remaining subgraphs.
For a modular robot performing a reconfiguration task, let the initial and goal configurations be G c = (V c , E c ) and G g = (V g , E g ), respectively, with root modules τ c and τ g .The maximum common subgraph of G c and G g , relative to τ c and τ g MCS(τ c , τ g ) under the mapping f : (V c , E c ) → (V g , E g ) where V c ⊆ V c and V g ⊆ V g can be efficiently found, and denoted as G c = (V c , E c ). Subtracting the MCS subconfiguration G c from the initial configuration G c will generate a set of disconnected subgraphs

Matching and Mapping between Subconfigurations
After decomposition of the initial configuration ( , ) G  , and ˆj c V (suppose free vertices are present).Similarly, the goal con uration ( , ) , and ˆg V β after decomposition.

Matching and Mapping between Subconfigurations
After decomposition of the initial configuration , and Vj c (suppose free vertices are present).Similarly, the goal configuration g , and Vβ g after decomposition.All the modules in G c and G g belong to the MCS(τ c , τ g ), and have a one-to-one mapping relationship between them under mapping f : . .n com- posed of multiple subconfigurations, each subconfiguration G i c can be expressed as a tree rooted with central node τ α g .Similarly, each G α g can be expressed as a tree rooted with τ α g .Therefore, the isomorphic parts between the subconfigurations of the initial and goal configurations can be computed by sequentially finding the MCS( τ i c , τ α g ), completing the relational mapping of the modules comprising the isomorphic graphs.
However, if MCS( τ i c , τ α g ) is searched sequentially between G i c and G α g , it will require i × α attempts.This may also find a large number of isomorphic mappings consisting of only a small number of nodes, which is not very meaningful for overall configuration mapping and will greatly reduce reconfiguration planning efficiency.Therefore, a height-adjacent matching search rule is proposed to reduce the number of search attempts.

Subconfigurations eligible for MCS search must satisfy the condition h( τ
The height-adjacent matching search rule states that for subconfiguration G i c in the current configuration with central node τ i c as its root, having height h( τ i c ), G i c can only search MCS with subconfigurations G α g that have either the same height as G i c or are within 1 layer of height difference, as shown in Figure 8.  ( ) ( ) , and   ).However, in reality, due to the height-adjacent matching search rule, this progress should be much smaller than the worst.Isomorphic configuration searching and mapping between subconfigurations is completed by iterating this process until every subconfiguration in G c or G g has been visited.At this point, if there are still unmatched subconfigurations existing, the connections between modules in G c are disconnected to make them free vertices, which are all merged into set Vc , and G g likewise.It is worth noting that at this point the number of vertices in set Vc equals the number in set Vg .After this, the successfully matched and mapped subconfigurations

Distributed Dynamic Mapping of Free Vertices
At this point, the current and goal configurations will consist of several isomorphic subconfigurations and free vertices, as shown in Figure 9a.By establishing a one-to-one mapping between the free vertices in ˆc V and ˆg V overall reconfiguration mapping plan from the initial configuration to the goal confi tion can be completed.This process must consider not only the travel efficiency of mo the current free vertex modules to the target locations, but also the computational which grows rapidly when there are a large number of free vertex modules.Contin centralized planning would reduce overall planning efficiency.Therefore, for this sta reconfiguration planning, a distributed dynamic mapping strategy using artificial f is proposed to solve the mapping problem from free vertices ˆc V to target vertice dynamically in a distributed way.
For vertices The attractive force denoted by a F  , from the vertex in ˆc V towards goal positi to attract the nearest free vertex to the position of ˆg V to form a mapping from ˆc V t . The force is calculated as is the Euclidean distance from the vertex i By establishing a one-to-one mapping between the free vertices in Vc and Vg , the overall reconfiguration mapping plan from the initial configuration to the goal configuration can be completed.This process must consider not only the travel efficiency of moving the current free vertex modules to the target locations, but also the computational load, which grows rapidly when there are a large number of free vertex modules.Continuing centralized planning would reduce overall planning efficiency.Therefore, for this stage of reconfiguration planning, a distributed dynamic mapping strategy using artificial forces is proposed to solve the mapping problem from free vertices Vc to target vertices Vg dynamically in a distributed way.
For vertices vg ∈ Vg , there exists a connection between vg and a subconfiguration G α g in the goal configuration that has completed subconfiguration mapping, and denoted as connect( vg ,v α g ) where vg ∈ Vg and v α g ∈ G α g , as shown in Figure 9b.Each vertex in Vg has at least one such connection, which determines the position of the vertex in Vg within the goal configuration.Since v α g exists in the MCS, the target positions of vertices in Vc are known.The target positions are broadcast to all vertex in Vc .Under an artificial forces field, the vertex in Vc automatically selects the nearest target position from its current position for matching.Since Vc and Vg have equal numbers of vertices, the vertices will ultimately form a one-to-one mapping f : Vc → Vg .In this process, three types of artificial forces are constructed: attractive force, repulsive force, and obstacle avoidance force.
The attractive force denoted by → F a , from the vertex in Vc towards goal position, is to attract the nearest free vertex to the position of Vg to form a mapping from Vc to Vg .The force is calculated as Sensors 2023, 23, 7892 10 of 18 where is the Euclidean distance from the vertex in Vc towards each goal position, and K a is the attractive force factor.
The repulsive force denoted by → F r is to push two free vertices away when their distance is less than the specified value.The force is calculated as where d v 1 ,v 2 is the Euclidean distance between any two free vertices in Vc , and K r is a repulsive force factor.
The obstacle avoidance force denoted by → F obs is to push free vertices away from isomorphic subconfigurations that are mapped already.And the force is calculated as where → d obs is the Euclidean distance from the free vertex to the subconfigurations.The obstacle avoidance force → F obs keeps the free vertices moving in a ring area around the robotic system.Combing the forces above, the resultant force (shown in Figure 10) acting on the free vertex is as follows: Sensors 2023, 23, x FOR PEER REVIEW 1 where is the Euclidean distance between any two free vertices in ˆc V , and K repulsive force factor.The obstacle avoidance force denoted by obs F  is to push free vertices away fro morphic subconfigurations that are mapped already.And the force is calculated as where obs d  is the Euclidean distance from the free vertex to the subconfigurations The attractive force a F  pulls the free vertex towards the nearest target point the repulsive force r F  pushes free vertices away to keep a safe distance avoidin sion.The obstacle avoidance force obs F  keeps the free vertices moving in a rin around the robotic system.Combing the forces above, the resultant force (shown in 10) acting on the free vertex is as follows: When all free nodes have reached their target positions, at this point, all vert the initial configuration and vertices in the goal configuration have a one-to-one ma The vertices belonging to the MCS satisfy mapping : ( , ) ( This progress can be finished in time ( )  O d , where d is the total distance of free v traveled.The free vertex moves simply by the resultant force acting on it without centralized planning.When a free node reaches its target position, the target position stops providing attractive force and the free vertex stops moving.This establishes a mapping f : vc → vg between vc and the corresponding vg represented by the target position node.
When all free nodes have reached their target positions, at this point, all vertices in the initial configuration and vertices in the goal configuration have a one-to-one mapping f : V c → V g .The vertices belonging to the MCS satisfy mapping f : (V c , E c ) → (V g , E g ) .This progress can be finished in time O(d), where d is the total distance of free vertices traveled.

Reconfiguration Action Generation based on Mapping
Once the Reconfiguration Mapping process is completed, corresponding reconfiguration actions can be determined.The mapping f : V c → V g provides the mapping relations that map each module and corresponding connection from the initial configuration G c = (V c , E c ) into the goal configuration G g = (V g , E g ).The reconfiguration actions can be generated by comparing the edge mappings of the corresponding mapped module pair between G c and G g .Under the mapping f : V c → V g , if a module pair (v c , v g ) where v c ∈ V c and v g ∈ V g is in any MCS during the mapping process meanwhile its corresponding parent module pair ( ) is in the same MCS, indicating that no reconfiguration action is needed for this connected module pair.Otherwise, ← v F g will be mapped to a unique vertex v c (which is not the parent vertex The reconfiguration actions will be generated by traversing all modules in G c .This process can be carried out in time O(|V c |).Following the complete traversal of all modules, the initial configuration G c will be transformed into the goal configuration G g via the execution of the reconfiguration actions computed by the planning algorithm.

Simulation
The reconfiguration algorithm is implemented in Python and validated in the robotics simulator CoppeliaSimEdu.A modular robotic system composed of 9 MMRP robots is simulated to reconfigure from an initial cross configuration to a probe configuration to validate the reconfiguration deformation planning method proposed in this paper.The initial and goal configurations are shown in Figure 11.

Simulation
The reconfiguration algorithm is implemented in Python and validated in the robotics simulator CoppeliaSimEdu.A modular robotic system composed of 9 MMRP robots is simulated to reconfigure from an initial cross configuration to a probe configuration to validate the reconfiguration deformation planning method proposed in this paper.The initial and goal configurations are shown in Figure 11.The first step involves running configuration recognition algorithm 1 to detect all connections in the initial configuration.Each module in the configuration detects the connection status of its own faces to identify the leaf modules, which are Modules 6, 7, 8, and 9.A non-leaf Module 2 is randomly selected to start discovering all the connections, and The first step involves running configuration recognition algorithm 1 to detect all connections in the initial configuration.Each module in the configuration detects the connection status of its own faces to identify the leaf modules, which are Modules 6, 7, 8, and 9.A non-leaf Module 2 is randomly selected to start discovering all the connections, and the sequence of discovering is shown in Table 1.The graph of initial cross configuration G c = (V c , E c ) can be built based on the above connections and messages.And the graph of goal configuration G g = (V g , E g ) can also be built.The initial and goal configuration topology graph-based representations are shown in Figure 12.With G c = (V c , E c ) and G g = (V g , E g ), the roots τ c and τ g can be computed.Root τ c corresponds to Module 1 in G c and root τ g corresponds to Module 1 in G g .According to graphs ( , ) ( , )

Vertex Mapping Edge Mapping
The result of configuration decomposition shown in Figure 13.According to graphs G c = (V c , E c ) and G g = (V g , E g ), MCS(τ c , τ g ) = MCS(1, 1) contains five modules, and the mapping relations are shown in Table 2. G c and G g are generated.

Vertex Mapping
Edge Mapping The result of configuration decomposition CS(G c , τ c , G g , τ g ) = CS(G c , 1, G g , 1) is shown in Figure 13.G  and

Vertex Mapping
) contains two modules and the mapping relations are shown in Table 3. Module 5 and Module 6 undock all connected faces to convert them into free vertices.Based on the mapping result, Module 4 and Module 8 move as a whole to the corresponding position to await subsequent steps.Free vertices Module 9 and Module 7 receive the target positions.Under the artificial potential field, they dynamically find the nearest target nodes and move to those positions and the mapping f : Vc → Vg is 7 → 5, 9 → 6 according to the simulation result.This process is shown in Figure 14.  4.     It should be noted that due to the need for further improvements in the current connection mechanism design and the limited number of fabricated connection arms, the angles of the connection rods relative to Modules 2 and 3 were manually adjusted in the experiment to represent different docking faces on the same module.The docking faces represented by the connection rods are marked in the figures.
Experiment results verify the effectiveness of the proposed algorithm.The main shortage discovered during the experiment was problems with the docking mechanism design.Since the MMRP platforms lack lateral mobility, the lateral docking between two modules requires manual adjustment of the relative angle between docking faces.Therefore, the optimization of the docking mechanism will be considered in future work.One proposed improvement is to add a radial joint to the connection arms, so that the active and passive faces can rotate 90° and −90°, respectively during lateral docking between two modules, enabling lateral docking functionality.

Conclusions
In this paper, a new reconfiguration deformation planning for modular robots is presented.Graph-based representations are utilized to model and recognize the topological It should be noted that due to the need for further improvements in the current connection mechanism design and the limited number of fabricated connection arms, the angles of the connection rods relative to Modules 2 and 3 were manually adjusted in the experiment to represent different docking faces on the same module.The docking faces represented by the connection rods are marked in the figures.
Experiment results verify the effectiveness of the proposed algorithm.The main shortage discovered during the experiment was problems with the docking mechanism design.Since the MMRP platforms lack lateral mobility, the lateral docking between two modules requires manual adjustment of the relative angle between docking faces.Therefore, the optimization of the docking mechanism will be considered in future work.One proposed improvement is to add a radial joint to the connection arms, so that the active and passive faces can rotate 90 • and −90 • , respectively during lateral docking between two modules, enabling lateral docking functionality.

Conclusions
In this paper, a new reconfiguration deformation planning for modular robots is presented.Graph-based representations are utilized to model and recognize the topological configuration of the modules based on distributed information.An available hybrid algorithm is developed to segment configuration into multiple subconfigurations, which share maximum common subconfigurations between initial and goal configurations and implement the distributed dynamic mapping of free vertices.The module mapping relationship between the initial and target configurations is utilized to generate reconfiguration actions to achieve reconfiguration between the configurations.Simulation and experiment verify the effectiveness of this algorithm.The reconfiguration deformation planning algorithm proposed in this paper has universal applicability across mobile-type modular self-reconfigurable robotic systems.
There are still several issues in this research that need to be further addressed in future work, such as optimizing the physical structure to resolve lateral docking limitations, coordinated motion control of multiple modules, and practical configuration planning for real-world engineering applications.Future work will focus on mechanical structure optimization, coordinated motion control, and navigation of connected modular robots in dynamic environments.Improving the algorithm's capability in handling Hamiltonian cycles in topological configurations will also be a direction for future research.

Figure 1 .
Figure 1.(a) An MMRP module with four docking faces-two active and two passive docking faces; (b) MMRP module simulated model in CoppeliaSim Edu (Version 4.1.0).

Figure 2 .
Figure 2. A pair of cam-ball-type connectors.Active connector on the left and passive connector on the right.Each MMRP module contains four docking faces (Top, Bottom, Left, and Right), with two active connectors located on the Top and Right faces, as well as two passive connectors located on the Bottom and Left faces.The connected faces are able to exchange data via contact point by serial communication.

Figure 2 .
Figure 2. A pair of cam-ball-type connectors.Active connector on the left and passive connector on the right.Each MMRP module contains four docking faces (Top, Bottom, Left, and Right), with two active connectors located on the Top and Right faces, as well as two passive connectors located on the Bottom and Left faces.The connected faces are able to exchange data via contact point by serial communication.

Figure 2 .
Figure 2. A pair of cam-ball-type connectors.Active connector on the left and passive connector on the right.

Figure 3
Figure 3 shows an example of the connection between 2 v and its parent vertex 0 v .The connection shown in Figure 3 is connect(0L, 2R) .From the perspective of vertex 2 v , its parent vertex connected via the 2 v 's R face should be denoted as 2 R v  , which corre-

Figure 5 .
Figure 5.A graph-based tree G = (V, E) rooted with τ.The height of the tree is h(τ) = 3.

.
Subtracting the MCS subconfigura c G from the initial configuration c G will generate a set of disconnected subgra } { ( , )| 1,2,

Figure 7 .
Figure 7. Configuration decomposition for initial configuration (a) and goal configuration (b).

2 cG  and 1 gG
 is available.Configuration matching starts with the subconfiguration k c G  with the highest level in the current configuration's set of subconfigurations c G  .forms a new pair of isomorphic subconfigurations denoted as { k c G , g G γ }.Then, the configuration decomposition process in Section 4.1 is repeated as ( , , , ) , g G γ ′  and free vertices ˆk c V , ˆg V γ .The newly generated k c G ′  is added to set g G  while ˆk c V is added to set ˆc V to participate in subsequent sub- configuration matching and mapping, and g G γ ′ , ˆg V γ likewise.For the worst conditions, this progress can be finished in time .However, in reality, due to the height-adjacent matching search rule, this progress should be much smaller than the worst.
Figure 8. Subconfigurations for G i c are encircled by "--" while G α g is encircled by "--".The heights of each subconfiguration are h( G 1 c ) = h( v c7 ) = 1, h( G 2 c ) = h( v c1 ) = 3, and h( G 1 g ) = h( v g1 ) = 3.The MCS searching between G 2 c and G 1 g is available.Configuration matching starts with the subconfiguration G k c with the highest level in the current configuration's set of subconfigurations G c .G k c performs isomorphic mapping with the subconfiguration G γ g from the goal configuration's set G g that meets the search rule, MCS( τ k c , τ γ g ) under mapping f : ( V c , E c ) → ( V g , E g ) can be computed.This forms a new pair of isomorphic subconfigurations denoted as {G k c , G γ g }.Then, the configuration decomposition process in Section 4.1 is repeated as CS( G k c , τ k c , G γ g , τ γ g ), generating new subconfigurations G k c , G γ g and free vertices Vk c , Vγ g .The newly generated G k c is added to set G g while Vk c is added to set Vc to participate in subsequent subconfiguration matching and mapping, and G γ g , Vγ g likewise.For the worst conditions, this progress can be finished

c
are collectively moved to the corresponding G γ g locations to await subsequent steps.

Figure 9 .
Figure 9. Current configuration (a) and goal configuration (b) consist of several isomorphic su figurations and free vertices.

∈
there exists a connection between ˆg v and a subconfigur g G α in the goal configuration that has completed subconfiguration mapping, and den as connect( ˆg v , , as shown in Figure 9b.Each vertex i has at least one such connection, which determines the position of the vertex in ˆg V w the goal configuration.Since g v α exists in the MCS, the target positions of vertices i are known.The target positions are broadcast to all vertex in ˆc V .Under an artificial f field, the vertex in ˆc V automatically selects the nearest target position from its cu position for matching.Since ˆc V and ˆg V have equal numbers of vertices, the vertice ultimately form a one-to-one mapping ˆ: c g f V V → .In this process, three types of art forces are constructed: attractive force, repulsive force, and obstacle avoidance force

Figure 9 .
Figure 9. Current configuration (a) and goal configuration (b) consist of several isomorphic subconfigurations and free vertices.
The attractive force → F a pulls the free vertex towards the nearest target point while the repulsive force → F r pushes free vertices away to keep a safe distance avoiding collision.

Figure 10 .
Figure 10.In the current configuration (a), the dashed circles indicate the corresponding tar sitions in the target configuration (b).The arrows show the forces acting on the free vertices will move the vertices to the nearest target positions and establish a mapping with the ver the goal configuration.

Figure 10 .
Figure 10.In the current configuration (a), the dashed circles indicate the corresponding target positions in the target configuration (b).The arrows show the forces acting on the free vertices, which will move the vertices to the nearest target positions and establish a mapping with the vertices in the goal configuration.

Fc
, and the reconfiguration actions are undocking v c from ← v by removing connect(v c F, then docking v c with v c by establishing connect(v c F, v c F).

Sensors 2023 , 20 4. 4 ..
23, x FOR PEER REVIEW 12 of Reconfiguration Action Generation based on Mapping Once the Reconfiguration Mapping process is completed, corresponding reconfiguration actions can be determined.The mapping : c g f V V → provides the mapping relations that map each module and corresponding connection from the initial configuration The reconfiguration actions can be generated by comparing the edge mappings of the corresponding mapped module pair between c G and g G .Under the mapping : is in any MCS during the mapping process meanwhile its corre- sponding parent module pair ( , ) same MCS , indicating that no reconfig- uration action is needed for this connected module pair.Otherwise, F g v  will be mapped to a unique vertex c v′ (which is not the parent vertex then docking c v with c v′ by establishing connect( c v F , c v F ′ ).The reconfiguration actions will be generated by traversing all modules in c G .This process can be carried out in time ( ) c O V .Following the complete traversal of all modules, the initial configuration c G will be transformed into the goal configuration g G via the execution of the reconfiguration actions computed by the planning algorithm.

Figure 11 .
Figure 11.Reconfigure the initial configuration-cross configuration (a) into the goal configuration-probe configuration (b), with 9 MMRP modules involved.The connector marked in red is Top-Face.

Figure 11 .
Figure 11.Reconfigure the initial configuration-cross configuration (a) into the goal configurationprobe configuration (b), with 9 MMRP modules involved.The connector marked in red is Top-Face.

12 Figure 12 .
Figure 12.(a) Graph-based representation of the initial cross configuration.(b) Graph-based sentation of the goal probe configuration.
tains five modules, and the mapping relations are shown in Table2.c G and g G are erated.

Figure 12 .
Figure 12.(a) Graph-based representation of the initial cross configuration.(b) Graph-based representation of the goal probe configuration.

Figure 13 .
Figure 13.The subconfigurations and free vertex obtained after applying

2 g
τ corresponding to Module 5 in the goal configuration.Module 9 and Module 7, which are identified as free vertices, are added to set ˆc V .
and the mapping relations are shown in Table3.Module 5 and Module 6 undock all connected faces to convert them into free vertices.Based on the mapping result, Module 4 and Module 8 move as a whole to the corresponding position to await subsequent steps.
, 8T) → connect(8B, 9T) Free vertices Module 9 and Module 7 receive the target positions.Under the artificial potential field, they dynamically find the nearest target nodes and move to those positions and the mapping 5, 9 → 6 according to the simulation result.This process is shown in Figure 14.

Figure 13 .
Figure 13.The subconfigurations and free vertex obtained after applying CS(G c , 1, G g , 1) operations to the initial configuration (a) and goal configuration (b) is indicated by "--".G c and G g are indicated by "--".After performing configuration decomposition, subconfigurations were generated: subconfiguration G 1 c rooted at τ 1 c , corresponding to Module 4 in the initial configuration, and subconfigurations G 1 g rooted at τ 1 g corresponding to Module 8 and G 2 g rooted at τ 2 g corresponding to Module 5 in the goal configuration.Module 9 and Module 7, which are identified as free vertices, are added to set Vc .h(τ 1 c ) = h( τ 1 g ) = h( τ 2 g ) = 2, which means MCS matching searching between G 1 c and G 1 g (or G 1 c and G 2 g ) is feasible.MCS( τ 1 c , τ 1 g ) = MCS(4, 8) contains two modules and the mapping relations are shown in Table3.Module 5 and Module 6 undock all connected faces to convert them into free vertices.Based on the mapping result, Module 4 and Module 8 move as a whole to the corresponding position to await subsequent steps.

Sensors 2023 , 20 Figure 14 .
Figure 14.Under the influence of an artificial force field, the free vertex Module 7 and Module 9 dynamically seek out their target to complete the vertex mapping.At this point, one-to-one mapping relations : c

Figure 14 .
Figure 14.Under the influence of an artificial force field, the free vertex Module 7 and Module 9 dynamically seek out their target to complete the vertex mapping.
experiment demonstrated a configuration deformation from a Series configuration to a T configuration using 4 MMRP robots.The modular robots communicate with the PC via NRF24L01 for data transmission.Relative position and pose relationships between modules are obtained using UWB positioning units.The initial and goal graph representations are shown in Figure17where c τ is Module 2 and g τ is Module 1, respectively.

Figure 17 .
Figure 17.(a) Graph-based representation of the initial series configuration.(b) Graph-based representation of the goal T configuration.

Figure 17 . 20 Figure 18 .
Figure 17.(a) Graph-based representation of the initial series configuration.(b) Graph-based representation of the goal T configuration.Sensors 2023, 23, x FOR PEER REVIEW 18 of 20

Figure 18 .
Figure 18.The experiment of configuration deformation from Series configuration into T configuration.

Table 1 .
Configuration recognition sequence for cross configuration.

Table 1 .
Configuration recognition sequence for cross configuration.

Table 4 .
Reconfiguration actions for cross configuration to probe configuration.