-
Notifications
You must be signed in to change notification settings - Fork 5
Communication
In our NCS benchmarking platform, we have two entities, i.e., the Lego Mindstorm Robot and the Controller, communicating through a network. This happens via exchange of sensor and actuation messages through UDP sockets.
The Robot periodically samples gyro rate, left and right motor position values with a few selected timestamp values. Subsequently, it sends them through the socket. Once the Robot loop starts, measured sensory information is packed into a structure of 10 'long long'
defined in src/packet.py:
R2H_PACKET_FORMAT = 'qqqqqqqqqqq'
R2H_PACKET_SIZE = struct.calcsize(R2H_PACKET_FORMAT)
One can add / remove more data fields to transfer more / less data based on the requirements.
Based on the latest measurements, the controller replies to the robot with a set of actuation signals:
H2R_PACKET_FORMAT = 'qq%sq' % (NO_OF_DELAYS * NO_OF_VOLTAGES_PER_DELAY)
H2R_PACKET_SIZE = struct.calcsize(H2R_PACKET_FORMAT)
The actuation signals are voltage values to apply to the left and right motors for a given set of sampling periods. This is done for delay compensation in case of lost or delayed information. The size of the H2R_PACKET_FORMAT
variable is dependent on the selected control policy for delay compensation. It can be tuned by changing the control policy and the variables NO_OF_DELAYS
, NO_OF_VOLTAGES_PER_DELAY
accordingly.
For more information please refer to our paper.