Skip to content

Commit dae3198

Browse files
committed
Merge pull request #4 from floogulinc/patch-1
Update README.md with JSON format configuration
2 parents 56a2a02 + 65c0b5d commit dae3198

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

README.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,35 @@
22
The All in One RobotDrive framework for those who want an easy solution
33

44
## What is this
5-
Universal Drive is a Toast Module that acts as a framework for the RobotDrive in WPILib. This module allows users to configure their driving preferences through Toast's Configuration Files, as seen below:
6-
```groovy
7-
// The type of Drive to use. Possible options are: [TANK, MECANUM, ARCADE]
8-
drive.type = "MECANUM"
9-
10-
// Whether or not to use squared inputs on tank and arcade drive
11-
drive.squaredinputs = false
12-
13-
// The interface to use for the Motor Controllers. Possible values are: [PWM, CAN]
14-
drive.interface = "PWM"
15-
16-
// The type of motor controller to use. Possible values are: [Talon, Jaguar, Victor, Victor SP]
17-
drive.motor = "Talon"
5+
Universal Drive is a Toast Module that acts as a framework for the RobotDrive in WPILib. This module allows users to configure their driving preferences through its configuration file (`toast/config/UniversalDrive.conf`), as seen below:
6+
```json
7+
{
8+
"joy":{
9+
"layout":"XBOX_STICK",
10+
"port":0
11+
},
12+
"drive":{
13+
"motor":"Talon",
14+
"type":"TANK",
15+
"ports":[0,1],
16+
"interface":"PWM",
17+
"squaredinputs":false
18+
}
19+
}
20+
```
1821

19-
// The motor ports to use. This is the PWM/CAN interface ID the motor controller is attached to.
20-
// Pattern: [left, right] OR [front left, back left, front right, back right]
21-
drive.ports = [0, 1, 2, 3]
22+
Name | Description
23+
--- | ---
24+
**`joy`** | **Joystick settings**
25+
`layout` | Defines the Control Layout of the Joystick. This is different per Drive Type. <br> `TANK`: `XBOX_STICK` (analog L/R stick drive) <br> `MECANUM`: `XBOX_STICK` (L analog stick for X/Y, R analog stick for rotation) <br> `ARCADE`: `XBOX_STICK` (analog L stick drive)
26+
`port` | Get the JoyStick port to use for the Drive
27+
**`drive`** | **Drive settings**
28+
`motor` | The type of motor controller to use. Possible values are: `"Talon"`, `"Jaguar"`, `"Victor"`, `"Victor SP"`
29+
`type` | The type of Drive to use. Possible options are: `"TANK"`, `"MECANUM"`, `"ARCADE"`
30+
`ports` | The motor ports to use. This is the PWM/CAN interface ID the motor controller is attached to. <br> Pattern: `[left, right]` or `[front left, back left, front right, back right]`
31+
`interface` | The interface to use for the Motor Controllers. Possible values are: `"PWM"` or `"CAN"`
32+
`squaredinputs` | Whether or not to use squared inputs on tank and arcade drive. Possible values are: `true` or `false`
2233

23-
// Get the JoyStick port to use for the Drive
24-
joy.port = 0
2534

26-
// Defines the Control Layout of the Joystick. This is different per Drive Type.
27-
// TANK: XBOX_STICK (analog L/R stick drive)
28-
// MECANUM: XBOX_STICK (L analog stick for X/Y, R analog stick for rotation)
29-
// ARCADE: XBOX_STICK (analog L stick drive)
30-
joy.layout = "XBOX_STICK"
31-
```
3235

3336
This configuration file allows for users to quickly and easily setup their driving configuration for their robot without any coding required. This can be extremely useful for spinning up a Drive Base really quickly, or for teams who don't have much coding knowledge and want to get the Robot Driving. Additionally, the project is open source, meaning teams can contribute their expertise in fine-tuning drive systems so the API is always at it's most stable.

0 commit comments

Comments
 (0)