11# RoadRunner Extension
22
3- This extension provides integration with the
4- [ RoadRunner Library] ( https://rr.brott.dev/ ) ,
3+ This extension provides integration with the
4+ [ RoadRunner Library] ( https://rr.brott.dev/ )
55and [ QuickStart] ( https://github.com/acmerobotics/road-runner-quickstart ) .
66
77## Installation
88
9- To install the RoadRunner extension,
10- add the following line to your ` build.gradle ` file :
9+ Add the following line to your ` build.gradle ` file
10+ to install the RoadRunner extension :
1111
1212``` groovy
1313implementation 'dev.nextftc.extensions:roadrunner:1.0.0'
1414```
1515
1616::: warning
17- Version ` 1.0.0 ` supports RoadRunner ` 1.0.1 ` ,
18- and RoadRunner FTC ` 0.1.25 ` ,
19- and is not compatible with earlier versions.
17+ Version ` 1.0.0 ` supports RoadRunner ` 1.0.1 `
18+ and RoadRunner FTC ` 0.1.25 ` , and is not compatible with earlier versions.
2019
21- This guide also assumes you are using
22- the QuickStart for RoadRunner,
20+ This guide also assumes you are using QuickStart for RoadRunner
2321and its ` MecanumDrive ` class.
2422:::
2523
2624## QuickStart Additions
2725
2826To use the RoadRunner extension,
29- you will need to make a few additions to the QuickStart code.
27+ make the following additions to the QuickStart code.
3028
3129First, make your ` MecanumDrive ` class extend ` NextFTCMecanumDrive ` :
3230
@@ -36,8 +34,8 @@ public class MecanumDrive extends NextFTCMecanumDrive {
3634}
3735```
3836
39- You will probably get an error about unimplemented members;
40- you can copy the following implementations into your class:
37+ You will probably get an error about unimplemented members.
38+ You can copy the following implementations into your class:
4139
4240``` java
4341 HolonomicController controller = new HolonomicController (
@@ -59,17 +57,21 @@ you can copy the following implementations into your class:
5957
6058 @Override
6159 public void setDrivePowersFF(@NotNull PoseVelocity2dDual<Time > powers) {
62- MecanumKinematics . WheelVelocities<Time > wheelVels = kinematics. inverse(poseVelocity2dDual);
60+ MecanumKinematics . WheelVelocities<Time > wheelVels =
61+ kinematics. inverse(poseVelocity2dDual);
6362 double voltage = voltageSensor. getVoltage();
6463
65- final MotorFeedforward feedforward = new MotorFeedforward (PARAMS . kS,
66- PARAMS . kV / PARAMS . inPerTick, PARAMS . kA / PARAMS . inPerTick);
64+ final MotorFeedforward feedforward = new MotorFeedforward (
65+ PARAMS . kS,
66+ PARAMS . kV / PARAMS . inPerTick,
67+ PARAMS . kA / PARAMS . inPerTick
68+ );
6769 double leftFrontPower = feedforward. compute(wheelVels. leftFront) / voltage;
6870 double leftBackPower = feedforward. compute(wheelVels. leftBack) / voltage;
6971 double rightBackPower = feedforward. compute(wheelVels. rightBack) / voltage;
7072 double rightFrontPower = feedforward. compute(wheelVels. rightFront) / voltage;
7173 mecanumCommandWriter. write(new MecanumCommandMessage (
72- voltage, leftFrontPower, leftBackPower, rightBackPower, rightFrontPower
74+ voltage, leftFrontPower, leftBackPower, rightBackPower, rightFrontPower
7375 ));
7476
7577 leftFront. setPower(feedforward. compute(wheelVels. leftFront) / voltage);
@@ -99,7 +101,7 @@ you can copy the following implementations into your class:
99101
100102Android Studio will probably suggest the necessary imports.
101103
102- There is an example ` MecanumDrive ` class in the NextFTC branch of my
104+ There is an example ` MecanumDrive ` class in the NextFTC branch of my
103105[ RoadRunner QuickStart fork] ( https://github.com/zachwaffle4/road-runner-quickstart/tree/nextftc ) .
104- Do note that this is just an example,
105- and it may not be updated to the latest version of RoadRunner or NextFTC.
106+ Note that this is just an example and may not be updated
107+ to the latest version of RoadRunner or NextFTC.
0 commit comments