Robotic modelling of snake traversing large, smooth obstacles reveals stability benefits of body compliance

Snakes can move through almost any terrain. Although their locomotion on flat surfaces using planar gaits is inherently stable, when snakes deform their body out of plane to traverse complex terrain, maintaining stability becomes a challenge. On trees and desert dunes, snakes grip branches or brace against depressed sand for stability. However, how they stably surmount obstacles like boulders too large and smooth to gain such ‘anchor points’ is less understood. Similarly, snake robots are challenged to stably traverse large, smooth obstacles for search and rescue and building inspection. Our recent study discovered that snakes combine body lateral undulation and cantilevering to stably traverse large steps. Here, we developed a snake robot with this gait and snake-like anisotropic friction and used it as a physical model to understand stability principles. The robot traversed steps as high as a third of its body length rapidly and stably. However, on higher steps, it was more likely to fail due to more frequent rolling and flipping over, which was absent in the snake with a compliant body. Adding body compliance reduced the robot's roll instability by statistically improving surface contact, without reducing speed. Besides advancing understanding of snake locomotion, our robot achieved high traversal speed surpassing most previous snake robots and approaching snakes, while maintaining high traversal probability.

In friction experiments, we measured the position as a function of time of three body segments 23 being dragged by a weight, by tracking ArUco tags in videos captured by Logitech C920 webcam at 30 24 frames/s. Then, by fitting a quadratic function of displacement as a function of time to estimate acceleration, 25 we calculated kinetic friction coefficient as: 26 2 = 2 − ( 1 + 2 ) 1 27 where m1 is the mass of the weight, m2 is the total mass of the segments, a is the fitted acceleration, g is the 28 local gravitational acceleration (9.81514 m/s 2 ). 29 Motor actuation to achieve partitioned gait 30 The actuation profile of yaw joints in the laterally undulating body sections, defined as the angular 31 displacement from the straight body pose (Fig. 2B, yellow angle) as a function of time and segment index, 32 followed the serpenoid gait [18]: 33 = { ( + + ( − 1)Δ ), = 1,2, … , 1 ( + + ( + 1 − 2 )Δ ), = 2 , … , 9 34 where i is for the ith yaw joint from the robot head, A = /6 and ω = /2 are the amplitude and angular 35 velocity of each yaw joint angle waveform, ϕ = 0 is the initial phase (at time zero) of the first yaw joint, 36 and ∆ϕ = −/4 is the phase difference between adjacent yaw joints. ∆ϕ determines the wavenumber of the 37 entire serpenoid wave in the robot, k = 9|∆ϕ|/2π. The k1th yaw joint is the last yaw joint in the undulating 38 section above the step, and the k2th yaw joint is the first yaw joint in the undulating section below the step, 39 k2 − k1 is the number of pitch segments in the cantilevering section. The pitch angles of all pitch segments 40 in these two undulating sections were set to zero (Fig. S2A, gray) to maintain contact with the horizontal 41 surfaces. 42 The actuation profile of the joints of the cantilevering section (Fig. S2A, red) was designed to 43 bridge across the large step with the minimal number of segments necessary. The yaw angles of all yaw 44 segments in this section were set to zero. The pitch angle of the most anterior pitch joint in the undulating 45 section below (Fig. S2A, joint c) was set to its maximal possible value ϕmax so that the cantilevering section 46 was as vertical as possible to minimize cantilevering length. The two most anterior pitch joints in the 47 cantilevering section (Fig. S2A, joints a and b) were set to keep the section above in contact with the upper 48 horizontal surface. Their pitch angles were calculated as follows: ϕa = ϕb − ϕmax, ϕb = −sin −1 [(H − 49 nhsinϕmax)L], n = floor[H(hsinϕmax)], where H is step height, h is the distance between two adjacent pitch 50 axes when the robot is straight, n the maximum number of pitch and yaw segments that can be kept straight 51 in the cantilevering section. 52

Marker-based feedback logic control 53
For feedback logic control [40] of the robot, a 3 × 3 cm ArUco marker [64] was fixed to the top of 54 each pitch segment and on both the upper and lower horizontal surfaces near the top and bottom edge of 55 the step (Fig. S1B). Their positions captured by a camera were tracked before each trial to measure the step 56 height for adjusting the robot gait and then tracked online to locate the position of each pitch segment 57 relative to the step. We used a webcam (C920, Logitech, Lausanne, Switzerland) with 1920 × 1080 58 resolution for experiments with step height H ≤ 38% L. We used another camera (

Data synchronization 85
To synchronize motor angle data and electrical power data recorded by the laptop with the high-86 speed camera videos recorded on a desktop server, the power measurement circuit included a switch to turn 87 on/off an LED bulb placed in the field of view of the high-speed cameras. When the LED was switched 88 on/off, the SCP detected the voltage increase/drop and began/stopped recording power data. By aligning 89 the initial and final power data points with the LED on/off frames in the videos and interpolating the motor 90 position and electrical power data to the same sampling frequency as high-speed video frame rate (100 Hz), 91 these data were synchronized. 92

Experiment protocol 93
At the beginning of each trial, we placed the robot on the surface below the step at the same initial 94 position and orientation. The robot was set straight with its body longitudinal axis perpendicular to the 95 vertical surface of the step. Its distance was set to be 16.5 cm from the wheel axle of the first segment to 96 the vertical surface. This distance was selected so that the forward direction of most anterior segment in the 97 undulating section below the step was perpendicular to the vertical surface before it began to cantilever. 98 We then started high-speed video recording and switched on the LED in the SCP circuit. Next, we started 99 the robot motion and monitored traversal progress until a termination condition was met. After the robot 100 motion was terminated, the LED was first switched off, then the high-speed camera recording was stopped, 101 and the setup was reset for the next trial while high speed videos were saved. 102

3-D kinematics reconstruction 103
To reconstruct 3-D kinematics of the entire robot traversing the large step obstacle, we recorded 104 the experiments using twelve high-speed cameras (Adimec, Eindhoven, Netherlands) with a resolution of 105 2592 × 2048 pixels at 100 frames s -1 (Fig. S1A). The experiment arena was illuminated by four 500 W 106 halogen lamps and four LED lights placed from the top and side. 107 To calibrate the cameras over the entire working space for 3-D reconstruction, we built a three 108 section, step-like calibration object using T-slotted aluminum and Lego Duplo bricks (The Lego Group, view. We checked and rejected ArUco tracking data whose four marker corners did not form a square shape 117 with a small tolerance (10% side length). 118 Using the tracked 2-D coordinates from multiple camera views, we obtained 3-D coordinates of 119 each tracked marker via DLT using a custom MATLAB script. We rejected marker data where there was 120 an unrealistic large acceleration (> 10 m/s 2 ), resulting from a marker suddenly disappearing in one camera 121 view while appearing in another in the same frame. We then obtained 3-D position and orientation of each 122 pitch segment by offsetting its marker 3-D position and orientation using the 3-D transformation matrices 123 from the marker to the segment, which was measured from the CAD model of the robot. We also measured 124 the step geometry by fitting a plane to the markers on each of its three surfaces and generated a point cloud 125 using the fit equation and the dimension of the three surfaces. 126 For yaw segments without markers and the pitch segments whose markers were not tracked due to 127 occlusions or large rotation, we inferred their 3-D positions and orientations using kinematic constraints. 128 6 We first tried inputting motor angles recorded by these segment motors into the robot forward kinematics 129 to solve for their transformation matrices from other reconstructed segments. If their motor angles were not 130 properly recorded, we tried inferring their positions and orientations from the two adjacent segments (as 131 long as they were reconstructed). To do so, we first obtained all servo motor angles in this missing section 132 by solving an inverse kinematics problem, then derived the transformation matrices of the missing segments 133 from the forward kinematics. Finally, if both methods failed, we interpolated temporally from adjacent 134 frames to fill in the missing transformation matrices. The interpolation was linearly applied on the twists of 135 transformation matrices. We compared joint angles from the reconstructed segments to motor position data 136 and rejected those with an error larger than 10°. To reduce high frequency tracking noise, we applied a 137 window average filter temporally (smooth2a, averaging over 11 frames) to the 3-D positions of each 138 segment after reconstructing all segments. 139 We verified the fidelity of 3-D kinematics reconstruction by projecting reconstruction back onto 140 the high-speed videos and visually examined the match (Fig. S1B). The thresholds used in this process were 141 selected by trial and error, with the aim of removing substantial visible projection errors while rejecting as 142 few data as possible. 143

Data analysis 144
To quantify traversal performance, we measured traversal probability defined as the ratio of the 145 number of trials in which the entire robot reached the surface above the step to the total number of trials for 146 each step height. To quantify roll instability, we measured roll failure (flipping over) probability, defined 147 as the ratio of the number of failed trials in which the robot flipped over due to rolling to the total number 148 of trials for each step height. To determine whether a wheel contacted a surface, we examined whether any 149 point in the wheel point cloud (Fig. 8B, grey dashed circle) penetrated the surface assuming no suspension 150 compression. Unrealistic body deformation values from tracking errors larger than the 10 mm limit from 151 the mechanical structure were set to 10 mm. 152 To compare electrical power during traversal across step height and body compliance treatments, 153 we analyzed electrical power over the traversal process, defined as from when the first pitch segment lifted 7 to cantilever, to when the last pitch segment crossed the top edge of the step for successful trials, or to when 155 the robot flipped over (roll failure) or the trial was terminated due to robot getting stuck (stuck failure) for 156 failed trials. 157 To compare traversal performance of our robot with previous snake robots and the kingsnake, we 158 calculated vertical traversal speed for each robot and the animal. For our snake robot and the kingsnake 159 with multiple trials, we first calculated vertical traversal speed of each trial by dividing step height 160 normalized to body length by traversal time and then pooled speed data of all trials from all step heights for 161 each body compliance treatments (for the robot) to obtain average speed. The slopes shown in Fig. 9 are 162 average vertical traversal speed for each robot and the animal. 163 During experiments, we rejected trials in which the robot moved out of the obstacle track before 164 successfully traversing the step or failing to traverse due to occasional crash of the control program. We 165 collected around 10 trials for each combination of step height and suspension setting (rigid and compliant). 166 For the rigid body, 40% L step treatment only 5 trials were collected, because the 3-D printed segment 167 connectors were often damaged by ground collisions during roll failure (flipping over) and had to be 168 replaced. Detailed sample size is shown in Table S1. 169 Table S1. Sample size. To test whether traversal probability and roll failure (flipping over) probability depended on step 179 height, for the rigid or compliant body robot, we used a simple logistic regression separately for each of 180 these measurements, with step height as a continuous independent factor and records of traversal success 181 or roll failure (flipping over) as a nominal dependent factor. 182 To test whether traversal probability and roll failure (flipping over) probability further depended 183 on body compliance while taking into account the effect of step height, we used a multiple logistic 184 regression for each of these measurements with data from rigid and compliant body robot combined, with 185 body compliance as a nominal independent factor and step height as a continuous independent factor and 186 records of traversal success or roll failure (flipping over) as a nominal dependent factor. 187 To test whether traversal probability differed between each adjacent pair of step heights for the 188 rigid or compliant body robot, we used a pairwise chi-square test for each pair of step heights, with step 189 height as a nominal independent factor and traversal success record as a nominal dependent factor. 190 To test whether contact probability, body deformation, surface conformation difference, and 191 electrical power differed between rigid and compliant body robot, we used an ANCOVA for each of these 192 measurements. We first set body compliance, step height, and their interaction term as independent factors 193 and each of these measurements as a nominal/continuous dependent factor. If the P value of the interaction 194 term was less than 0.05, we then re-ran the same test excluding the interaction term. Step height (% body length)