2015 Protocol
Pages 2
Clone this wiki locally
Similarities:
- UDP based
Differences
- Packets are much smaller. ~10 bytes on average compared to 1024.
- More than just 2 packets exist now. There are at least 4 packets that extend information.
- No CRC32 checking
Tested Conditions on 1/10/15
- Windows 8.1
- Team 178
- Getting Started Example Robot Java Project
- Timezone EST, no Daylight Savings
- No joysticks or custom HID
Client to roboRIO
General Packet
Sent every: 0.02s (50 Hz)
Sends to port: 1110
Length: 6 bytes (Appears to be with tested conditions)
Bytes:
- 1-2: Ping
- 3: Protocol Version (
01) - 4: Control byte
-
00when Driver Stations starts. Probably means disabled. -
04during TeleOperated. -
06during Autonomous. -
05during Test. -
80during Emergency Stop
-
- 5: Request Byte
-
10during normal conditions -
11to request version -
12to request usage data -
14during Reboot Robot Code and until next roboRIO response -
18during Reboot roboRIO and until next roboRIO response
-
- 6: Alliance and position
-
00for red 1 -
01for red 2 -
02for red 3 -
03for blue 1 -
04for blue 2 -
05for blue 3
-
The rest of the packet is composed of Joystick structures, these are dynamically sized so they cannot be assigned to specific bytes. The rest of the packet consists of N Joystick structures, where N is the number of joysticks registered with your DriverStation. A single Joystick structure has the following fields.
-
Joystick
- Size of this Joystick structure, excluding this byte
- Section Header: Joystick : always 0x0c
- Number of axis'
- Axis values, one byte per axis
- Number of buttons
-
Button states, each button is represented as
2^button. The states is the sum of all the calculated values of the buttons:- If a button is not pressed, its value will be 0
- Button 0 is represented as 1 (
2^0 = 1) - Button 1 is represented as 2 (
2^1 = 2) - Button 2 is represented as 4 (
2^2 = 4) - Button 9 is represented as 512 (
2^9 = 512) - If buttons 0 and 1 are pressed, we must send 3 (
1 + 2 = 3) - If buttons 4 and 5 are pressed, we must send 48 (
2^4 + 2^5 = 16 + 32 = 48)
Number of POV controls
- Current angle of each POV control, range 0-360 or -1 when inactive. Two bytes per control.
Connected Packet
Appears to be sent twice after the first roboRIO response and after a roboRIO reboot.
Length: 27 bytes (Appears to be with Example Java Project)
Bytes:
- 1-2: Ping
- 14-27: timezone in ASCII (
EST5EDTduring testing)
General Packet (with 1 joystick)
Sent every: 0.02s (50 Hz)
Length: 24 bytes (Appears to be with tested conditions)
Bytes:
- 1-6: Information from general packet
roboRIO to Client
General Packet
One of the expanded packets will replace this one when their period or appropriate time comes.
Sends to port: 1150
Sent every: 0.02s (50 Hz).
Length: 8 bytes (Appears to be with tested conditions)
Bytes:
- 1-2: Pong
- 3: Protocol Version (
01) - 4: Echo/confirmation of control byte.
- 5: User program status.
-
(status & 0x01) != 0: Disabled? -
(status & 0x02) != 0: Teleoperated? -
(status & 0x04) != 0: Autonomous? -
(status & 0x08) != 0: Test? -
(status & 0x10) != 0: roboRIO? -
(status & 0x20) != 0: User code present?
-
- 6: XX in XX.YY for battery voltage in hex (ex: 10 of 10.38)
- 7: YY in XX.YY for battery voltage in hex (ex: 38 of 10.38)
- Note: lopsided98 has noticed that this value may be larger than 100 on occasion, which means the information here for this value may not be correct.
- 8: Request byte.
-
00: Nothing -
01: The robot is requesting the current time and date
-
24 byte Expanded Packet
Sent every: 1s (1 Hz)
Length: 24 bytes (Appears to be with tested conditions)
Bytes:
- 1-8: Information from general packet
- 9: Unknown.
0fwith tested conditions. - 10: Unknown.
0ewith tested conditions. - 11-21: Unknown. All
00with tested conditions. - 22: Unknown.
01with tested conditions. - 23: Unknown.
00with tested conditions. - 24: Unknown.
80with tested conditions.
43 byte Expanded Packet
This packet is sent 0.1s (5 packets) after the 24 byte expanded packet
Sent every: 1s (1 Hz)
Length: 43 bytes (Appears to be with tested conditions)
Bytes
- 1-8: Information from general packet
18 byte Expanded Packet #1
This packet is sent 0.1s (5 packets) after the 43 byte expanded packet
Sent every: 1s (1 Hz)
Length: 18 bytes (Appears to be with tested conditions)
Bytes:
- 1-8: Information from general packet
- 9: Unknown
09with tested conditions. - 10: Unknown.
04with tested conditions. - 11-14: Unknown.
00000000with tested conditions. - 15: Unknown.
10with tested conditions. - 16: Unknown.
39with tested conditions. - 17-18: Unknown.
0000with tested conditions.
18 byte Expanded Packet #2
This packet is sent 0.1s (5 packets) after the 18 byte expanded packet #1.
Sent every: 1s (1 Hz)
Length: 18 bytes (Appears to be with tested conditions)
Bytes:
- 1-8: Information from general packet
- 9: Unknown
09with tested conditions. - 10: Unknown.
06with tested conditions. - 11-14: Unknown.
00000000with tested conditions. - 15: Unknown.
04with tested conditions. - 16: Unknown.
19with tested conditions. - 17: Unknown.
10with tested conditions. - 18: Unknown.
00with tested conditions.