2020-12-26 14:12:05 -08:00
|
|
|
// Copyright (c) FIRST and other WPILib contributors.
|
|
|
|
|
// Open Source Software; you can modify and/or share it under the terms of
|
|
|
|
|
// the WPILib BSD license file in the root directory of this project.
|
2020-11-28 17:35:35 -05:00
|
|
|
|
|
|
|
|
#include "frc/estimator/MecanumDrivePoseEstimator.h"
|
|
|
|
|
|
|
|
|
|
#include <wpi/timestamp.h>
|
|
|
|
|
|
|
|
|
|
#include "frc/StateSpaceUtil.h"
|
|
|
|
|
#include "frc/estimator/AngleStatistics.h"
|
2023-02-17 17:53:17 -05:00
|
|
|
#include "wpimath/MathShared.h"
|
2020-11-28 17:35:35 -05:00
|
|
|
|
|
|
|
|
using namespace frc;
|
|
|
|
|
|
2022-12-03 12:46:10 -05:00
|
|
|
frc::MecanumDrivePoseEstimator::MecanumDrivePoseEstimator(
|
|
|
|
|
MecanumDriveKinematics& kinematics, const Rotation2d& gyroAngle,
|
|
|
|
|
const MecanumDriveWheelPositions& wheelPositions, const Pose2d& initialPose)
|
|
|
|
|
: MecanumDrivePoseEstimator{kinematics, gyroAngle,
|
|
|
|
|
wheelPositions, initialPose,
|
|
|
|
|
{0.1, 0.1, 0.1}, {0.45, 0.45, 0.45}} {}
|
|
|
|
|
|
2020-11-28 17:35:35 -05:00
|
|
|
frc::MecanumDrivePoseEstimator::MecanumDrivePoseEstimator(
|
2022-12-02 11:36:10 -05:00
|
|
|
MecanumDriveKinematics& kinematics, const Rotation2d& gyroAngle,
|
2022-11-18 23:42:00 -05:00
|
|
|
const MecanumDriveWheelPositions& wheelPositions, const Pose2d& initialPose,
|
2022-12-02 11:36:10 -05:00
|
|
|
const wpi::array<double, 3>& stateStdDevs,
|
|
|
|
|
const wpi::array<double, 3>& visionMeasurementStdDevs)
|
2023-06-19 17:10:39 -07:00
|
|
|
: PoseEstimator<MecanumDriveWheelSpeeds, MecanumDriveWheelPositions>(
|
|
|
|
|
kinematics, m_odometryImpl, stateStdDevs, visionMeasurementStdDevs),
|
|
|
|
|
m_odometryImpl(kinematics, gyroAngle, wheelPositions, initialPose) {}
|