{'fraction_non_alphanumeric': 0.028027351514669636, 'fraction_numerical': 0.0042537966128647535, 'mean_word_length': 4.88421052631579, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 2, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Directional Compliance in Obstacle-Aided Navigation for Snake Robots

Snake robots have the potential to maneuver through tightly packed and complex environments. One challenge in enabling them to do so is the complexity in determining how to coordinate their many degrees-of-freedom to create purposeful motion. This is especially true in the types of terrains considered in this work: environments full of unmodeled features that even the best of maps would not capture, motivating us to develop closed-loop controls to react to those features. To accomplish this, this work uses proprioceptive sensing, mainly the force information measured by the snake robot's joints, to react to unmodeled terrain. We introduce a biologically-inspired strategy called directional compliance which modulates the effective stiffness of the robot so that it conforms to the terrain in some directions and resists in others. We present a dynamical system that switches between modes of locomotion to handle situations in which the robot gets wedged or stuck. This approach enables the snake robot to reliably traverse a planar peg array and an outdoor three-dimensional pile of rocks.


I. INTRODUCTION
Snake robots, composed of a chain of actuated joints, offer the potential to navigate challenging environments. If the robot had perfect knowledge of its state and the environment, it might select which terrain features to exploit or avoid while locomoting through unstructured or confined environments [1], [2]. However, in practice, the robot has little prior knowledge of the terrain, making it prone to getting entangled in or jammed between obstacles (shown in Fig. 1). This work presents a reactive controller which enables a snake robot to locomote through highly cluttered environments consistently using only proprioceptive (joint position and torque) sensors.
Prior work demonstrated that relatively straightforward reactive controllers based on proprioceptive feedback perform reasonably well in the types of terrain considered in this work [3], [4]. In these works, shape-based compliance controllers couple the motion of the many joints to produce desired motions in the world, provide a reduced number of parameters to control, and adapt the body shape to conform to terrain features in the surrounding environment. However, not all the terrain features are helpful for locomotion-some serve as obstacles which impede the robot's movement rather than aiding it. As a result, the robot's movements do not always result in desired propulsion. This work presents a novel means to infer when terrain features impede locomotion (and thus serve as obstacles), and adapts the shape-  In this work we present a control strategy to enable a snake robot to blindly locomote through unstructured terrains. (a) Indoors, in a planar peg board, the robot may be impeded when the posterior half of the robot becomes jammed between the pegs. (b) Outdoors, while covered with a protective skin, the robot is impeded when its head becomes jammed between several rocks. Our reactive control strategy infers that the robot is impeded and temporarily changes locomotive strategies.
based compliance controller so that the robot moves through unstructured terrain more reliably. The approach to snake robot locomotion control presented in this paper centers around the concept of directional compliance: allowing the robot to selectively admit forces applied on one side, and reject forces from the other side. This concept is inspired by the musculature and behavior of biological snakes [5]. We emulate this mechanism within the shapebased-compliance control strategy by selectively allowing some portions of the robot to comply to the environment, while others remain stiff to push off for forward propulsion. We implement this mechanism within a dynamical system [6] that actively modulates the robot's local stiffness.
We empirically validate our approach both in a twodimensional artificial indoor environment, a peg board, and in a three-dimensional outdoor environment, a rock pile. We experimentally compare our method to previous shape-based compliant control methods. We find that our method enables the snake robot to locomote farther and more consistently in obstacle-rich environments.
The rest of this paper is organized as follows: Section II provides a background on related works. Section III describes our approach for snake robots navigating irregular terrain, which consists of inferring the presence of terrain features which obstruct forward progress using proprioceptive sensors, reacting to obstructions using directional compliance, and transitioning behaviors for robust locomotion. Section IV experimentally validates our approach on a peg array and a rock pile and Section V compares its performance with the previous control strategy. Finally, conclusions and future works are discussed in Section VI.

II. BACKGROUND
The reactive control strategy presented in this work is inspired by several existing methods that are reviewed in this section.

A. Shape-based compliance
The serpenoid curve, found throughout the snake robot literature [7], is achieved by where θ i is the ith joint angle, κ the angular offset, A the wave amplitude, ω the temporal frequency, and t the time. η is the spatial frequency, which determines the number of waves on the robots body. s i = iδs defines the position of the ith module along the robot backbone with respect to the head, where δs is the distance between each joint. By tuning these parameters, various gaits, both biologically inspired and engineered, can be achieved [8].
To coordinate a snake robot's many internal degrees-offreedom during locomotion, a shape function h : Σ → R N maps a point σ in low-dimensional parameter space Σ into the joint space θ ∈ R N of the N -link robot [3]. In this work, the amplitude A of the serpenoid curve (1) is updated dynamically during locomotion, while other parameters are fixed as constants, i.e., σ = A. The serpenoid curve serves as the shape function, (2) Shape-based compliant control [3] extends admittance control [9] to articulated locomotion, assigning spring-massdamper-like dynamics to the shape parameters, where M , B, and K are positive-definite tuning matrices that govern the dynamic response of the desired shape parameters σ d . The forcing term F σ is formed by transforming the external torques τ ext measured by the joints into the shapeparameter space by F σ = Jτ ext , (4) given the Jacobian of the shape function J = ∂h(σ) ∂σ . In the absence of external torques, the desired shape parameters σ d will converge back to the nominal shape parameters σ 0 . The admittance control serves as a "middle-level" controller that takes feedback from the high-level planner (in the form of nominal shape values) and outputs commands for the lowlevel joint controllers (in the form of desired joint angle setpoints). In the remainder of this paper, we will refer to this form of shape-based compliance as "nominal compliance" to distinguish it from our proposed strategy, which augments this existing control strategy.

B. Decentralized control with activation windows
In irregular environments, recent work found that allowing different portions of the robot to independently conform in a decentralized manner resulted in more effective locomotion [4]. This decentralization is accomplished by grouping sets of neighboring joints under "activation windows." The joints contained within each activation window share shape parameters. The activation windows are defined by travelling sigmoid functions, σ(s, t) = where W is the number of windows, σ j (t) is the shape parameter in window j, m the sigmoid slope. Window j spans the portion of robot backbone over [s j,l , s j,r ] ⊂ [0, 1]. These activation windows move along the robot backbone with the travelling serpenoid curve, which serves to pass spatial shape information down the body.
III. METHODS We divide our shape-based reactive control strategy into three parts: 1) inferring the presence of terrain features that cannot be exploited by nominal compliance for propulsion (which for brevity, we will refer to as "obstructions") using only joint-level proprioceptions, 2) reacting actively to those obstructions and 3) transitioning between nominal and reactive behaviors.

