forked from Patribots4738/ChargedUp2023
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
3929014
commit d3d84ad
Showing
5 changed files
with
41 additions
and
18 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
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 |
---|---|---|
@@ -1,22 +1,19 @@ | ||
package frc.robot.util; | ||
|
||
import edu.wpi.first.math.geometry.Pose3d; | ||
import io.github.oblarg.oblog.Logger; | ||
import io.github.oblarg.oblog.annotations.Log; | ||
|
||
public class Pose3dLogger extends Logger{ | ||
@Log | ||
private Pose3d pose = new Pose3d(); | ||
|
||
public Pose3dLogger(Pose3d pose) { | ||
this.pose = pose; | ||
} | ||
|
||
public Pose3d getPose() { | ||
return this.pose; | ||
} | ||
|
||
public void setPose(Pose3d pose) { | ||
this.pose = pose; | ||
public class Pose3dLogger { | ||
public static synchronized double[] composePose3ds(Pose3d... value) { | ||
double[] data = new double[value.length * 7]; | ||
for (int i = 0; i < value.length; i++) { | ||
data[i * 7] = value[i].getX(); | ||
data[i * 7 + 1] = value[i].getY(); | ||
data[i * 7 + 2] = value[i].getZ(); | ||
data[i * 7 + 3] = value[i].getRotation().getQuaternion().getW(); | ||
data[i * 7 + 4] = value[i].getRotation().getQuaternion().getX(); | ||
data[i * 7 + 5] = value[i].getRotation().getQuaternion().getY(); | ||
data[i * 7 + 6] = value[i].getRotation().getQuaternion().getZ(); | ||
} | ||
return data; | ||
} | ||
} | ||
} |