# Optimal Collision-Free Grip Planning for Biped Climbing Robots in Complex Truss Environment
## 5 Gait Interpreter  
After determining the grips within each operational region, it is time to generate grips connecting the operational regions. That is to say, at this time, the grips are generated outside of operational regions. These remaining grips must be arranged in such a proper way that finally any pair of adjacent grips satisfies the robot kinematic constraints. A dedicated gait interpreter is proposed to implement this function in this section. Algorithm 1 gives out the basic structure of the proposed gait interpreter. The outputs of the optimal collision-free grip planner are \(GripsInfo\), inclusive of \(\mathbb{S}_{or}\left(G_{or},C_{or}\right)\) and \(GaitInfo\). \(GaitsInfo\) actually packages the parameters calculated in Section 4.2.1, including the moving distance \({}^{j}S_{k}\), number of climbing steps \({}^{j}N_{k}\) and corresponding \(gait\) type. These parameters are important reference for the gait interpreter arranging the remaining grips. Therefore, the inputs to the gait interpreter are the truss environment and \(GripsInfo\). During processing, the gait interpreter takes the transition, the obstacle negotiation, or the movement between them as a unit. For each unit, the gait interpreter simply arranges grips by calling an appropriate sub-function, according to the corresponding \(gait\) type. Sub-functions \(\textsc{InchwormGait}\), \(\textsc{HybGait}\) and \(\textsc{SaFoGait}\) are designed to generate grips and configurations for the movement between operational regions. While \(\textsc{PerformTransition}\) and \(\textsc{NegotiateObstacle}\) are designed to pack the transition and obstacle-negotiating grips into the grip sequence. ```
Input :\({}^{W}\)Truss: The truss environment; \(GripsInfo\): Output of the optimal collision-free grip planner. Output :\(Grips\): The entire grip sequence. \(MemN\Leftarrow\textsc{MembersNumber}(GripsInfo)\); for\(i=1\)to\(MemN\)do \(cMem\Leftarrow\textsc{GetMember}({}^{W}\)Truss, \(GripsInfo(i))\); \(GaitsInfo\Leftarrow GripsInfo(i)\); \(ObsN\Leftarrow\textsc{ObstaclesNumber}(GaitsInfo)\); for\(k=1\)to\(2(ObsN+1)\)do \(Gait\Leftarrow\textsc{GaitType}(GaitsInfo(k))\); switch Gaitdo caseInchdo \(Grips\).AddGrip(InchwormGait\((cMem,GaitsInfo(k)))\) ; // Algorithm 2 caseHybdo \(Grips\).AddGrip(HybGait\((cMem,GaitsInfo(k)))\) ; // Algorithm 3 caseSaFodo \(Grips\).AddGrip(SaFoGait\((cMem,GaitsInfo(k)))\); caseNegotObsdo \(Grips\).AddGrip(NegotiateObstacle\((cMem,GaitsInfo(k)))\); caseTransitdo \(Grips\).AddGrip(PerformTransition\((cMem,GaitsInfo(k)))\);



CalculateStepLength is called to calculate the proper step length \(StepLen\) with respect to the gripping position \(y\). Then \(t_{insert}\) can be obtained by an offset from the gripping position \(y\). After that, the adjacent grips of \(y\), \(t_{insert}\) and \(x\) will be sent for kinematic check. If \(y\) and \(t_{insert}\) or \(t_{insert}\) and \(x\) do not satisfy the kinematic constraints, \(t_{insert}\) will be updated to the opposite direction on the member. Reflecting on the movement of the robot, it is moving forward or backward to adjust the gripping position. If the kinematic check is passed, the function GenerateGrip is then used to generate \(Grips\) of an inchworm-like gait. Otherwise, the robot cannot continue to climb along this route. ```
Input :\(cMem\): The current member where the robot climbing on; \(GatisInfo\): The information of the inchworm gait. Output :\(Grips\): The grip sequence of the inchworm gait.