A. Inferring the presence of obstructions
When the robot interacts with the terrain, contact forces cause external torques measured by the robot. We introduce a method to use these torque measurements to determine whether a portion of the body is stuck, jammed, or otherwise obstructed.
When testing the shape-based compliance method of [3], we observed that the robot frequently became wedged or stuck, and we sought trends within its internal state which were correlated with these instances. We found the amplitude shape parameters act as an indication of the robot's forward progression. Each activation window, which groups a set of neighboring joints along the body, has its own amplitude shape parameter as per (5). This means there are W desired amplitudes for different portions of the robot Note that the amplitude A d,j of each activation window j is independent of the number of joints contained within the window, and the number of windows is determined by the spatial frequency η in (2). Each A d,j varies from its nominal value A 0,j . The difference between A d,j and A 0,j reflects how much external torques have forced the robot to compliantly change its local body shape in the jth activation window. To measure the degree to which each amplitude has varied, we take the mean value over a range of k discrete time steps t = {t 0 , ..., t k }, We observed that if a terrain feature aids the robot's locomotion, i.e., the robot moves through it without getting stuck, then µ j ≈ A 0,j . That is, the mean of the amplitude remains near the nominal amplitude in the time period from when the robot makes contact with that feature and ends at the time when it loses contact. On the other hand, if the jth window is obstructed by the terrain, the mean amplitude is offset from the nominal amplitude, i.e., This observation on its own is insufficient to detect when the robots progress is impeded by its contact, however, since our snake robot has no external sensing and cannot directly sense when and where a contact begins or ends. Therefore we monitor the internal state by defining the shape absition as the summation of the difference between the desired and We use joint position and torque feedback to infer when the robot's locomotion progress is obstructed. The amplitude of the body wave is allowed to vary over time in response to joint torques. (a) The snake robot has become jammed in place between three pegs around its mid-section and tail. (b) The desired amplitudes in the shape-based compliant controller vary over time for the three activation windows: the head (window 1, solid red), midsection (window 2, solid blue) and tail (window 3, solid green). The means of amplitudes are shown for windows (dashed lines), and the difference of these means from the nominal amplitude of A0 = [1, 1, 1] T (black dash-dotted line) are used to infer which windows are obstructed. (c) The resultant amplitude absitions for each window. The first window is not obstructed, so its absition remains near zero, but the other two windows are obstructed, so their absitions diverge from zero. the nominal shape parameter for the jth activation window over time, The jth amplitude absition A int j remains near zero when locomotion progresses smoothly, but rapidly diverges if the robot's locomotion is hindered. Thus, the shape absition serves as an indication of the robot's locomotion progress. In practice, friction between the ground and the robot contributes a constant offset between A 0 and A d for each activation window. To remove the influence of the friction, we run several gait cycles on the ground to calibrate the offset and then subtract it from A int j . Fig. 2 shows an example of the amplitudes and amplitude absitions when the robot's locomotion is impeded in midsection and posterior windows. In this case, three activation windows are set along the robot's backbone. In the anterior window, the offset ∆ 1 between the average desired amplitude µ d,1 and the corresponding nominal amplitude A 0,1 is approximately equal to zero, and as a result, the amplitude  absition A int 1 fluctuates about zero, suggesting the absence of obstructions near the head. However, ∆ 2 > 0, resulting in divergence of A int 2 from zero, which indicates the presence of obstructions in the mid-section the robot. Similarly, the divergence of A int 3 from zero over this time period suggests the presence of obstructions around the posterior of the body.

