-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added mirrored paths * documentation * Update build.gradle
- Loading branch information
Showing
4 changed files
with
47 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/kotlin/org/team5499/monkeyLib/path/MirroredPath.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.team5499.monkeyLib.path | ||
|
||
import org.team5499.monkeyLib.math.geometry.Pose2dWithCurvature | ||
|
||
/** | ||
* this class represents a path that can be mirrored over the centerline of the field | ||
* @property left is path on the left side of the field | ||
*/ | ||
public class MirroredPath(left: Path) { | ||
|
||
public val left: Path | ||
public val right: Path | ||
|
||
init { | ||
this.left = left | ||
val newPoints: MutableList<Pose2dWithCurvature> = left.points.toMutableList() | ||
for (i in 0..newPoints.size - 1) { | ||
newPoints.set(i, newPoints.get(i).mirror()) | ||
} | ||
this.right = Path(newPoints, left.velocities, left.reversed) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters