WPILibC++ 2025.1.1
|
Class for swerve drive odometry. More...
#include <frc/kinematics/SwerveDriveOdometry3d.h>
Public Member Functions | |
SwerveDriveOdometry3d (SwerveDriveKinematics< NumModules > kinematics, const Rotation3d &gyroAngle, const wpi::array< SwerveModulePosition, NumModules > &modulePositions, const Pose3d &initialPose=Pose3d{}) | |
Constructs a SwerveDriveOdometry3d object. | |
Public Member Functions inherited from frc::Odometry3d< wpi::array< SwerveModuleState, NumModules >, wpi::array< SwerveModulePosition, NumModules > > | |
Odometry3d (const Kinematics< wpi::array< SwerveModuleState, NumModules >, wpi::array< SwerveModulePosition, NumModules > > &kinematics, const Rotation3d &gyroAngle, const wpi::array< SwerveModulePosition, NumModules > &wheelPositions, const Pose3d &initialPose=Pose3d{}) | |
Constructs an Odometry3d object. | |
void | ResetPosition (const Rotation3d &gyroAngle, const wpi::array< SwerveModulePosition, NumModules > &wheelPositions, const Pose3d &pose) |
Resets the robot's position on the field. | |
void | ResetPose (const Pose3d &pose) |
Resets the pose. | |
void | ResetTranslation (const Translation3d &translation) |
Resets the translation of the pose. | |
void | ResetRotation (const Rotation3d &rotation) |
Resets the rotation of the pose. | |
const Pose3d & | GetPose () const |
Returns the position of the robot on the field. | |
const Pose3d & | Update (const Rotation3d &gyroAngle, const wpi::array< SwerveModulePosition, NumModules > &wheelPositions) |
Updates the robot's position on the field using forward kinematics and integration of the pose over time. | |
Class for swerve drive odometry.
Odometry allows you to track the robot's position on the field over a course of a match using readings from your swerve drive encoders and swerve azimuth encoders.
Teams can use odometry during the autonomous period for complex tasks like path following. Furthermore, odometry can be used for latency compensation when using computer-vision systems.
|
inline |
Constructs a SwerveDriveOdometry3d object.
kinematics | The swerve drive kinematics for your drivetrain. |
gyroAngle | The angle reported by the gyroscope. |
modulePositions | The wheel positions reported by each module. |
initialPose | The starting position of the robot on the field. |