-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2019.5.10: New module structure, 3d math (#16)
* FalconMotor Recode * make gradlew executable on unix systems * Fix missing abstract methods in SimFalconMotor * Introduce modeling using Components * Add ArmComponent * Add DefaultNativeUnitModel as a replacement for NativeFalconSRX * Add world and local transforms * Rename Vector3d to Translation3d * Add Velocity and Acceleration Transforms * Module structure * Forgot to commit some files * Delete .wpilib/ * Update README * Update README.md * Update README.md
- Loading branch information
Showing
147 changed files
with
1,530 additions
and
814 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies { | ||
// Apache Commons Math | ||
compile("org.apache.commons", "commons-math3", "3.6.1") | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
core/src/main/kotlin/org/ghrobotics/lib/mathematics/threedim/geometry/Pose3d.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,32 @@ | ||
package org.ghrobotics.lib.mathematics.threedim.geometry | ||
|
||
typealias Transform = Pose3d | ||
|
||
data class Pose3d( | ||
val translation: Translation3d = Translation3d.kZero, | ||
val rotation: Quaternion = Quaternion.kIdentity | ||
) { | ||
|
||
operator fun minus(other: Pose3d) = this + -other | ||
|
||
operator fun plus(other: Pose3d) = | ||
Pose3d( | ||
translation + (other.translation * rotation), | ||
rotation * other.rotation | ||
) | ||
|
||
operator fun unaryMinus(): Pose3d { | ||
val invertedRotation = -rotation | ||
return Pose3d((-translation) * invertedRotation, invertedRotation) | ||
} | ||
|
||
operator fun times(scalar: Double) = Pose3d( | ||
translation * scalar, | ||
rotation * scalar | ||
) | ||
|
||
operator fun div(scalar: Double) = times(1.0 / scalar) | ||
|
||
infix fun inFrameOfReferenceOf(fieldRelativeOrigin: Pose3d) = (-fieldRelativeOrigin) + this | ||
|
||
} |
Oops, something went wrong.