Changes

Line 371: Line 371:     
Expects 0x20-byte zero-padded application ID (''Home Circuit'' uses "YVCOQ00000000XFB") and retrieves data stored in the kart unique to the application.
 
Expects 0x20-byte zero-padded application ID (''Home Circuit'' uses "YVCOQ00000000XFB") and retrieves data stored in the kart unique to the application.
 +
 +
=== Teleoperation ===
 +
 +
The kart is operated over UDP port 5102. It expects packets of the form:
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x0
 +
| 0x1
 +
| Throttle; a signed integer. -128 is full-speed reverse, +127 is full-speed forward.
 +
|-
 +
| 0x1
 +
| 0x1
 +
| Steering; a signed integer. -128 is full left, +127 is full right.
 +
|-
 +
| 0x2
 +
| 0x1
 +
| Brake light control. 0x00 turns the brake light off, 0x01 turns it on. This is independent of throttle.
 +
|-
 +
| 0x3
 +
| 0x1
 +
| Pad byte, apparently always zero.
 +
|-
 +
| 0x4
 +
| 0x4?
 +
| Little-endian packet counter. Incremented by 1 for each sent packet. Unknown total size.
 +
|-
 +
| 0x8?
 +
| 0x18?
 +
| Zero padding to bring the total packet size to 0x20.
 +
|}
 +
 +
''Home Circuit'' sends these packets at 30 Hz. Any rate that is at least 1 Hz will do, however. The kart will automatically zero the throttle (and only the throttle) if a valid packet is not received in a one-second period, as protection from loss of control.
 +
 +
The counter appears to be intended as a mechanism for detecting duplicated/reordered packets, as such packets will have a counter that is not greater than the previously-accepted packet and can be quickly discarded. However, it appears to be ignored entirely by the kart. Nevertheless, it is a good idea to include it anyway.
 +
 +
'''NOTICE:''' The throttle/steering values take effect immediately. ''Home Circuit'' applies smoothing to these values, possibly to simulate the physics of a much more massive kart. However, this smoothing may also be necessary to keep the kart from suffering undue mechanical stress.
 +
 +
'''NOTICE:''' ''Home Circuit'' contains logic to detect when the kart is being held, and it locks out the controls in such cases. This logic is not implemented in the kart, which will eagerly follow any valid throttle/steering command given. The kart is not likely to cause injury if operated while held, but nevertheless, if you do so, it is at your own risk.
    
= Versions =
 
= Versions =
30

edits