Skip to content

vision logging#85

Open
Levercpu wants to merge 25 commits intomainfrom
LS_Vision_Simulation_+Logging
Open

vision logging#85
Levercpu wants to merge 25 commits intomainfrom
LS_Vision_Simulation_+Logging

Conversation

@Levercpu
Copy link
Contributor

No description provided.

Constants.SET_MODULE_ENCODER_AUTO_SYNCHRONIZE_DEADBAND); // Enable if you want to resynchronize your absolute encoders and motor encoders periodically when they are not moving.
// swerveDrive.pushOffsetsToEncoders(); // Set the absolute encoder to be used over the internal encoder and push the offsets onto it. Throws warning if not possible

rawOdometry = new SwerveDriveOdometry(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking more closely at what we need to do, I am not certain we want raw odometry without vision. The YAGSL maintains a SwerveDrivePoseEstimator which wraps around a SwerveDriveOdometry which extends PoseEstimator which has support for vision measurements.
So it seems to me that when we are processing a vision input from the camera, we should be comparing it against the latest known position, including all the previous vision adjustments, to help us filter them odd ones out.
So I am no longer sure we need getOdom that only considers odometry from the swerve, certainly YAGSL does not maintain one.
Also, maintaining an extra odometry calculation seems expensive.
Am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our vision filter would need to be refactored then

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why. Maybe we should discuss so we can plan.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe put in sim wrapper (with utility class)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put in wrapper

public double getError() {
return getPose().getTranslation().getDistance((getSimulationPose().get().getTranslation()));
}
public double getAverageError(){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious to see whether this contains any non-zero values - AFAICT, the simulation pose is only applicable in simulation and the real pose is only available in non-simulation, so when would we be able to compare them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the getpose is the estimated pose from the vision measurements and drift adjusted odometry (trying to model real life performance)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getPose is swerveDrive.getPose(), which is the combined vision and odometry. swerveDrive.getSimulationDriveTrainPose() is the pose during simulation. What does the difference between them tell us?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the getpose has simulated error added on

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put in wrapper kept for now


@Override
public void processQueue() {
double currentTime = Logger.getTimestamp()/1000000.0;
Copy link
Contributor

@armadilloz armadilloz Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see what these changes amount to: Other than more log entries, what is the purpose?
With all the details being change like variable names and locations, it's really hard to distill the semantics of what changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

easier to count how many tags we saw over the last second, allowing us to know if we had steady vision in the last second. (one thing that batchen said she wanted to be able to know)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we should ask BatChen what she asked for. Can you ping us both on Discord so we can discuss?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

FilterResult r = entry.getValue();
for (Map.Entry<VisionMeasurement, FilterResult> filterEntry : filteredData.entrySet()) {
VisionMeasurement v = filterEntry.getKey();
Apriltag tag = v.tag().tag();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm not mistaken, this is the only place where the TagPose class is used. I believe everything this class could be achieved by the AprilTag itself since it already has its own pose.
Also, since the pose is fixed per tag, logging the pose is not that interesting since it will always be the same.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

batchen said she wanted to be able to see the tag poses and tag ids together in one logging for easier lookup

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets discuss with her...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Levercpu added 5 commits March 1, 2026 13:38
…a_2026 into LS_Vision_Simulation_+Logging

# Conflicts:
#	src/main/java/frc/robot/apriltags/SimApriltagIO.java
#	src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java
@Levercpu Levercpu requested a review from armadilloz March 1, 2026 18:53
Levercpu added 10 commits March 4, 2026 19:37
…a_2026 into LS_Vision_Simulation_+Logging

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
…ision_Simulation_+Logging

# Conflicts:
#	src/main/java/frc/robot/Robot.java
#	src/main/java/frc/robot/apriltags/SimApriltagIO.java
#	src/main/java/frc/robot/constants/GameConstants.java
#	src/main/java/frc/robot/subsystems/swervedrive/SwerveSubsystem.java
@Levercpu Levercpu changed the base branch from LS_Vision_Simulation to main March 10, 2026 00:16
@Levercpu Levercpu requested a review from armadilloz March 10, 2026 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants