Skip to content

Commit 2a573d0

Browse files
authored
feat(hardware): add documentation for drivetrain command scalars
1 parent 708af15 commit 2a573d0

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

src/nextftc/hardware/drivetrain-commands.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
> Some of the content on the following pages was taken with permission from
55
> the [FTCLib Drivebases page](https://docs.ftclib.org/ftclib/features/drivebases).
66
7+
## Drivetrains
8+
79
> [!IMPORTANT]
810
> Currently, NextFTC only has support for mecanum, x-drive, and differential
911
> (tank) drivetrains. If you write a command for another, please share it with
@@ -12,7 +14,7 @@
1214
NextFTC has commands to control different types of drivetrains. This page goes
1315
through the different options for controlling your drivetrain in TeleOp.
1416

15-
## Holonomic Drivetrains
17+
### Holonomic Drivetrains
1618

1719
A holonomic drive is one that can move in omnidirectional space, which is why it
1820
is often called an omnidirectional drive. There are different subtypes of
@@ -48,7 +50,7 @@ To control a holonomic drivetrain in TeleOp, see
4850
the [holonomic drivetrain](/nextftc/hardware/drivetrain-commands/holonomic)
4951
page.
5052

51-
## Differential (Tank) Drivetrains
53+
### Differential (Tank) Drivetrains
5254

5355
A differential drivetrain is one that has two motors or motor groups on either
5456
side of the robot. Each side acts as a connected set or motor group.
@@ -62,4 +64,28 @@ side of the robot. Each side acts as a connected set or motor group.
6264
:::
6365

6466
To control a differential drivetrain in TeleOp, see the [differential
65-
drivetrain](/nextftc/hardware/drivetrain-commands/differential) page.
67+
drivetrain](/nextftc/hardware/drivetrain-commands/differential) page.
68+
69+
## Scalars
70+
71+
All drivetrain commands extend `DriverControlledCommand`, which provides scalars.
72+
73+
:::tabs key:code
74+
75+
== Kotlin
76+
77+
```kotlin
78+
val driverControlled: DriverControlledCommand = MecanumDriverControlled(...)
79+
80+
driverControlled.scalar = 0.5 // makes it half the speed
81+
```
82+
83+
== Java
84+
85+
```java
86+
DriverControlledCommand driverControlled = new MecanumDriverControlled(...);
87+
88+
driverControlled.setScalar(0.5); // makes it half the speed
89+
```
90+
91+
:::

0 commit comments

Comments
 (0)