# Detect drift or slippage hexapod like robot

I have an hexapod like robot that can walk. The objective is to walk straight but depending on howmuch grip some legs have the walking path may differ from the desired walking path.

Let $$\overrightarrow{AB}$$ denote the desired walking path. Let $$\overrightarrow{AC}$$ be the actual walking path. Then at a certain point in the time domain there is some angle $$\theta$$ between $$\overrightarrow{AB}$$ and $$\overrightarrow{AC}$$ which can be see in the Figure below.

I am not quite sure if a 2 axis gyroscope would satisfy. The use of magnetometer can not be used because certain constraints. Would a combination of gyropscope and accelerometer be more accurate even without an magnetometer?