B. Directional Compliance
Monitoring the shape absition serves as a means to infer obstructions to the locomotion progress while following a shape-based compliant controller. To react to these obstructions we extend the nominal compliance to a new reactive strategy which we call directional compliance. We are inspired by biological snakes that can actively tune the stiffness of selected muscles to propel against obstacles [5]. Directional compliance allows the snake robot to admit (comply to) forces exerted on one side of the body but reject forces exerted on the other side. We find this strategy enables the robot to actively react to, and move through, terrain features that impede their locomotion.
1) Directional compliance in planar environments: The robot can increase its local curvature by increasing the amplitude in an activation window, or decrease local curvature by decreasing the amplitude. To make the robot directionally compliant, then, we can either admit forces resulting in increases in curvature, which we denote positive directional compliance, or admit forces resulting in decreases in curvature, which we denote negative directional compliance. Recall that in nominal compliance (NC), we integrate the desired shape parameterσ d over time to dynamically vary the desired shape parameter σ d . We realize directional compliance by introducing a filter function F onσ d , such

Low-level Motor Control
Reactive Filter Shape Function Fig. 4: Block diagram of the complete shape-based reactive control system with directional compliance. that the modified shape parameter derivative isσ d = F(σ d ).
A filter that enables positive directional compliance (PDC) on the amplitude iṡ Similarly, a filter that enables negative directional compliance (NDC) on the amplitude iṡ The presence of an obstruction is detected by monitoring the amplitude absition A int as described in Section III-A. When A int diverges from zero and A int < 0, we find that PDC, in which the amplitude is only allowed to increase locally, helps the robot propel itself forward through obstructions instead of passively conforming to them. Similarly, NDC helps to overcome obstructions which cause A int to diverge from zero when A int > 0. See Fig. 3 for an example of the effect of PDC and NDC on amplitude modulation. A supplementary video of this demonstration can be found at https://youtu.be/1BBPoczVgdY.
2) Directional compliance in three-dimensional environments: Our snake robot has joints whose axes alternate between the dorsoventral and lateral directions. For undulation in three-dimensional environments, we generate two serpenoid curves on the dorsal and lateral planes by assigning them to odd and even joints, respectively, where superscripts o and e represent odd and even joint indices. Note that planar locomotion can be achieved by setting A e = 0. With (10) as a three-dimensional shape function, we implement shape-based compliance separately on the dorsal and lateral plane. This allows the dorsoventral and lateral joints to conform independently to rough terrain. The directional compliance filters (8) and (9) are applied independently to the amplitudes of the dorsoventral and lateral joints and windows. With directional compliance in both planes, the robot is capable of reacting to threedimensional irregularities that impede its locomotion. C. Dynamical system for behavior transition Directional compliance provides a novel means for snake robots to overcome obstructions that impede their locomotion. Here we present a dynamical system that automatically transitions between the nominal compliance (NC), positive directional compliance (PDC), and negative directional compliance (NDC) behaviors based only on proprioceptive feedback.
The amplitude absition, as described in Section III-A, is used to initiate the transition from nominal compliance to directional compliance. This is accomplished by setting a threshold for the deviation of amplitude absition from zero, and initiating directional compliance based on the sign of the absition. The upper and lower thresholds, A int thresh,u and A int thresh,l , define the robot's sensitivity to obstructions, and are tuned by hand. When directional compliance is enabled, these thresholds serve as new nominal amplitudes when calculating the amplitude absition. When the amplitude absitions return to zero, the robot switches back to nominal compliance.
A block diagram of the control system is shown in Fig.  4. The nominal amplitude A 0 , input by a user or high-level planner, defines the nominal shape that the robots takes in the absence of external forces. The admittance control block uses joint torque feedback to compute a second derivative of the desired amplitude. Our directional compliance block adds a filter on the first derivative of the desired amplitude to modulate the effective stiffness, and outputs joint angle set points. A low-level PID controller embedded in each joint of the robot controls the actuators to follow the joint angle set points [10]. As the robot interacts with the environment, external forces from the terrain are sensed indirectly through joint torque measurements. The reactive filter F in Fig. 4 combines (8) and (9), otherwise. (11) NC is the default behavior when the shape absition A int d lies between the upper and the lower thresholds. PDC is activated if A int d drops below the lower threshold; the desired shape A d is only allowed to increase when negativeȦ d are filtered out. Similarly, NDC is activated if A int d raises beyond the upper threshold; A d is only allowed to decrease when positiveȦ d are filtered out. We found an effective threshold setting to be A int thresh,u = 2A 0 and A int thresh,l = −2A 0 . A int reaches a threshold, then directional compliance is initiated until the amplitude absition returns to zero. These times are indicated here with dotted lines. In this example, the head of the robot is blocked by obstructions at t = 38s and t = 65s. Then robot switches to NDC mode triggered by the lateral amplitude absition, and lifts its head portion to overcome the obstructions. PDC in the dorsal plane is also triggered twice at t = 59s and t = 76s to overcome obstructions located at sides of the body. We find experimentally that this strategy results in significantly more consistent locomotive performance than does the nominal shape-based compliance.
As described in Section II-B, the activation windows propagate from head to tail along the robot's backbone with the travelling wave of the serpenoid curve. When a new window is initiated at the head, it is set to the nominal amplitude A 1,d = A 0 . When a window passes off of the tail, its shape information is discarded, allowing the robot to leave behind the shape parameters with their associated terrain features.
In summary, our reactive controller adds a biologicallyinspired directional compliance layer to shape-based compliant control. Directional compliance enables the robot to either push away from, or comply to, terrain features, based on the torque feedback measured over time. The amplitude of the body wave varies in response to external forces, and by tracking its change over time, we can infer the presence of obstructions and alter the compliance behavior accordingly. Fig. 5 depicts a sequence of video frames and the corresponding amplitude absitions of a successful traversal over an unstructured rock pile. Directional compliance in the dorsal and lateral plane are triggered independently by shape absitions in the two planes.

