  Animal locomotion is often subject to constraints arising from
anatomical/physiological asymmetries. We use the nematode C.~elegans as a
minimal model system to ask whether such constraints might shape locomotion
patterns optimized during evolution. We focus on turning behaviours in two
contrasting environmental contexts: (i) random exploration in the absence of
strong stimuli and (ii) acute avoidance (escape) navigation upon encountering a
strong aversive stimulus. We characterise the full repertoire of reorientation
behaviours, including gradual reorientations and various posturally distinct
sharp turns. During exploration, our measurements and theoretical modelling
indicate that orientation fluctuations on short timescales are, on average,
optimized to compensate the constraining gradual turn bias on long timescales.
During escape, our data suggests that the reorientation is controlled not by an
analog logic of continuous turn-amplitude modulations, but rather through the
digital logic of selecting discrete turn types, leading to a symmetric escape
performance despite strongly asymmetric turning biases.
