<?xml version="1.0"?>
<program>
	<robot file="xml/robot/turnloop.xml"/>
	<parameters>
		<N init="10" type="text"/>
		<radius init="3" type="text"/>
		<E init="12" type="text"/>
	</parameters>
	<controls>
		<turnangle init="0" min="-10" max="10"/>
	</controls>
	<main>
		<loop/>
	</main>
	<behaviors>
		<loop>
			<wave group="loop" phase="2/N" period="5"/>
			<turn group="turn" period="5"/>
		</loop>
	</behaviors>
	<automata>
		<wave states="bend, hold, straight, hold" times="1, (radius-1), 1, (N/2-radius-1)"/>
		<turn states="straight, hold, rotate, hold" times="1, (N/4-1)[abs($_0_accel_x) &lt; E], 1, (N/4-1)[abs($_0_accel_x)&gt;E]"/>
	</automata>
	<states>
		<bend angles="180/radius"/>
		<straight angles="0"/>
		<hold angles="@"/>
		<rotate angles="$turnangle"/>
	</states>
</program>
