-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,4 @@ | ||
{ | ||
"Keyboard 0 Settings": { | ||
"window": { | ||
"visible": true | ||
} | ||
}, | ||
"System Joysticks": { | ||
"window": { | ||
"visible": false | ||
|
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
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
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/com/team4099/robot2023/util/FrameCoordinate.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,30 @@ | ||
package com.team4099.robot2023.util | ||
|
||
import org.team4099.lib.geometry.Pose2d | ||
import org.team4099.lib.geometry.Transform2d | ||
import org.team4099.lib.geometry.Translation2d | ||
import org.team4099.lib.units.base.Length | ||
import org.team4099.lib.units.derived.degrees | ||
|
||
abstract class FrameCoordinate(val x: Length, val y: Length) { | ||
|
||
fun toTransform2d(): Transform2d { | ||
return Transform2d(Translation2d(x, y), 0.degrees) | ||
} | ||
|
||
fun toPose2d(): Pose2d { | ||
return Pose2d(x, y, 0.degrees) | ||
} | ||
|
||
class OdometryCoordinate(x: Length, y: Length) : FrameCoordinate(x, y) { | ||
constructor (pose2d: Pose2d) : this(pose2d.translation.x, pose2d.translation.y) | ||
} | ||
|
||
class FieldCoordinate(x: Length, y: Length) : FrameCoordinate(x, y) { | ||
constructor (pose2d: Pose2d) : this(pose2d.translation.x, pose2d.translation.y) | ||
} | ||
|
||
companion object { | ||
lateinit var robotInOdometryFrameSupplier: () -> Pose2d | ||
} | ||
} |