Aesl Program
Variables
State

Broadcast of compressed robot state at 10 Hz. More...

Variables

integer[1] R_state.do = {1}
 flag for R_state broadcast
 
integer[27] R_state
 [out] compressed robot state
 

Detailed Description

Broadcast of compressed robot state at 10 Hz.

The state of the robot's sensors, representing 36 words, is compressed into the 27 words of the R_state variable as described below. When R_state.do is nonzero, R_state is broadcast in an event of the same name (R_state) at 10 Hz by the prox event. Otherwise, clients are expected to fetch R_state at a frequency of their choosing.

words bits value words bits value
0 10-15 acc[0]/2 + 16 4 0-7 distance.front
0 5-9 acc[1]/2 + 16 5 motor.left.target
0 0-4 acc[2]/2 + 16 6 motor.right.target
1 8-15 mic.intensity/mic.threshold 7 motor.left.speed
1 5-7 (reserved) 8 motor.right.speed
1 4 button.backward 9 odo.degree
1 3 button.center 10 odo.x
1 2 button.forward 11 odo.y
1 1 button.left 12 prox.comm.rx
1 0 button.right 13 prox.comm.tx
2 8-15 angle.ground 14-15 prox.ground.delta[0:1]
2 0-7 angle.back 16-22 prox.horizontal[0:6]
3 angle.front 23-26 Qid[0:3]
4 8-15 distance.back