IV. EXPERIMENTS
We conducted an experimental comparison of the performance of shape-based compliant control variants. All experiments were carried out with a snake robot composed of sixteen identical actuated joints [10]. The joints were arranged such that the axes of rotation of neighboring modules were torsionally rotated ninety degrees relative to each other. Inside each actuator, a series-elastic element [11] provides joint torque feedback.
Experiments were conducted in a randomly-distributed peg array and an unstructured outdoor rock pile. For each environment, we compared four versions of shape-based control strategies: • Nominal compliance (NC) • Negative directional compliance only (NDC) • Positive directional compliance only (PDC) • Dynamical system with NC, NDC, and PDC The NC strategy is the shape-based controller from [3], in which no filter is applied to the shape parameters derivatives. In the NDC strategy, a directional compliance filter in the form of F − in (9) is employed, which allows the amplitude to decrease in response to external forces, but not increase, in each window. In the PDC strategy, a directional compliance filter in the form of F + in (8) is employed, which allows the amplitude to increase but not decrease in each window. The full dynamical system includes a filter in the form of (11) which transitions between NC, NDC, and PDC, depending on trends in the amplitude over time in each window.
When operating within the peg array only odd modules are active, with three activation windows, where A 0 = [ π 5 , π 5 , π 5 ] T . When in the rock pile, three activation windows are assigned to both the dorsal and lateral plane, where A o 0 = [ π 5 , π 5 , π 5 ] T and A e 0 = [0, 0, 0] T . Each controller was tested at five randomly selected initial positions and orientations. For each initial pose, we collected four trials for each controller, starting from the same position, and averaged their displacements. Controller performance in each condition was measured via the displacement of the geometric center of the robot after two minutes.

