mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[docs] Add missing JavaDocs (#6146)
This commit is contained in:
@@ -40,7 +40,10 @@ public class ChassisSpeeds implements ProtobufSerializable, StructSerializable {
|
||||
/** Represents the angular velocity of the robot frame. (CCW is +) */
|
||||
public double omegaRadiansPerSecond;
|
||||
|
||||
/** ChassisSpeeds protobuf for serialization. */
|
||||
public static final ChassisSpeedsProto proto = new ChassisSpeedsProto();
|
||||
|
||||
/** ChassisSpeeds struct for serialization. */
|
||||
public static final ChassisSpeedsStruct struct = new ChassisSpeedsStruct();
|
||||
|
||||
/** Constructs a ChassisSpeeds with zeros for dx, dy, and theta. */
|
||||
|
||||
@@ -28,10 +28,14 @@ public class DifferentialDriveKinematics
|
||||
implements Kinematics<DifferentialDriveWheelSpeeds, DifferentialDriveWheelPositions>,
|
||||
ProtobufSerializable,
|
||||
StructSerializable {
|
||||
/** Differential drive trackwidth. */
|
||||
public final double trackWidthMeters;
|
||||
|
||||
/** DifferentialDriveKinematics protobuf for serialization. */
|
||||
public static final DifferentialDriveKinematicsProto proto =
|
||||
new DifferentialDriveKinematicsProto();
|
||||
|
||||
/** DifferentialDriveKinematics struct for serialization. */
|
||||
public static final DifferentialDriveKinematicsStruct struct =
|
||||
new DifferentialDriveKinematicsStruct();
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import edu.wpi.first.units.Distance;
|
||||
import edu.wpi.first.units.Measure;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Represents the wheel positions for a differential drive drivetrain. */
|
||||
public class DifferentialDriveWheelPositions
|
||||
implements WheelPositions<DifferentialDriveWheelPositions> {
|
||||
/** Distance measured by the left side. */
|
||||
|
||||
@@ -22,8 +22,11 @@ public class DifferentialDriveWheelSpeeds implements ProtobufSerializable, Struc
|
||||
/** Speed of the right side of the robot. */
|
||||
public double rightMetersPerSecond;
|
||||
|
||||
/** DifferentialDriveWheelSpeeds protobuf for serialization. */
|
||||
public static final DifferentialDriveWheelSpeedsProto proto =
|
||||
new DifferentialDriveWheelSpeedsProto();
|
||||
|
||||
/** DifferentialDriveWheelSpeeds struct for serialization. */
|
||||
public static final DifferentialDriveWheelSpeedsStruct struct =
|
||||
new DifferentialDriveWheelSpeedsStruct();
|
||||
|
||||
|
||||
@@ -48,7 +48,10 @@ public class MecanumDriveKinematics
|
||||
|
||||
private Translation2d m_prevCoR = new Translation2d();
|
||||
|
||||
/** MecanumDriveKinematics protobuf for serialization. */
|
||||
public static final MecanumDriveKinematicsProto proto = new MecanumDriveKinematicsProto();
|
||||
|
||||
/** MecanumDriveKinematics struct for serialization. */
|
||||
public static final MecanumDriveKinematicsStruct struct = new MecanumDriveKinematicsStruct();
|
||||
|
||||
/**
|
||||
@@ -217,18 +220,38 @@ public class MecanumDriveKinematics
|
||||
m_inverseKinematics.setRow(3, 0, 1, -1, -(rr.getX() + rr.getY()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the front-left wheel translation.
|
||||
*
|
||||
* @return The front-left wheel translation.
|
||||
*/
|
||||
public Translation2d getFrontLeft() {
|
||||
return m_frontLeftWheelMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the front-right wheel translation.
|
||||
*
|
||||
* @return The front-right wheel translation.
|
||||
*/
|
||||
public Translation2d getFrontRight() {
|
||||
return m_frontRightWheelMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rear-left wheel translation.
|
||||
*
|
||||
* @return The rear-left wheel translation.
|
||||
*/
|
||||
public Translation2d getRearLeft() {
|
||||
return m_rearLeftWheelMeters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the rear-right wheel translation.
|
||||
*
|
||||
* @return The rear-right wheel translation.
|
||||
*/
|
||||
public Translation2d getRearRight() {
|
||||
return m_rearRightWheelMeters;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import edu.wpi.first.util.protobuf.ProtobufSerializable;
|
||||
import edu.wpi.first.util.struct.StructSerializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Represents the wheel positions for a mecanum drive drivetrain. */
|
||||
public class MecanumDriveWheelPositions
|
||||
implements WheelPositions<MecanumDriveWheelPositions>,
|
||||
ProtobufSerializable,
|
||||
@@ -31,9 +32,12 @@ public class MecanumDriveWheelPositions
|
||||
/** Distance measured by the rear right wheel. */
|
||||
public double rearRightMeters;
|
||||
|
||||
/** MecanumDriveWheelPositions protobuf for serialization. */
|
||||
public static final MecanumDriveWheelPositionsProto proto = new MecanumDriveWheelPositionsProto();
|
||||
|
||||
/** MecanumDriveWheelPositions struct for serialization. */
|
||||
public static final MecanumDriveWheelPositionsStruct struct =
|
||||
new MecanumDriveWheelPositionsStruct();
|
||||
public static final MecanumDriveWheelPositionsProto proto = new MecanumDriveWheelPositionsProto();
|
||||
|
||||
/** Constructs a MecanumDriveWheelPositions with zeros for all member fields. */
|
||||
public MecanumDriveWheelPositions() {}
|
||||
|
||||
@@ -14,6 +14,7 @@ import edu.wpi.first.units.Velocity;
|
||||
import edu.wpi.first.util.protobuf.ProtobufSerializable;
|
||||
import edu.wpi.first.util.struct.StructSerializable;
|
||||
|
||||
/** Represents the wheel speeds for a mecanum drive drivetrain. */
|
||||
public class MecanumDriveWheelSpeeds implements ProtobufSerializable, StructSerializable {
|
||||
/** Speed of the front left wheel. */
|
||||
public double frontLeftMetersPerSecond;
|
||||
@@ -27,9 +28,12 @@ public class MecanumDriveWheelSpeeds implements ProtobufSerializable, StructSeri
|
||||
/** Speed of the rear right wheel. */
|
||||
public double rearRightMetersPerSecond;
|
||||
|
||||
public static final MecanumDriveWheelSpeedsStruct struct = new MecanumDriveWheelSpeedsStruct();
|
||||
/** MecanumDriveWheelSpeeds protobuf for serialization. */
|
||||
public static final MecanumDriveWheelSpeedsProto proto = new MecanumDriveWheelSpeedsProto();
|
||||
|
||||
/** MecanumDriveWheelSpeeds struct for serialization. */
|
||||
public static final MecanumDriveWheelSpeedsStruct struct = new MecanumDriveWheelSpeedsStruct();
|
||||
|
||||
/** Constructs a MecanumDriveWheelSpeeds with zeros for all member fields. */
|
||||
public MecanumDriveWheelSpeeds() {}
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ import org.ejml.simple.SimpleMatrix;
|
||||
*/
|
||||
public class SwerveDriveKinematics
|
||||
implements Kinematics<SwerveDriveKinematics.SwerveDriveWheelStates, SwerveDriveWheelPositions> {
|
||||
/** Wrapper class for swerve module states. */
|
||||
public static class SwerveDriveWheelStates {
|
||||
/** Swerve module states. */
|
||||
public SwerveModuleState[] states;
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,9 @@ package edu.wpi.first.math.kinematics;
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
/** Represents the wheel positions for a swerve drive drivetrain. */
|
||||
public class SwerveDriveWheelPositions implements WheelPositions<SwerveDriveWheelPositions> {
|
||||
/** The distances driven by the wheels. */
|
||||
public SwerveModulePosition[] positions;
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,9 +29,12 @@ public class SwerveModulePosition
|
||||
/** Angle of the module. */
|
||||
public Rotation2d angle = Rotation2d.fromDegrees(0);
|
||||
|
||||
public static final SwerveModulePositionStruct struct = new SwerveModulePositionStruct();
|
||||
/** SwerveModulePosition protobuf for serialization. */
|
||||
public static final SwerveModulePositionProto proto = new SwerveModulePositionProto();
|
||||
|
||||
/** SwerveModulePosition struct for serialization. */
|
||||
public static final SwerveModulePositionStruct struct = new SwerveModulePositionStruct();
|
||||
|
||||
/** Constructs a SwerveModulePosition with zeros for distance and angle. */
|
||||
public SwerveModulePosition() {}
|
||||
|
||||
|
||||
@@ -25,9 +25,12 @@ public class SwerveModuleState
|
||||
/** Angle of the module. */
|
||||
public Rotation2d angle = Rotation2d.fromDegrees(0);
|
||||
|
||||
public static final SwerveModuleStateStruct struct = new SwerveModuleStateStruct();
|
||||
/** SwerveModuleState protobuf for serialization. */
|
||||
public static final SwerveModuleStateProto proto = new SwerveModuleStateProto();
|
||||
|
||||
/** SwerveModuleState struct for serialization. */
|
||||
public static final SwerveModuleStateStruct struct = new SwerveModuleStateStruct();
|
||||
|
||||
/** Constructs a SwerveModuleState with zeros for speed and angle. */
|
||||
public SwerveModuleState() {}
|
||||
|
||||
|
||||
@@ -6,6 +6,11 @@ package edu.wpi.first.math.kinematics;
|
||||
|
||||
import edu.wpi.first.math.interpolation.Interpolatable;
|
||||
|
||||
/**
|
||||
* Interface for wheel positions.
|
||||
*
|
||||
* @param <T> Wheel positions type.
|
||||
*/
|
||||
public interface WheelPositions<T extends WheelPositions<T>> extends Interpolatable<T> {
|
||||
/**
|
||||
* Returns a copy of this instance.
|
||||
|
||||
Reference in New Issue
Block a user