-
Notifications
You must be signed in to change notification settings - Fork 0
2015 Protocol
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
- Windows 8.1
- Team 178
- Getting Started Example Robot Java Project
- Timezone EST, no Daylight Savings
- No joysticks or custom HID
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
-
00
when Driver Stations starts. Probably means disabled. -
04
during TeleOperated. -
06
during Autonomous. -
05
during Test. -
80
during Emergency Stop - 5: Request Byte
-
10
during normal conditions -
11
to request version -
12
to request usage data -
14
during Reboot Robot Code and until next roboRIO response -
18
during Reboot roboRIO and until next roboRIO response - 6: Alliance and position
-
00
for red 1 -
01
for red 2 -
02
for red 3 -
03
for blue 1 -
04
for blue 2 -
05
for 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.
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 (
EST5EDT
during testing)
Sent every: 0.02s (50 Hz)
Length: 24 bytes (Appears to be with tested conditions)
Bytes:
- 1-6: Information from 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
Sent every: 1s (1 Hz)
Length: 24 bytes (Appears to be with tested conditions)
Bytes:
- 1-8: Information from general packet
- 9: Unknown.
0f
with tested conditions. - 10: Unknown.
0e
with tested conditions. - 11-21: Unknown. All
00
with tested conditions. - 22: Unknown.
01
with tested conditions. - 23: Unknown.
00
with tested conditions. - 24: Unknown.
80
with tested conditions.
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
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
09
with tested conditions. - 10: Unknown.
04
with tested conditions. - 11-14: Unknown.
00000000
with tested conditions. - 15: Unknown.
10
with tested conditions. - 16: Unknown.
39
with tested conditions. - 17-18: Unknown.
0000
with tested conditions.
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
09
with tested conditions. - 10: Unknown.
06
with tested conditions. - 11-14: Unknown.
00000000
with tested conditions. - 15: Unknown.
04
with tested conditions. - 16: Unknown.
19
with tested conditions. - 17: Unknown.
10
with tested conditions. - 18: Unknown.
00
with tested conditions.