Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

SwerveTelemetry: publish Pose2D & Field2D #56

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions simgui.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
"/SmartDashboard/Sim Field": "Field2d"
},
"windows": {
"/Pose": {
"bottom": 1476,
"height": 8.210550308227539,
"left": 150,
"right": 2961,
"top": 79,
"width": 16.541748046875,
"window": {
"visible": true
}
},
"/Shuffleboard/Intake/Intake Motor": {
"window": {
"visible": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import edu.wpi.first.wpilibj.util.Color;
import edu.wpi.first.wpilibj.util.Color8Bit;
import frc.robot.subsystems.swerve.kit.KitSwerveDrivetrain.SwerveDriveState;
import org.littletonrobotics.junction.Logger;

public class SwerveTelemetry {
private final double MaxSpeed;
Expand Down Expand Up @@ -97,7 +98,7 @@ public void telemeterize(SwerveDriveState state) {
Pose2d pose = state.Pose;
fieldTypePub.set("Field2d");
fieldPub.set(new double[] {pose.getX(), pose.getY(), pose.getRotation().getDegrees()});

Logger.recordOutput("SwervePoseCalculated", pose);
/* Telemeterize the robot's general speeds */
double currentTime = Utils.getCurrentTimeSeconds();
double diffTime = currentTime - lastTime;
Expand Down
Loading