001/* 002 * MIT License 003 * 004 * Copyright (c) PhotonVision 005 * 006 * Permission is hereby granted, free of charge, to any person obtaining a copy 007 * of this software and associated documentation files (the "Software"), to deal 008 * in the Software without restriction, including without limitation the rights 009 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 010 * copies of the Software, and to permit persons to whom the Software is 011 * furnished to do so, subject to the following conditions: 012 * 013 * The above copyright notice and this permission notice shall be included in all 014 * copies or substantial portions of the Software. 015 * 016 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 017 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 018 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 019 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 020 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 021 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 022 * SOFTWARE. 023 */ 024 025package org.photonvision; 026 027import edu.wpi.first.math.geometry.Pose3d; 028import java.util.List; 029import org.photonvision.PhotonPoseEstimator.PoseStrategy; 030import org.photonvision.targeting.PhotonTrackedTarget; 031 032/** An estimated pose based on pipeline result */ 033public class EstimatedRobotPose { 034 /** The estimated pose */ 035 public final Pose3d estimatedPose; 036 037 /** The estimated time the frame used to derive the robot pose was taken */ 038 public final double timestampSeconds; 039 040 /** A list of the targets used to compute this pose */ 041 public final List<PhotonTrackedTarget> targetsUsed; 042 043 /** The strategy actually used to produce this pose */ 044 public final PoseStrategy strategy; 045 046 /** 047 * Constructs an EstimatedRobotPose 048 * 049 * @param estimatedPose estimated pose 050 * @param timestampSeconds timestamp of the estimate 051 */ 052 public EstimatedRobotPose( 053 Pose3d estimatedPose, 054 double timestampSeconds, 055 List<PhotonTrackedTarget> targetsUsed, 056 PoseStrategy strategy) { 057 this.estimatedPose = estimatedPose; 058 this.timestampSeconds = timestampSeconds; 059 this.targetsUsed = targetsUsed; 060 this.strategy = strategy; 061 } 062}