V. RESULTS
We found that our full controller, a dynamical system transitioning between NC, NDC, and PDC, outperformed the previous method (NC) and the ablated variants (PDC and NDC). The experimental results of the controllers' performances are displayed in Fig. 6. We observed that NC is sensitive to the distribution of obstacles; it works well if the robot is placed in an initial position for which the nominal amplitude matches the distribution of terrain features, but frequently results in the robot becoming jammed between terrain features. NDC performed worst, since it interferes with the robot's ability to push off of obstacles. PDC behaves well initially, but does not produce robust locomotion. This is due in part to the fact that when the amplitude can only increase, the robot has frequent self-collisions. The dynamical system strategy, which enables the robot to transition between the three control strategies, results in consistent planar and threedimensional locomotion, and is the least sensitive to the robot's initial pose. Example videos of the experiments can be found at https://youtu.be/1BBPoczVgdY.

VI. CONCLUSION
We presented a biologically-inspired dynamical system for snake robots to robustly navigate unmodeled obstaclerich environments. We designed a decentralized method that, using only proprioceptive feedback, infers whether the robot is entangled in terrain features that impede rather than aid locomotion. Our directional compliance control strategy allows the robot to locally change the effective stiffness of each region of the body in order to overcome those obstacles. We experimentally validated our approach in two different unstructured environments.
We found that directional compliance allows the robot to overcome common terrain features in outdoor environments, such as small bumps or small holes in the ground. However, this strategy is purely reactive, and cannot, for instance, transition to different modes of behavior needed to surpass larger terrain features like stairs. In future work we will explore new motion patterns and control strategies for such scenarios.
This work focuses on one specific shape parameter in the serpenoid curve-the amplitude. Future work will investigate the use of directional compliance in other shape parameters. Further, we have so far assumed that the robot is fully blind, using no external sensing such as direct contact sensing, vision, or inertial sensors. A continued avenue for our research is how to include input from other sensing modalities into our reactive control strategies, as well as tighter integration between the mid-level controller and high-level planners.