# Teleolocation--Remotely Operated Legged Robots
## 2 Methods
### Operator Interface
#### 2.2.2. Haptic Interface
 \tag{3}\]  
where \(\bar{\theta}_{\text{F}}=0^{\circ}\) is the fixed angle for the femur-tibiu joint, \(\alpha_{z},\alpha_{x}\) are heuristically tuned real scalars, and \(\text{sgn}(\phi_{hl})\) are direction flags for the phase of the alternating tripod gait associated with each haptic device \(h\) and leg \(l\). In this way, the gait cycles were forced to occur one at a time in software, thus enforcing at least three points of contact. Walking could thus be commanded with periodic, alternating cyclic motion in the XZ plane. This is summarized as pseudocode in Algorithm 1. ```
1:define\(k_{z},k_{x}\) as positive scalar thresholds--these determine minimum movement to register motion command
2:for haptic device \(h\) controlling leg \(l\)do
3:if\(z_{h}>k_{z}\)then
4: check\(\vec{j}_{l}\) limits and if leg \(l\) in contact
5: set \[\hat{\theta}_{C}= \begin{cases}\theta_{C}&\text{joint limit, in contact}\\ \alpha_{z}z_{h},&\text{else}\end{cases} \]
6:if\(\hat{\theta}_{C}\
eq\theta_{C}\) and \(|x_{h}|>k_{x}\)then
7: set \[\hat{\theta}_{T}= \begin{cases}\theta_{T}&\text{joint limit}\\ \text{sgn}\left(\phi_{hl}\right)\alpha_{x}x_{h},&\text{else}\end{cases} \]
8:endif
9:endif
10:note that \(\theta\) denotes previous joint angle
11:note that \(\hat{\theta}\) denotes updated joint angle
12:note\(\phi_{hl}\) is assigned to each leg consistent with phase of the tripod gait
13:endfor
```  
**Algorithm 1** Translational Motion. Turning motion is achieved similarly to forward and backward locomotion, except the amplitude and stride length controlled by haptic device \(h\) is governed by \(y_{h},x_{h}\) respectively. That is, the joint angles \(\theta_{T}\) and \(\theta_{C}\) are determined directly from \(x_{h},y_{h}\) respectively. The femur-tibia joint is again fixed at \(\bar{\theta}_{F}=0^{\circ}\) (in both translation and pivoting, the femur-tibia fixed angle constraint is imposed to simplify mapping from low-dimensionality inputs). This is shown as  
\[\vec{J}_{l}(y_{h},x_{h})= \begin{pmatrix}\theta_{F}\\ \theta_{C}\\ \theta_{T}\end{pmatrix} = \begin{pmatrix}\bar{\theta}_{F}\\ \alpha_{y}y_{h}\\ \text{sgn}(\bar{\eta}_{l})\alpha_{x}x_{h}\end{pmatrix}  \tag{4}\]  
where \(\alpha_{y},\alpha_{x}\) are heuristically tuned real scalars, and \(\text{sgn}(\psi_{l})\) is a direction flag for the phase of the pivoting gait associated with each leg \(l\). This pivoting action is summarized as pseudocode in Algorithm 2. ```
1:define\(\beta_{y},\beta_{x}\) as positive scalar thresholds--these determine minimum movement to register pivoting command
2:define\(T_{y}\) as positive scalar phase switch--this allows \(y_{h}\) to switch gait phase
3:check\(\gamma\), the phase of pivot
4:while momentary button on device \(h\) pressed, for leg \(l\)do
5:check\(\vec{J}_{l}\) limits
6:if\(y_{h}>\beta_{y}\)then
7:set \[\hat{\theta}_{C}= \begin{cases}\theta_{C}&\text{joint limit}\\ \text{sgn}(\gamma_{l})\alpha_{y}y_{h},&\text{else}\end{cases} \]
8:if\(x_{h}>\beta_{x}\)then
9:set \[\hat{\theta}_{T}= \begin{cases}\theta_{T}&\text{joint limit}\\ \text{sgn}\left(\gamma_{l}\right)\alpha_{x}x_{h},&\text{else}\end{cases} \]
10:endif
11:endif
12:for each transition between \(y_{h}>T_{y}\) and \(y_{h}<T_{y}\)do
13:toggle phase state of pivot, \(\gamma\)
14:endfor
15:endwhile
```  
**Algorithm 2** Pivoting motion. Figure 6 depicts the switching of phase state \(\gamma\), which determines which set of three legs are raised for each phase of the pivot motion. Haptic feedback is then generated separately for each of the two modes (translational and pivoting) via simple haptic virtual fixtures. In particular, for forward and backward motion, the operator is encouraged to stay in the XZ vertical plane of the haptic device with force rendered as a spring and haptic proxy or god object movement defined as the projection of the user position on the XZ plane. Once the mode switch for pivoting is activated, haptic feedback is rendered similarly now with the horizontal XY plane serving as the virtual fixture.