From aa1bcde59650f5b738b42772c58b3e7a96f62973 Mon Sep 17 00:00:00 2001 From: Lucas Bubner Date: Tue, 3 Dec 2024 21:25:58 +1030 Subject: [PATCH] English linting --- .../shims/internal/StartingConfiguration.kt | 2 +- .../meepmeep/shims/internal/TaskBuilder.kt | 4 +-- .../meepmeep/shims/internal/units/Angle.java | 2 +- .../meepmeep/shims/internal/units/Measure.kt | 8 ++--- .../shims/internal/units/MutableMeasure.kt | 7 ++-- .../meepmeep/shims/internal/units/Units.java | 12 +++---- .../shims/internal/units/Velocity.java | 4 +-- .../collections/ReadOnlyPrimitiveLongSet.java | 2 +- .../bunyipslib/AutonomousBunyipsOpMode.java | 16 ++++----- .../bunyipslib/BunyipsOpMode.kt | 12 +++---- .../bunyipslib/BunyipsSubsystem.java | 2 +- .../bunyipslib/CommandBasedBunyipsOpMode.java | 2 +- .../studentrobotics/bunyipslib/Condition.java | 6 ++-- .../sa/mbhs/studentrobotics/bunyipslib/Dbg.kt | 20 +++++------ .../bunyipslib/DualTelemetry.kt | 24 ++++++------- .../bunyipslib/IndexedTable.java | 2 +- .../bunyipslib/MovingAverageTimer.java | 2 +- .../studentrobotics/bunyipslib/RobotConfig.kt | 4 +-- .../studentrobotics/bunyipslib/Scheduler.kt | 34 +++++++++---------- .../bunyipslib/UserSelection.kt | 4 +-- .../external/InterpolatedLookupTable.java | 2 +- .../bunyipslib/external/Mathf.kt | 7 ++-- .../bunyipslib/external/TelemetryMenu.java | 2 +- .../external/control/SystemController.java | 2 +- .../external/control/pid/PIDFController.java | 25 +++++++------- .../control/pid/ProfiledPIDController.java | 4 +-- .../bunyipslib/external/units/Angle.java | 2 +- .../bunyipslib/external/units/Measure.kt | 8 ++--- .../external/units/MutableMeasure.kt | 7 ++-- .../bunyipslib/external/units/Units.java | 12 +++---- .../bunyipslib/external/units/Velocity.java | 4 +-- .../collections/ReadOnlyPrimitiveLongSet.java | 2 +- .../bunyipslib/hardware/IMUEx.java | 6 ++-- .../bunyipslib/hardware/Motor.java | 20 +++++------ .../bunyipslib/hardware/ProfiledServo.java | 4 +-- .../bunyipslib/integrated/HardwareTester.java | 2 +- .../accumulators/BoundedAccumulator.java | 4 +-- .../accumulators/PeriodicIMUAccumulator.java | 2 +- .../bunyipslib/roadrunner/TaskBuilder.kt | 4 +-- .../bunyipslib/subsystems/DualServos.java | 2 +- .../subsystems/HoldableActuator.java | 6 ++-- .../tasks/HolonomicVectorDriveTask.java | 2 +- .../bunyipslib/tasks/MoveToContourTask.java | 2 +- .../bunyipslib/tasks/bases/ActionTask.java | 2 +- .../bunyipslib/tasks/bases/Lambda.java | 2 +- .../bunyipslib/tasks/bases/SelectTask.java | 2 +- .../bunyipslib/tasks/bases/Task.kt | 6 ++-- .../bunyipslib/transforms/Controls.kt | 2 +- .../bunyipslib/transforms/Direction.kt | 4 +-- .../transforms/StartingConfiguration.kt | 4 +-- .../transforms/StartingPositions.kt | 2 +- .../studentrobotics/bunyipslib/util/Text.java | 2 +- .../bunyipslib/vision/Processor.java | 12 +++---- .../bunyipslib/vision/Vision.java | 34 +++++++++---------- .../vision/processors/AprilTag.java | 18 +++++----- .../vision/processors/ColourSensor.java | 2 +- .../vision/processors/ColourThreshold.java | 10 +++--- 57 files changed, 197 insertions(+), 205 deletions(-) diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/StartingConfiguration.kt b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/StartingConfiguration.kt index 5a61ffc47..898cfe972 100644 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/StartingConfiguration.kt +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/StartingConfiguration.kt @@ -236,7 +236,7 @@ object StartingConfiguration { private val flags = mutableSetOf() /** - * Translate backward from the center of the field tile to your robot center as defined by your translate step. + * Translate backward from the center of the field tile to your robot center as defined by your translation step. * This is to align your robot to touching the field wall. */ fun backward(translationBack: Measure): PrebuiltPosition { diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/TaskBuilder.kt b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/TaskBuilder.kt index f8565db3e..4027a989d 100644 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/TaskBuilder.kt +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/TaskBuilder.kt @@ -126,12 +126,12 @@ class TaskBuilder( apply { afterTime(dt, unit, InstantAction(f)) } /** - * Sets the tangent of thebuilder = builder. + * Sets the tangent of the builder to respect on the next trajectories. */ fun setTangent(r: Rotation2d) = apply { builder = builder.setTangent(r) } /** - * Sets the tangent of thebuilder = builder. + * Sets the tangent of the builder to respect on the next trajectories. */ @JvmOverloads fun setTangent(r: Double, unit: Angle = Radians) = diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Angle.java b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Angle.java index 253450a73..9a979066f 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Angle.java +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Angle.java @@ -16,7 +16,7 @@ * @since 1.0.0-pre */ // Technically, angles are unitless dimensions -// eg Mass * Distance * Velocity is equivalent to (Mass * Distance) / Time - otherwise known +// e.g. Mass * Distance * Velocity is equivalent to (Mass * Distance) / Time - otherwise known // as Power - in other words, Velocity is /actually/ Frequency public class Angle extends Unit { /** diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Measure.kt b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Measure.kt index 9846dcde6..235b0eb5c 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Measure.kt +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Measure.kt @@ -37,7 +37,7 @@ interface Measure> : Comparable> { fun unit(): U /** - * Converts this measure to a measure with a different unit of the same type, eg minutes to + * Converts this measure to a measure with a different unit of the same type, e.g. minutes to * seconds. Converting to the same unit is equivalent to calling [magnitude]. * * For Kotlin users, calling this method can be done with the notation \`in\` @@ -61,7 +61,7 @@ interface Measure> : Comparable> { } /** - * Converts this measure to a measure with a different unit of the same type, eg minutes to + * Converts this measure to a measure with a different unit of the same type, e.g. minutes to * seconds. Converting to the same unit is equivalent to calling [magnitude]. * * ``` @@ -111,7 +111,7 @@ interface Measure> : Comparable> { val numerator = (unit() as Per<*, *>).numerator() return numerator.ofBaseUnits(baseUnitMagnitude() * other.baseUnitMagnitude()) } else if (unit() is Velocity<*> && other.unit().baseUnit == Units.Seconds) { - // Multiplying a velocity by a time, return the scalar unit (eg Distance) + // Multiplying a velocity by a time, return the scalar unit (e.g. Distance) val numerator = (unit() as Velocity<*>).unit return numerator.ofBaseUnits(baseUnitMagnitude() * other.baseUnitMagnitude()) } else if (other.unit() is Per<*, *> @@ -129,7 +129,7 @@ interface Measure> : Comparable> { .baseUnit == (other.unit() as Per<*, *>).denominator().baseUnit) ) { - // multiplying eg meters per second * milliseconds per foot + // multiplying e.g. meters per second * milliseconds per foot // return a scalar return Units.Value.of(baseUnitMagnitude() * other.baseUnitMagnitude()) } diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/MutableMeasure.kt b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/MutableMeasure.kt index 388cba097..a393a10f9 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/MutableMeasure.kt +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/MutableMeasure.kt @@ -7,16 +7,13 @@ import java.util.Objects /** * A specialization of [Measure] that allows for mutability. This is intended to be used for - * memory use reasons (such as on the memory-restricted roboRIO 1 or 2 or SBC coprocessors) and - * should NOT be exposed in the public API for a class that uses it. - * + * memory use reasons and should NOT be exposed in the public API for a class that uses it. * * The advantage of using this class is to reuse one instance of a measurement object, as opposed * to instantiating a new immutable instance every time an operation is performed. This will reduce * memory pressure, but comes at the cost of increased code complexity and sensitivity to race * conditions if misused. * - * * Any unsafe methods are prefixed with `mut_*`, such as [mut_plus] or * [mut_replace]. These methods will change the internal state of the measurement * object, and as such can be dangerous to use. They are primarily intended for use to track @@ -115,7 +112,7 @@ class MutableMeasure> private constructor( baseUnitMagnitudeVal += other.baseUnitMagnitude() // can't naively use magnitude += other.in(unit) because the units may not - // be scalar multiples (eg adding 0C to 100K should result in 373.15K, not 100K) + // be scalar multiples (e.g. adding 0C to 100K should result in 373.15K, not 100K) magnitudeVal = unitVal.fromBaseUnits(baseUnitMagnitudeVal) return this } diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Units.java b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Units.java index 768c101df..6cc2f4fe3 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Units.java +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Units.java @@ -281,7 +281,7 @@ private Units() { public static final Dimensionless Value = BaseUnits.Value; /** - * A dimensionless unit equal to to 1/100th of a {@link #Value}. A measurement of {@code + * A dimensionless unit equal to 1/100th of a {@link #Value}. A measurement of {@code * Percent.of(42)} would be equivalent to {@code Value.of(0.42)}. */ public static final Dimensionless Percent = derive(Value).splitInto(100).named("Percent").symbol("%").make(); @@ -429,7 +429,7 @@ private Units() { public static final Per>> VoltsPerRadianPerSecondSquared = Volts.per(RadiansPerSecond.per(Second)); /** - * Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). + * Creates a unit equal to a thousandth of the base unit, e.g. Milliseconds = Milli(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -442,7 +442,7 @@ public static > U Milli(Unit baseUnit, String name, String } /** - * Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). + * Creates a unit equal to a thousandth of the base unit, e.g. Milliseconds = Milli(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -467,7 +467,7 @@ public static > U Micro(Unit baseUnit, String name, String } /** - * Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds). + * Creates a unit equal to a millionth of the base unit, e.g. Microseconds = Micro(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -478,7 +478,7 @@ public static > U Micro(Unit baseUnit) { } /** - * Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). + * Creates a unit equal to a thousand of the base unit, e.g. Kilograms = Kilo(Units.Grams). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -491,7 +491,7 @@ public static > U Kilo(Unit baseUnit, String name, String s } /** - * Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). + * Creates a unit equal to a thousand of the base unit, e.g. Kilograms = Kilo(Units.Grams). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Velocity.java b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Velocity.java index 9bbf0fd39..91dd076da 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Velocity.java +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/Velocity.java @@ -143,7 +143,7 @@ public static > Velocity combine(Unit numerator, Time pe } /** - * Gets the major unit being measured (eg Meters for Meters per Second). + * Gets the major unit being measured (e.g. Meters for Meters per Second). * * @return the major unit */ @@ -152,7 +152,7 @@ public D getUnit() { } /** - * Gets the period unit of the velocity, eg Seconds or Milliseconds. + * Gets the period unit of the velocity, e.g. Seconds or Milliseconds. * * @return the period unit */ diff --git a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/collections/ReadOnlyPrimitiveLongSet.java b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/collections/ReadOnlyPrimitiveLongSet.java index 3c9a3660d..dc0c7be2c 100755 --- a/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/collections/ReadOnlyPrimitiveLongSet.java +++ b/MeepMeep/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/roadrunner/meepmeep/shims/internal/units/collections/ReadOnlyPrimitiveLongSet.java @@ -102,7 +102,7 @@ public LongStream stream() { } /** - * Creates a new array that contains all of the values in the set. + * Creates a new array that contains all the values in the set. * * @return an array containing all the values in the set */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/AutonomousBunyipsOpMode.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/AutonomousBunyipsOpMode.java index e275f392c..8233cd48c 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/AutonomousBunyipsOpMode.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/AutonomousBunyipsOpMode.java @@ -39,13 +39,13 @@ */ public abstract class AutonomousBunyipsOpMode extends BunyipsOpMode { /** - * Used for tasks that have no timeout to generate a "estimate to OpMode completion" metric. + * Used for tasks that have no timeout to generate an "estimate to OpMode completion" metric. * Purely visual, and does not affect the actual task (hence why this field is not exposed to FtcDashboard). */ public static double INFINITE_TASK_ASSUMED_DURATION_SECONDS = 5.0; private final ArrayList> opModes = new ArrayList<>(); private final ConcurrentLinkedDeque tasks = new ConcurrentLinkedDeque<>(); - // Pre and post queues cannot have their tasks removed, so we can rely on their .size() methods + // Pre- and post-queues cannot have their tasks removed, so we can rely on their .size() methods private final ConcurrentLinkedDeque postQueue = new ConcurrentLinkedDeque<>(); private final ConcurrentLinkedDeque preQueue = new ConcurrentLinkedDeque<>(); @NonNull @@ -142,7 +142,7 @@ protected void onStart() { if (isStopRequested()) return; if (userSelection != null) { - // UserSelection will internally check opMode.isInInit() to see if it should terminate itself + // UserSelection will internally check opMode.isInInit() to see if it should terminate itself, // but we should wait here until it has actually terminated Threads.waitFor(userSelection, true); } @@ -217,7 +217,7 @@ public final void disableHardwareStopOnFinish() { * the automatic collection of {@link BunyipsSubsystem}s, and allows you to determine which subsystems will be managed for * this OpMode. *

- * For most cases, using this method is not required and all you need to do is construct your subsystems and they + * For most cases, using this method is not required and all you need to do is construct your subsystems, and they * will be managed automatically. This method is for advanced cases where you don't want this behaviour to happen. * * @param subsystems the restrictive list of subsystems to be managed and updated by ABOM @@ -368,7 +368,7 @@ public final T deferAtIndex(int index, @NonNull Supplier new } /** - * Insert an implicit RunTask at a specific index in the queue. + * Insert an implicit {@link Lambda} at a specific index in the queue. * * @param index the index to insert the task at, starting from 0 * @param runnable the code to add to the run queue to run once @@ -380,7 +380,7 @@ public final Lambda addAtIndex(int index, @NonNull Runnable runnable) { } /** - * Insert an implicit RunTask at a specific index in the queue. + * Insert an implicit {@link Lambda} at a specific index in the queue. * * @param index the index to insert the task at, starting from 0 * @param name the name of the task @@ -528,7 +528,7 @@ private String getApproximateTimeLeft() { // Attempt to get the time left for all tasks by summing their timeouts double timeLeft = tasks.stream().mapToDouble(task -> { // We cannot extract the duration of a task that is not a Task, we will return zero instead of the assumption - // as they are completely out of our control and we don't even know how they function + // as they are completely out of our control, and we don't even know how they function Measure

- * For most cases, using this method is not required and all you need to do is construct your subsystems and they + * For most cases, using this method is not required and all you need to do is construct your subsystems, and they * will be managed automatically. This method is for advanced cases where you don't want this behaviour to happen. * * @param subsystems the restrictive list of subsystems to be managed and updated by the scheduler diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Condition.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Condition.java index c1bd98e09..a92f02812 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Condition.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Condition.java @@ -143,7 +143,7 @@ public boolean getFallingEdge() { } /** - * Creates a new Condition that is the logical OR of this Condition and another @link BooleanSupplier}. + * Creates a new Condition that is the logical OR of this Condition and another {@link BooleanSupplier}. * * @param other The other {@link BooleanSupplier} to OR with. * @return A new Condition that is the logical OR of this Condition and the other {@link BooleanSupplier}. @@ -154,7 +154,7 @@ public Condition or(@NonNull BooleanSupplier other) { } /** - * Creates a new Condition that is the logical AND of this Condition and anot @link BooleanSupplier}. + * Creates a new Condition that is the logical AND of this Condition and another {@link BooleanSupplier}. * * @param other The other {@link BooleanSupplier} to AND with. * @return A new Condition that is the logical AND of this Condition and the other {@link BooleanSupplier}. @@ -165,7 +165,7 @@ public Condition and(@NonNull BooleanSupplier other) { } /** - * Creates a new Condition that is the logical XOR of this Condition and anot @link BooleanSupplier}. + * Creates a new Condition that is the logical XOR of this Condition and another {@link BooleanSupplier}. * * @param other The other {@link BooleanSupplier} to XOR with. * @return A new Condition that is the logical XOR of this Condition and the other {@link BooleanSupplier}. diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Dbg.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Dbg.kt index d93ed3405..780ffd2a1 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Dbg.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Dbg.kt @@ -50,7 +50,7 @@ object Dbg { * Log an error message. * Messages will be prepended with the ERROR_PREPEND string * Best used in a scenario where the program cannot continue normally or at required functionality - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -103,7 +103,7 @@ object Dbg { * Log a warning message. * Messages will be prepended with the WRN_PREPEND string * Best used in a scenario where the program can continue, but the user should be warned - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -143,7 +143,7 @@ object Dbg { /** * Log an internal debug message. * Best used from critical classes to log internal state - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -181,7 +181,7 @@ object Dbg { /** * Log a user message. * Best used to log a message or value to Logcat from user code - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -219,7 +219,7 @@ object Dbg { /** * Log a verbose message. * Used from always-messages that can be omitted, such as the firing notifications of methods - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -257,8 +257,8 @@ object Dbg { /** * Log a user message temporarily. * This method is marked as 'deprecated' to remind you to remove it before committing your code and for it - * to be picked up as part of static code analysis. It serves the same as a regular log() call. - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * to be picked up as part of static code analysis. It serves the same as a regular [log] call. + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -274,7 +274,7 @@ object Dbg { /** * Log a user message temporarily. * This method is marked as 'deprecated' to remind you to remove it before committing your code and for it - * to be picked up as part of static code analysis. It serves the same as a regular log() call. + * to be picked up as part of static code analysis. It serves the same as a regular [log] call. * @param obj Class where this log was called (name will be prepended to message) * @param format An object string to add to telemetry * @param args The objects to format into the object format string @@ -291,7 +291,7 @@ object Dbg { /** * Log a user message temporarily. * This method is marked as 'deprecated' to remind you to remove it before committing your code and for it - * to be picked up as part of static code analysis. It serves the same as a regular log() call. + * to be picked up as part of static code analysis. It serves the same as a regular [log] call. * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -306,7 +306,7 @@ object Dbg { /** * Log a timestamp from inside a BunyipsOpMode. - * This will call a log() with the current time since the last timer reset, prefixed with the last user-related + * This will call a [log] with the current time since the last timer reset, prefixed with the last user-related * function that was called. * If not called from a BunyipsOpMode, time information will be unknown. */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/DualTelemetry.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/DualTelemetry.kt index 0968bf47d..8d38e5891 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/DualTelemetry.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/DualTelemetry.kt @@ -136,11 +136,11 @@ class DualTelemetry @JvmOverloads constructor( /** * Add data to the telemetry object for the Driver Station and FtcDashboard, with integrated formatting. - * Note that using a separator element (defined by [dashboardCaptionValueAutoSeparator], default ": ") in your formatted string + * Note that using a separator element (defined by [dashboardCaptionValueAutoSeparator], default `: `) in your formatted string * will split this to an item for FtcDashboard automagically, replicating what [addDashboard] would do. * @param format An object string to add to telemetry * @param args The objects to format into the object format string via [Text.format] - * @return The telemetry item added to the Driver Station, null if the send failed from overflow + * @return The telemetry item added to the Driver Station, null if sending failed from overflow */ fun add(format: Any, vararg args: Any?): HtmlItem { flushTelemetryQueue() @@ -161,7 +161,7 @@ class DualTelemetry @JvmOverloads constructor( * @param caption Caption before appended separator ([dashboardCaptionValueAutoSeparator]) * @param format Format string to append after separator ([dashboardCaptionValueAutoSeparator]) * @param args Objects to format into the format string via [Text.format] - * @return The telemetry item added to the Driver Station, null if the send failed from overflow + * @return The telemetry item added to the Driver Station, null if sending failed from overflow */ override fun addData(caption: String, format: String, vararg args: Any?): Item { return add(caption + dashboardCaptionValueAutoSeparator + format, *args) @@ -173,7 +173,7 @@ class DualTelemetry @JvmOverloads constructor( * for FtcDashboard. * @param caption Caption before appended separator ([dashboardCaptionValueAutoSeparator]) * @param value Value to append after separator ([dashboardCaptionValueAutoSeparator]) - * @return The telemetry item added to the Driver Station, null if the send failed from overflow + * @return The telemetry item added to the Driver Station, null if sending failed from overflow */ override fun addData(caption: String, value: Any?): Item { return add(caption + dashboardCaptionValueAutoSeparator + value) @@ -300,7 +300,7 @@ class DualTelemetry @JvmOverloads constructor( /** * Log a message into the telemetry log - * @param stck StackTraceElement with information about where this log was called (see Text.getCallingUserCodeFunction()) + * @param stck StackTraceElement with information about where this log was called (see [Exceptions.getCallingUserCodeFunction]) * @param format An object string to add to telemetry * @param args The objects to format into the object format string */ @@ -402,7 +402,7 @@ class DualTelemetry @JvmOverloads constructor( ItemType.LOG -> { if (value == infoString) { - // BunyipsLib info, this is an always log and will always + // BunyipsLib info, this is an always-log and will always // be the first log in the list as it is added at the start // of the init cycle packet.put("INFO", value) @@ -565,7 +565,7 @@ class DualTelemetry @JvmOverloads constructor( /** * Set the current display format for the Driver Station. - * By default this is already set to HTML formatting, and it is recommended to leave this as-is. + * By default, this is already set to HTML formatting, and it is recommended to leave this as-is. */ override fun setDisplayFormat(displayFormat: DisplayFormat) { opMode.telemetry.setDisplayFormat(displayFormat) @@ -633,7 +633,7 @@ class DualTelemetry @JvmOverloads constructor( } /** - * Apply the HTML formatting to the string only if if this condition is true. + * Apply the HTML formatting to the string only if this condition is true. */ fun applyStylesIf(condition: BooleanSupplier): HtmlItem { applyOnlyIf = condition @@ -901,7 +901,7 @@ class DualTelemetry @JvmOverloads constructor( */ @Deprecated( "This method is not used with DualTelemetry. Split data into separate items or use a single item value with a newline.", - replaceWith = ReplaceWith("/* split data into seperate items or use a single item with newlines */"), + replaceWith = ReplaceWith("/* split data into separate items or use a single item with newlines */"), level = DeprecationLevel.ERROR ) override fun addData(caption: String, format: String, vararg args: Any): Item? { @@ -914,7 +914,7 @@ class DualTelemetry @JvmOverloads constructor( */ @Deprecated( "This method is not used with DualTelemetry. Split data into separate items or use a single item value with a newline.", - replaceWith = ReplaceWith("/* split data into seperate items or use a single item with newlines */"), + replaceWith = ReplaceWith("/* split data into separate items or use a single item with newlines */"), level = DeprecationLevel.ERROR ) override fun addData(caption: String, value: Any): Item? { @@ -927,7 +927,7 @@ class DualTelemetry @JvmOverloads constructor( */ @Deprecated( "This method is not used with DualTelemetry. Split data into separate items or use a single item value with a newline.", - replaceWith = ReplaceWith("/* split data into seperate items or use a single item with newlines */"), + replaceWith = ReplaceWith("/* split data into separate items or use a single item with newlines */"), level = DeprecationLevel.ERROR ) override fun addData(caption: String, valueProducer: Func): Item? { @@ -940,7 +940,7 @@ class DualTelemetry @JvmOverloads constructor( */ @Deprecated( "This method is not used with DualTelemetry. Split data into separate items or use a single item value with a newline.", - replaceWith = ReplaceWith("/* split data into seperate items or use a single item with newlines */"), + replaceWith = ReplaceWith("/* split data into separate items or use a single item with newlines */"), level = DeprecationLevel.ERROR ) override fun addData(caption: String, format: String, valueProducer: Func): Item? { diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/IndexedTable.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/IndexedTable.java index 7818573a3..7016f1f14 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/IndexedTable.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/IndexedTable.java @@ -3,7 +3,7 @@ import androidx.annotation.NonNull; /** - * Multi-purpose index-based table with increment and decrement functionality. + * Multipurpose index-based table with increment and decrement functionality. * Exposed as a runnable component for telemetry updates. * * @author Lucas Bubner, 2024 diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/MovingAverageTimer.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/MovingAverageTimer.java index f732ca796..93bd25b8e 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/MovingAverageTimer.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/MovingAverageTimer.java @@ -119,7 +119,7 @@ public void update() { } else { movingAverage = (double) movingTotal / ringBufferSize; - // Reset the min/max movingAverage values the each time the buffer is filled + // Reset the min/max movingAverage values each time the buffer is filled if (ringBufferIndex == 0) { minMovingAverage = movingAverage; maxMovingAverage = movingAverage; diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/RobotConfig.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/RobotConfig.kt index aea77ee1e..63b99f88e 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/RobotConfig.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/RobotConfig.kt @@ -150,7 +150,7 @@ abstract class RobotConfig { * lifetime of the OpMode. These errors will also be reported to telemetry. * * @param name name of device saved in the configuration file - * @param device the class of the item to configure, extending HardwareDevice (DcMotorEx.class, ServoImplEx.class, etc.) + * @param device the class of the item to configure, `Motor.class`, `ProfiledServo.class`, `RawEncoder.class`, etc. * @param onSuccess a Runnable to run if the device is successfully configured, useful for setting up motor configs * without having to check for null explicitly. */ @@ -173,7 +173,7 @@ abstract class RobotConfig { Storage.memory().hardwareErrors.add(name) e.localizedMessage?.let { Dbg.warn(it) } } - // Run the user callback if the device was successfully configured, outside of the hardware device + // Run the user callback if the device was successfully configured, outside the hardware device // catch block as exceptions raised in onSuccess will be mishandled. We also know that the device // is guaranteed to no longer be null. Errors raised in onSuccess() are caught by the init() handler in a BOM. if (ok) diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Scheduler.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Scheduler.kt index 951712ad4..3b17a7211 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Scheduler.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/Scheduler.kt @@ -46,10 +46,10 @@ class Scheduler : BunyipsComponent() { get() = subsystems.toTypedArray() /** - * Add subsystems to the scheduler. This will ensure the update() method of the subsystems is called, and that + * Add subsystems to the scheduler. This will ensure the `update()` method of the subsystems is called, and that * commands can be scheduled on these subsystems. * This is **REQUIRED** to be called if using a base implementation of Scheduler. If you are using a - * [CommandBasedBunyipsOpMode], see the `use()` method or rely on the automatic features during + * [CommandBasedBunyipsOpMode], see the [use] method or rely on the automatic features during * construction that will add subsystems at construction with no need to call this method. * * The base implementation of Scheduler does not access this implicit construction for finer-grain control for @@ -503,12 +503,12 @@ class Scheduler : BunyipsComponent() { } /** - * Implicitly make a new RunTask to run as the condition is met. + * Implicitly make a new [Lambda] to run as the condition is met. * This callback will requeue as many times as the trigger is met. * * This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. * If you do not mention timing control, this task will be run immediately when the condition is met, - * ending immediately as it is an RunTask. + * ending immediately as it is an [Lambda]. * * @param runnable The code to run * @return Current builder for additional task parameters @@ -518,12 +518,12 @@ class Scheduler : BunyipsComponent() { } /** - * Implicitly make a new RunTask to run as the condition is met. + * Implicitly make a new [Lambda] to run as the condition is met. * This callback will requeue as many times as the trigger is met. * * This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. * If you do not mention timing control, this task will be run immediately when the condition is met, - * ending immediately as it is an RunTask. + * ending immediately as it is an [Lambda]. * * @param name task name * @param runnable The code to run @@ -553,7 +553,7 @@ class Scheduler : BunyipsComponent() { } /** - * Implicitly make a new RunTask to run once the condition is met, debouncing the task from queueing more than once the condition is met. + * Implicitly make a new [Lambda] to run once the condition is met, debouncing the task from queueing more than once the condition is met. * * This code block will run, and a self-reset will not be propagated once the task is completed. Do note that this * effectively nullifies the entire trigger for the task, as it cannot auto-reset. For a Runnable that can reset itself, @@ -561,7 +561,7 @@ class Scheduler : BunyipsComponent() { * * This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. * If you do not mention timing control, this task will be run immediately when the condition is met, - * ending immediately as it is an RunTask. + * ending immediately as it is an [Lambda]. * * @param runnable The code to run * @return Current builder for additional task parameters @@ -571,7 +571,7 @@ class Scheduler : BunyipsComponent() { } /** - * Implicitly make a new RunTask to run once the condition is met, debouncing the task from queueing more than once the condition is met. + * Implicitly make a new [Lambda] to run once the condition is met, debouncing the task from queueing more than once the condition is met. * * This code block will run, and a self-reset will not be propagated once the task is completed. Do note that this * effectively nullifies the entire trigger for the task, as it cannot auto-reset. For a Runnable that can reset itself, @@ -579,7 +579,7 @@ class Scheduler : BunyipsComponent() { * * This method can only be called once per ScheduledTask, see a TaskGroup for multiple task execution. * If you do not mention timing control, this task will be run immediately when the condition is met, - * ending immediately as it is an RunTask. + * ending immediately as it is an [Lambda]. * * @param name task name * @param runnable The code to run @@ -600,8 +600,8 @@ class Scheduler : BunyipsComponent() { } /** - * Chain an AND condition to the current conditional task. - * Will be evaluated after the controller condition, and before the OR conditions. + * Chain an `AND` condition to the current conditional task. + * Will be evaluated after the controller condition, and before the `OR` conditions. * * @param condition The AND condition to chain. * @return Current builder for additional task parameters @@ -612,8 +612,8 @@ class Scheduler : BunyipsComponent() { } /** - * Chain an OR condition to the current conditional task. - * Will be evaluated after the controller and AND conditions. + * Chain an `OR` condition to the current conditional task. + * Will be evaluated after the controller and `AND` conditions. * * @param condition The OR condition to chain. * @return Current builder for additional task parameters @@ -624,7 +624,7 @@ class Scheduler : BunyipsComponent() { } /** - * Run a task assigned to in run() in a certain amount of time of the condition remaining true. + * Run a task assigned to in [run] in a certain amount of time of the condition remaining true. * This will delay the activation of the task by the specified amount of time of the condition remaining true. * If this method is called multiple times, the last time directive will be used. * @@ -642,7 +642,7 @@ class Scheduler : BunyipsComponent() { } /** - * Run a task assigned to in run() in a certain amount of time of the condition remaining true. + * Run a task assigned to in [run] in a certain amount of time of the condition remaining true. * This will delay the activation of the task by the specified amount of time of the condition remaining true. * If this method is called multiple times, the last time directive will be used. * @@ -654,7 +654,7 @@ class Scheduler : BunyipsComponent() { } /** - * Run the task assigned to in run() until this condition is met. Once this condition is met, the task will + * Run the task assigned to in [run] until this condition is met. Once this condition is met, the task will * be forcefully stopped and the scheduler will move on. This is useful for continuous tasks. * If this method is called multiple times, an OR condition will be composed with the last condition. * diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/UserSelection.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/UserSelection.kt index 9efa019c1..358231400 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/UserSelection.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/UserSelection.kt @@ -24,7 +24,7 @@ import java.util.function.Consumer * die or similar (e.g. `Task.task().isFinished(() -> !Threads.isRunning(...))`). * If you do not do this, the OpMode will assume it is ready to run regardless. * - * The result of this thread will be stored in the `result` property, which you can access yourself + * The result of this thread will be stored in the `result` property, which you can access yourself, * or you can attach a callback to the `callback` property to be run once the thread is complete. * This callback will still be run if the OpMode moves to a running state without a selection. In * the event a user does not make a selection, the callback result and `result` property will be @@ -58,7 +58,7 @@ import java.util.function.Consumer * Updated to use dynamic button mapping and generics 04/08/23. * Updated to be async and removed time restriction 07/09/23. * - * @param opModes Modes to map to buttons. Will be casted to strings for display and return back in type `T`. + * @param opModes Modes to map to buttons. Will be cast to strings for display and return back in type `T`. * @author Lucas Bubner, 2023 * @since 1.0.0-pre */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/InterpolatedLookupTable.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/InterpolatedLookupTable.java index 03fb745bb..c2fbfe7c1 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/InterpolatedLookupTable.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/InterpolatedLookupTable.java @@ -153,7 +153,7 @@ public double getMax() { * * @param input The X value. * @return The interpolated Y = f(X) value. - * @throws OutOfRangeException if the input is outside of the domain available by this lookup table + * @throws OutOfRangeException if the input is outside the domain available by this lookup table */ public double get(double input) throws OutOfRangeException { if (!built) diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/Mathf.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/Mathf.kt index c5466c581..d8e8030b4 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/Mathf.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/Mathf.kt @@ -889,7 +889,7 @@ object Mathf { * * @param expected The expected value * @param tolerance The allowed difference between the actual and the expected value - * @return Whether or not the actual value is within the allowed tolerance + * @return Whether the actual value is within the allowed tolerance */ @JvmStatic fun Number.isNear(expected: Number, tolerance: Number): Boolean { @@ -902,10 +902,9 @@ object Mathf { * Checks if the given value matches an expected value within a certain tolerance. Supports * continuous input for cases like absolute encoders. * - * * Continuous input means that the min and max value are considered to be the same point, and * tolerances can be checked across them. A common example would be for absolute encoders: calling - * isNear(2, 359, 5, 0, 360) returns true because 359 is 1 away from 360 (which is treated as the + * `isNear(2, 359, 5, 0, 360)` returns `true` because 359 is 1 away from 360 (which is treated as the * same as 0) and 2 is 2 away from 0, adding up to an error of 3 degrees, which is within the * given tolerance of 5. * @@ -913,7 +912,7 @@ object Mathf { * @param tolerance The allowed difference between the actual and the expected value * @param min Smallest value before wrapping around to the largest value * @param max Largest value before wrapping around to the smallest value - * @return Whether or not the actual value is within the allowed tolerance + * @return Whether the actual value is within the allowed tolerance */ @JvmStatic fun Number.isNear(expected: Number, tolerance: Number, min: Number, max: Number): Boolean { diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/TelemetryMenu.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/TelemetryMenu.java index 638ab61c1..a5b780958 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/TelemetryMenu.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/TelemetryMenu.java @@ -79,7 +79,7 @@ public TelemetryMenu(@NonNull Telemetry telemetry, @NonNull MenuElement root) { */ public void loop(@NonNull Gamepad gamepad) { // Capture current state of the gamepad buttons we care about; - // We can only look once or we risk a race condition + // We can only look once, or we risk a race condition boolean dpadUp = gamepad.dpad_up; boolean dpadDn = gamepad.dpad_down; boolean dpadRight = gamepad.dpad_right; diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/SystemController.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/SystemController.java index 1964b5070..6a54de559 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/SystemController.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/SystemController.java @@ -70,7 +70,7 @@ default void setCoefficients(@NonNull Double... coeffs) { * Composes this controller with another controller, returning a new controller that is the composition of the two. *

* The specified BiConsumer that returns a Double is expected to be a function that indicates how the two controllers - * should be combined. (e.g. addition, multiplication, etc). + * should be combined. (e.g. addition, multiplication, etc.). * * @param other the other controller to compose with * @param combiner the function that combines the two controllers diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/PIDFController.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/PIDFController.java index 03edfc671..2d4e4b173 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/PIDFController.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/PIDFController.java @@ -10,16 +10,15 @@ import au.edu.sa.mbhs.studentrobotics.bunyipslib.external.control.SystemController; /** - * This is a PID controller (https://en.wikipedia.org/wiki/PID_controller) - * for your robot. Internally, it performs all the calculations for you. - * You need to tune your values to the appropriate amounts in order - * to properly utilize these calculations. + * This is a PID controller for your robot. + * Internally, it performs all the calculations for you. + * You need to tune your values to the appropriate amounts in order to properly utilise these calculations. *

* The equation we will use is: - * u(t) = kP * e(t) + kI * int(0,t)[e(t')dt'] + kD * e'(t) + kF - * where e(t) = r(t) - y(t) and r(t) is the setpoint and y(t) is the - * measured value. If we consider e(t) the positional error, then - * int(0,t)[e(t')dt'] is the total error and e'(t) is the velocity error. + * {@code u(t) = kP * e(t) + kI * int(0,t)[e(t')dt'] + kD * e'(t) + kF} + * where {@code e(t) = r(t) - y(t)} and {@code r(t)} is the setpoint and {@code y(t)} is the + * measured value. If we consider {@code e(t)} the positional error, then + * {@code int(0,t)[e(t')dt']} is the total error and {@code e'(t)} is the velocity error. * Source * * @since 1.0.0-pre @@ -244,7 +243,7 @@ public PIDFController setTolerance(double positionTolerance) { } /** - * @return the velocity error e'(t) + * @return the velocity error {@code e'(t)} */ public double getVelocityError() { return errorVal_v; @@ -392,7 +391,7 @@ public double getP() { } /** - * Set the P coefficient on this controller + * Set the Proportional coefficient on this controller * * @param kp proportional * @return this @@ -408,7 +407,7 @@ public double getI() { } /** - * Set the I coefficient on this controller + * Set the Integral coefficient on this controller * * @param ki integral * @return this @@ -424,7 +423,7 @@ public double getD() { } /** - * Set the D coefficient on this controller + * Set the Derivative coefficient on this controller * * @param kd derivative * @return this @@ -440,7 +439,7 @@ public double getF() { } /** - * Set the F coefficient on this controller + * Set the Feedforward coefficient on this controller * * @param kf feedforward * @return this diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/ProfiledPIDController.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/ProfiledPIDController.java index 2550a6ba1..269d337e9 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/ProfiledPIDController.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/control/pid/ProfiledPIDController.java @@ -209,7 +209,7 @@ public boolean atSetpoint() { } /** - * Sets the error which is considered tolerable for use with atSetpoint(). + * Sets the error which is considered tolerable for use with {@link #atSetpoint()}. * * @param positionTolerance Position error which is tolerable. * @return this @@ -221,7 +221,7 @@ public ProfiledPIDController setTolerance(double positionTolerance) { } /** - * Sets the error which is considered tolerable for use with atSetpoint(). + * Sets the error which is considered tolerable for use with {@link #atSetpoint()}. * * @param positionTolerance Position error which is tolerable. * @param velocityTolerance Velocity error which is tolerable. diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Angle.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Angle.java index 0b5bdafe0..3fd5e45df 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Angle.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Angle.java @@ -16,7 +16,7 @@ * @since 1.0.0-pre */ // Technically, angles are unitless dimensions -// eg Mass * Distance * Velocity is equivalent to (Mass * Distance) / Time - otherwise known +// e.g. Mass * Distance * Velocity is equivalent to (Mass * Distance) / Time - otherwise known // as Power - in other words, Velocity is /actually/ Frequency public class Angle extends Unit { /** diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Measure.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Measure.kt index ae2f43e8f..5775e982d 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Measure.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Measure.kt @@ -37,7 +37,7 @@ interface Measure> : Comparable> { fun unit(): U /** - * Converts this measure to a measure with a different unit of the same type, eg minutes to + * Converts this measure to a measure with a different unit of the same type, e.g. minutes to * seconds. Converting to the same unit is equivalent to calling [magnitude]. * * For Kotlin users, calling this method can be done with the notation \`in\` @@ -61,7 +61,7 @@ interface Measure> : Comparable> { } /** - * Converts this measure to a measure with a different unit of the same type, eg minutes to + * Converts this measure to a measure with a different unit of the same type, e.g. minutes to * seconds. Converting to the same unit is equivalent to calling [magnitude]. * * ``` @@ -111,7 +111,7 @@ interface Measure> : Comparable> { val numerator = (unit() as Per<*, *>).numerator() return numerator.ofBaseUnits(baseUnitMagnitude() * other.baseUnitMagnitude()) } else if (unit() is Velocity<*> && other.unit().baseUnit == Units.Seconds) { - // Multiplying a velocity by a time, return the scalar unit (eg Distance) + // Multiplying a velocity by a time, return the scalar unit (e.g. Distance) val numerator = (unit() as Velocity<*>).unit return numerator.ofBaseUnits(baseUnitMagnitude() * other.baseUnitMagnitude()) } else if (other.unit() is Per<*, *> @@ -129,7 +129,7 @@ interface Measure> : Comparable> { .baseUnit == (other.unit() as Per<*, *>).denominator().baseUnit) ) { - // multiplying eg meters per second * milliseconds per foot + // multiplying e.g. meters per second * milliseconds per foot // return a scalar return Units.Value.of(baseUnitMagnitude() * other.baseUnitMagnitude()) } diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/MutableMeasure.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/MutableMeasure.kt index 5e264cee7..9e06daee4 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/MutableMeasure.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/MutableMeasure.kt @@ -7,16 +7,13 @@ import java.util.Objects /** * A specialization of [Measure] that allows for mutability. This is intended to be used for - * memory use reasons (such as on the memory-restricted roboRIO 1 or 2 or SBC coprocessors) and - * should NOT be exposed in the public API for a class that uses it. - * + * memory use reasons and should NOT be exposed in the public API for a class that uses it. * * The advantage of using this class is to reuse one instance of a measurement object, as opposed * to instantiating a new immutable instance every time an operation is performed. This will reduce * memory pressure, but comes at the cost of increased code complexity and sensitivity to race * conditions if misused. * - * * Any unsafe methods are prefixed with `mut_*`, such as [mut_plus] or * [mut_replace]. These methods will change the internal state of the measurement * object, and as such can be dangerous to use. They are primarily intended for use to track @@ -115,7 +112,7 @@ class MutableMeasure> private constructor( baseUnitMagnitudeVal += other.baseUnitMagnitude() // can't naively use magnitude += other.in(unit) because the units may not - // be scalar multiples (eg adding 0C to 100K should result in 373.15K, not 100K) + // be scalar multiples (e.g. adding 0C to 100K should result in 373.15K, not 100K) magnitudeVal = unitVal.fromBaseUnits(baseUnitMagnitudeVal) return this } diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Units.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Units.java index 38f0051d4..59eccb057 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Units.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Units.java @@ -282,7 +282,7 @@ private Units() { public static final Dimensionless Value = BaseUnits.Value; /** - * A dimensionless unit equal to to 1/100th of a {@link #Value}. A measurement of {@code + * A dimensionless unit equal to 1/100th of a {@link #Value}. A measurement of {@code * Percent.of(42)} would be equivalent to {@code Value.of(0.42)}. */ public static final Dimensionless Percent = derive(Value).splitInto(100).named("Percent").symbol("%").make(); @@ -430,7 +430,7 @@ private Units() { public static final Per>> VoltsPerRadianPerSecondSquared = Volts.per(RadiansPerSecond.per(Second)); /** - * Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). + * Creates a unit equal to a thousandth of the base unit, e.g. Milliseconds = Milli(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -443,7 +443,7 @@ public static > U Milli(@NonNull Unit baseUnit, @NonNull St } /** - * Creates a unit equal to a thousandth of the base unit, eg Milliseconds = Milli(Units.Seconds). + * Creates a unit equal to a thousandth of the base unit, e.g. Milliseconds = Milli(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -468,7 +468,7 @@ public static > U Micro(@NonNull Unit baseUnit, @NonNull St } /** - * Creates a unit equal to a millionth of the base unit, eg Microseconds = Micro(Units.Seconds). + * Creates a unit equal to a millionth of the base unit, e.g. Microseconds = Micro(Units.Seconds). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -479,7 +479,7 @@ public static > U Micro(@NonNull Unit baseUnit) { } /** - * Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). + * Creates a unit equal to a thousand of the base unit, e.g. Kilograms = Kilo(Units.Grams). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure @@ -492,7 +492,7 @@ public static > U Kilo(@NonNull Unit baseUnit, @NonNull Str } /** - * Creates a unit equal to a thousand of the base unit, eg Kilograms = Kilo(Units.Grams). + * Creates a unit equal to a thousand of the base unit, e.g. Kilograms = Kilo(Units.Grams). * * @param the type of the unit * @param baseUnit the unit being derived from. This does not have to be the base unit of measure diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Velocity.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Velocity.java index c1145456b..3a0ca396b 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Velocity.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/Velocity.java @@ -145,7 +145,7 @@ public static > Velocity combine(@NonNull Unit numerator } /** - * Gets the major unit being measured (eg Meters for Meters per Second). + * Gets the major unit being measured (e.g. Meters for Meters per Second). * * @return the major unit */ @@ -154,7 +154,7 @@ public D getUnit() { } /** - * Gets the period unit of the velocity, eg Seconds or Milliseconds. + * Gets the period unit of the velocity, e.g. Seconds or Milliseconds. * * @return the period unit */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/collections/ReadOnlyPrimitiveLongSet.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/collections/ReadOnlyPrimitiveLongSet.java index 731f6d9e3..6383c0314 100755 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/collections/ReadOnlyPrimitiveLongSet.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/external/units/collections/ReadOnlyPrimitiveLongSet.java @@ -105,7 +105,7 @@ public LongStream stream() { } /** - * Creates a new array that contains all of the values in the set. + * Creates a new array that contains all the values in the set. * * @return an array containing all the values in the set */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/IMUEx.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/IMUEx.java index 0189f211e..e8d9ced9c 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/IMUEx.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/IMUEx.java @@ -201,7 +201,7 @@ public YawDomain getYawDomain() { /** * Sets the domain range of what the {@link #yaw} field will return. By default, this is set to the expected - * behaviour of [-180, 180) degrees, but can be adjusted here to one of the {@link YawDomain} options. + * behaviour of {@code [-180, 180)} degrees, but can be adjusted here to one of the {@link YawDomain} options. * Note that this yaw domain will only apply to the {@link #yaw} field, not in the IMU interface overrides. * * @param newDomain the new domain of the {@link #yaw} property @@ -238,7 +238,7 @@ public void setYawMultiplier(double mul) { } /** - * Update the class fields and method return values with newest information from the IMU. + * Update the class fields and method return values with the newest information from the IMU. * This method will no-op if updates have been delegated via {@link #startThread()}. */ @Override @@ -329,7 +329,7 @@ private void internalUpdate() { quaternion = Quaternion.fromMatrix(rawOrientation.getRotationMatrix(), rawOrientation.acquisitionTime); // These fields are also bound by the [-180, 180) degree domain but can be converted with Mathf utilities. - // IMUEx provides a built in utility for the yaw, as it is a common use case and usually you wouldn't need + // IMUEx provides a built-in utility for the yaw, as it is a common use case, and usually you wouldn't need // to use these fields in a different domain. Note that the yaw field is the only element affected // by the yaw domain restriction. pitch = Degrees.of(rawOrientation.firstAngle); diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/Motor.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/Motor.java index ef75eeeda..1a4145740 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/Motor.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/Motor.java @@ -50,9 +50,9 @@ * Drop-in replacement for a {@link DcMotor} that uses custom control algorithms to operate {@link DcMotor.RunMode#RUN_USING_ENCODER} * and {@link DcMotor.RunMode#RUN_TO_POSITION} modes. Internally integrates a gain scheduler to allow for more precise * system coefficients against gravity and other external forces. This class effectively wraps an entire DcMotor and - * regulates all of the operations. + * regulates all the operations. *

- * This class is designed to be down casted to a DcMotor where used, integrating with the current motor modes while + * This class is designed to be downcasted to a DcMotor where used, integrating with the current motor modes while * providing faster, predictable control systems. * * @author Lucas Bubner, 2024 @@ -164,7 +164,7 @@ public SystemController getRunToPositionController() { * Set a system controller to use for {@link DcMotor.RunMode#RUN_TO_POSITION}. *

* The coefficients of this controller can be gain scheduled through {@link #scheduleRunToPositionGains()}. - * Otherwise, you can adjust the coefficients directly on the controller instance and they will be respected, unless + * Otherwise, you can adjust the coefficients directly on the controller instance, and they will be respected, unless * a gain scheduler is set for this controller. *

* Note that when using a motor with this class, the PIDF coefficients attached to the motor itself will be used only @@ -196,7 +196,7 @@ public SystemController getRunUsingEncoderController() { * Set a system controller to use for {@link DcMotor.RunMode#RUN_USING_ENCODER}. *

* The coefficients of this controller can be gain scheduled through {@link #scheduleRunUsingEncoderGains()}. - * Otherwise, you can adjust the coefficients directly on the controller instance and they will be respected, unless + * Otherwise, you can adjust the coefficients directly on the controller instance, and they will be respected, unless * a gain scheduler is set for this controller. *

* Note that when using a motor with this class, the PIDF coefficients attached to the motor itself will be used only @@ -215,7 +215,7 @@ public void setRunUsingEncoderController(@Nullable SystemController controller) * Set a system controller to use for {@link DcMotor.RunMode#RUN_USING_ENCODER}. *

* The coefficients of this controller can be gain scheduled through {@link #scheduleRunUsingEncoderGains()}. - * Otherwise, you can adjust the coefficients directly on the controller instance and they will be respected, unless + * Otherwise, you can adjust the coefficients directly on the controller instance, and they will be respected, unless * a gain scheduler is set for this controller. *

* Note that when using a motor with this class, the PIDF coefficients attached to the motor itself will be used only @@ -242,7 +242,7 @@ public void setRunUsingEncoderController(double bufferFraction, double maxAchiev * Set a system controller to use for {@link DcMotor.RunMode#RUN_USING_ENCODER}. *

* The coefficients of this controller can be gain scheduled through {@link #scheduleRunUsingEncoderGains()}. - * Otherwise, you can adjust the coefficients directly on the controller instance and they will be respected, unless + * Otherwise, you can adjust the coefficients directly on the controller instance, and they will be respected, unless * a gain scheduler is set for this controller. *

* Note that when using a motor with this class, the PIDF coefficients attached to the motor itself will be used only @@ -552,7 +552,7 @@ public synchronized void setMode(@NonNull DcMotor.RunMode mode) { /** * Note that this method will try to access the {@link DcMotor.RunMode#RUN_TO_POSITION} controller to access information there. This - * is otherwise unsupported and you should try to access the actual controller to see this information, unless + * is otherwise unsupported, and you should try to access the actual controller to see this information, unless * you are downcasting in which this will assume you are using a PIDF controller. * * @inheritDoc @@ -572,7 +572,7 @@ public int getTargetPositionTolerance() { /** * Note that this method will try to access the {@link DcMotor.RunMode#RUN_TO_POSITION} controller to access information there. This - * is otherwise unsupported and you should try to access the actual controller to see this information, unless + * is otherwise unsupported, and you should try to access the actual controller to see this information, unless * you are downcasting in which this will assume you are using a PIDF controller. * * @inheritDoc @@ -770,7 +770,7 @@ public synchronized int getTargetPosition() { * RunMode. Note further that, clearly, the motor must be equipped with an encoder in order * for this mode to function properly.

*

- * Additionally note that the target positioning functionality of the Motor class handles + * Additionally, note that the target positioning functionality of the Motor class handles * the propagation of target position following internally. * * @param position the desired encoder target position @@ -787,7 +787,7 @@ public synchronized void setTargetPosition(int position) { /** * Note that this method will try to access the {@link DcMotor.RunMode#RUN_TO_POSITION} controller to access information there. This - * is otherwise unsupported and you should try to access the actual controller to see this information, unless + * is otherwise unsupported, and you should try to access the actual controller to see this information, unless * you are downcasting in which this will assume you are using a PID controller. * * @inheritDoc diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/ProfiledServo.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/ProfiledServo.java index f7df70ec5..7a0890857 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/ProfiledServo.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/hardware/ProfiledServo.java @@ -23,7 +23,7 @@ * optimisation similar to an {@link SimpleRotator}. *

* This class serves as a drop-in replacement for the {@link Servo}, similar to {@link Motor} with the {@link DcMotor}. - * Do note that this class cannot be casted to a {@link ServoImplEx} instance, but it does implement the extended + * Do note that this class cannot be cast to a {@link ServoImplEx} instance, but it does implement the extended * {@link PwmControl} interface for extended operations. * * @author Lucas Bubner, 2024 @@ -168,7 +168,7 @@ public void setPwmEnable() { } /** - * Individually denergizes the PWM for this particular servo + * Individually de-energizes the PWM for this particular servo * * @see #setPwmEnable() */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/integrated/HardwareTester.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/integrated/HardwareTester.java index 84380c29f..f4a211619 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/integrated/HardwareTester.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/integrated/HardwareTester.java @@ -340,7 +340,7 @@ protected void onClick() { } if (device instanceof AccelerationSensor accel) { - // Other sensors we just add their data anyways since they may be useful... + // Other sensors we just add their data anyway since they may be useful... TelemetryMenu.DynamicItem status = new TelemetryMenu.DynamicItem("Status", accel::status); TelemetryMenu.DynamicItem acceleration = new TelemetryMenu.DynamicItem("Acceleration (g)", accel::getAcceleration); dev.addChildren(acceleration); diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/localization/accumulators/BoundedAccumulator.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/localization/accumulators/BoundedAccumulator.java index 4dc34af7a..cf787b156 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/localization/accumulators/BoundedAccumulator.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/localization/accumulators/BoundedAccumulator.java @@ -38,7 +38,7 @@ public class BoundedAccumulator extends Accumulator { */ public static double MANUAL_VELOCITY_INHIBITION_TIME = 0.5; /** - * Time in seconds to use for the delta step in deriving velocity (s'(t) = (s(t) - s(t + dt)) / dt). + * Time in seconds to use for the delta step in deriving velocity ({@code s'(t) = (s(t) - s(t + dt)) / dt}). * Too low of a resolution will cause floating point errors, while too high will cause the velocity to be inaccurate */ public static double MANUAL_VELOCITY_DT_RESOLUTION = 0.1; @@ -142,7 +142,7 @@ public void accumulate(@NonNull Twist2dDual

- * This mode is useful to call on high-frequency system controllers (like those accomplished via {@link Motor}, + * This mode is useful to call on high-frequency system controllers, like those accomplished via {@link Motor}, * and switches over the manual control from raw input to system controls. * * @param setpointDeltaMul the multiplicative scale to translate power into target position delta, which returns @@ -449,7 +449,7 @@ protected void periodic() { motor.setMode(DcMotor.RunMode.RUN_TO_POSITION); } catch (Exception e) { // Cannot catch ActionNotSupportedException due to package protections, so we will handle a generic exception - // In the event this does fail, we will fallback to the default mode. + // In the event this does fail, we will fall back to the default mode. setInputModeToUser(); break; } diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/HolonomicVectorDriveTask.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/HolonomicVectorDriveTask.java index c61962bfa..f51b6c958 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/HolonomicVectorDriveTask.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/HolonomicVectorDriveTask.java @@ -187,7 +187,7 @@ public HolonomicVectorDriveTask withRController(@NonNull SystemController r) { /** * Set the minimum pose error when in self-holding mode to activate correction for. * - * @param inchRad a pose in inches and radians that represents the admissible error for robot auto-correction + * @param inchRad a pose in inches and radians that represents the admissible error for robot autocorrection * @return this */ @NonNull diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/MoveToContourTask.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/MoveToContourTask.java index 8e2ded858..ed552bdad 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/MoveToContourTask.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/MoveToContourTask.java @@ -124,7 +124,7 @@ public MoveToContourTask withRController(@NonNull SystemController r) { /** * Sets a custom error supplier for the forward movement of the robot. * - * @param forwardErrorSupplier the error that dictates the forward movement of the robot (whether by pitch or area, etc), + * @param forwardErrorSupplier the error that dictates the forward movement of the robot (whether by pitch or area, etc.), * by default this is a pitch target of 0.0 (middle of frame) * @return the task */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/ActionTask.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/ActionTask.java index a56f580ca..073f447a0 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/ActionTask.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/ActionTask.java @@ -17,7 +17,7 @@ * of a {@link DualTelemetry} packet if running in a {@link BunyipsOpMode}, for seamless integration. *

* Do note that the {@link Task} implements {@link Action}, so if it is possible, directly converting the action - * into a task at it's definition is more efficient. + * into a task at its definition is more efficient. *

* Tasks built with RoadRunner drives, despite being represented with Actions are internally composed of {@link Task} instances, * so {@link SequentialAction} and {@link ParallelAction} actions will also try to be unwrapped, with their full name available at init. diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Lambda.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Lambda.java index e4c92e034..0bef0bc11 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Lambda.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Lambda.java @@ -28,7 +28,7 @@ public class Lambda extends Task { * @param callback The callback to run */ public Lambda(@NonNull Runnable callback) { - // For Lambdas, we can't have an infinite timeout but we can use a very very short one instead + // For Lambdas, we can't have an infinite timeout, but we can use a very short one instead. // This is so the schedulers do not mistake this task as for one that will end up running forever, // as all Lambdas will run only once. This also helps telemetry decide how long a task will execute for. timeout = Milliseconds.of(EPSILON_MS); diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/SelectTask.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/SelectTask.java index ad6150740..3ffaa804b 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/SelectTask.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/SelectTask.java @@ -21,7 +21,7 @@ public class SelectTask extends Task { /** * Create a new select task with the given state supplier. * - * @param stateSupplier the supplier of states to check in the when() method + * @param stateSupplier the supplier of states to check in the {@link #when} method */ public SelectTask(@NonNull Supplier stateSupplier) { this.stateSupplier = stateSupplier; diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Task.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Task.kt index 3b1ea977c..6b3a71695 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Task.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/tasks/bases/Task.kt @@ -77,7 +77,7 @@ abstract class Task : BunyipsComponent(), Runnable, Action { get() = Optional.ofNullable(_dependency) /** - * Whether the task is currently running (i.e. has been started (`init()` called) and not finished). + * Whether the task is currently running (i.e. has been started ([init] called) and not finished). */ val isRunning: Boolean get() = startTime != 0L && !isFinished @@ -102,7 +102,7 @@ abstract class Task : BunyipsComponent(), Runnable, Action { // RoadRunner Actions compatibility, exposes the same field names as they are presented in the Action interface /** * Convenience field to get a reference to FtcDashboard's field overlay for drawing on the field. - * Available as soon as init() has been called for this task. + * Available as soon as [init] has been called for this task. * * This field is used for porting between [Action] and [Task] implementations. */ @@ -110,7 +110,7 @@ abstract class Task : BunyipsComponent(), Runnable, Action { /** * Convenience field to get a reference to a [TelemetryPacket] for sending telemetry to the dashboard. - * Available as soon as init() has been called for this task. + * Available as soon as [init] has been called for this task. * * This field is used for porting between [Action] and [Task] implementations. */ diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Controls.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Controls.kt index 60cd32f96..a69560e7a 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Controls.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Controls.kt @@ -15,7 +15,7 @@ import com.qualcomm.robotcore.hardware.Gamepad */ @Suppress("KDocMissingDocumentation") enum class Controls { - // Guide button not included due to volatility as it may be caught by the app + // The guide button not included due to volatility as it may be caught by the app A, B, X, Y, START, BACK, DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT, LEFT_BUMPER, RIGHT_BUMPER, LEFT_STICK_BUTTON, RIGHT_STICK_BUTTON, NONE; /** diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Direction.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Direction.kt index de25bc380..b4446c4f9 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Direction.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/Direction.kt @@ -48,7 +48,7 @@ enum class Direction( companion object { /** - * Convert a Pose2d robot vector to a relative vector. + * Convert a [Pose2d] robot vector to a relative vector. */ @JvmStatic fun convert(pose: Pose2d): Any { @@ -63,7 +63,7 @@ enum class Direction( } /** - * Convert a Vector2d robot vector into a relative vector. + * Convert a [Vector2d] robot vector into a relative vector. */ @JvmStatic fun convert(vector: Vector2d): Direction { diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingConfiguration.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingConfiguration.kt index 425dfd92c..6507c296c 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingConfiguration.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingConfiguration.kt @@ -133,7 +133,7 @@ object StartingConfiguration { } /** - * Returns a HTML string to represent this starting configuration. + * Returns an HTML string to represent this starting configuration. */ override fun toString(): String { val lowCaseAlliance = Text.lower(alliance.name) @@ -292,7 +292,7 @@ object StartingConfiguration { private val flags = mutableSetOf() /** - * Translate backward from the center of the field tile to your robot center as defined by your translate step. + * Translate backward from the center of the field tile to your robot center as defined by your translation step. * This is to align your robot to touching the field wall. */ fun backward(translationBack: Measure): PrebuiltPosition { diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingPositions.kt b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingPositions.kt index 96d19994a..5b4e751e7 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingPositions.kt +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/transforms/StartingPositions.kt @@ -6,7 +6,7 @@ import com.acmerobotics.roadrunner.Pose2d * Legacy enum for determining where the robot is starting on the field. This can be used to determine * which autonomous path to take. * - * **Note**: This enum was designed around the 4 *required* starting positions as required by a Autonomous Randomisation + * **Note**: This enum was designed around the 4 *required* starting positions as required by an Autonomous Randomisation * task. In a season such as 2024-2025 INTO THE DEEP where these required positions are no longer required, the pose * information as granted by these enum values may be inaccurate (as they are derived from CENTERSTAGE). * However, this enum may still be used for differentiating between the relative position of robots in their alliance, but comes diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/util/Text.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/util/Text.java index 65dba487c..8113ea60a 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/util/Text.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/util/Text.java @@ -23,7 +23,7 @@ private Text() { /** * Format a string using only '%' placeholders. - * Differs from String.format() as type can be omitted. + * Differs from {@link String#format} as type can be omitted. *

* {@code format("Hello %!", "world")} -> {@code "Hello world!"} * diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Processor.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Processor.java index 9a9767a84..43bebe941 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Processor.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Processor.java @@ -29,7 +29,7 @@ * Base class for all vision processors using the Vision system. *

* A processor will be attached to a Vision instance and will be called to process frames, - * allowing you to access your data here using the .getData() method. This makes it useful + * allowing you to access your data here using the {@link #getData()} method. This makes it useful * for tasks to access the latest data from the vision system, without needing to directly * interface with the Vision instance. * @@ -183,7 +183,7 @@ public void clearData() { /** * Override this method to run any additional code that will be executed when - * this processor is attached (via init()) by a Vision instance. + * this processor is attached (via {@link Vision#init}) by a Vision instance. *

* This method is also called on standard initialisation of the processor if it has not been already done via Vision. */ @@ -193,7 +193,7 @@ protected void onAttach() { /** * Override this method to run any additional code that will be executed when - * this processor starts streaming (via start()) on a Vision instance. + * this processor starts streaming (via {@link Vision#start}) on a Vision instance. */ protected void onRunning() { // no-op @@ -203,9 +203,9 @@ protected void onRunning() { * Called to update new data from the vision system, which involves interpreting, * collecting, or otherwise processing new vision data per frame. *

- * This method should refresh `this.data` with the latest information from the vision system to - * be accessed with your methods on .getData().T (your VisionData class). `this.data` is - * automatically cleared upon each iteration, so opt to using realtime data in this method. + * This method should refresh {@link #data} with the latest information from the vision system to + * be accessed later via {@link #getData()} (returning your derived {@link VisionData} class). + * {@link #data} is automatically cleared upon each iteration, so opt to using realtime data in this method. * This method will be called automatically once attached to a Vision instance. */ protected abstract void update(); diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Vision.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Vision.java index 0d9571539..432161eb4 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Vision.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/Vision.java @@ -36,7 +36,7 @@ * as processing is on another thread and updates are managed at the discretion of the VisionPortal. * Once set up, Vision will automatically manage the camera stream and defined processor updates. * All you will need to do is collect the data from the processors and use it in your OpMode. The - * {@code update()} method in this subsystem will simply add telemetry of the VisionPortal's status. + * {@link #update} method in this subsystem will simply add telemetry of the VisionPortal's status. * * @author Lucas Bubner, 2023 * @since 1.0.0-pre @@ -58,7 +58,7 @@ public class Vision extends BunyipsSubsystem { private final CameraName camera; /** * A built-in raw feed Processor that will do nothing but provide the raw camera feed. - * Useful for debugging and testing, pass this raw field (vision.raw) to init() and start() to use it. + * Useful for debugging and testing, pass this raw field ({@code vision.raw}) to {@link #init} and {@link #start} to use it. * * @noinspection ClassEscapesDefinedScope (should never be used outside of this class, and checks exist for usage in other classes) */ @@ -122,7 +122,7 @@ public List getAttachedProcessors() { * Initialises the Vision class with the specified processors. * This method should only be called once per OpMode. Additional calls will internally * terminate the VisionPortal and reinitialise it with the new processors (this is a highly expensive operation). - * Processors will be STOPPED by default, you must call {@code start()} after initialising. + * Processors will be STOPPED by default, you must call {@link #start} after initialising. * * @param newProcessors Processor instances * @return the vision instance @@ -199,7 +199,7 @@ public Vision init(@NonNull Processor... newProcessors) { /** * Start desired processors. This method must be called before trying to extract data from - * the cameras, and must be already initialised with the init() method. + * the cameras, and must be already initialised with the {@link #init} method. * * @param attachedProcessors Processor instances * @return the vision instance @@ -239,15 +239,15 @@ public Vision start(@NonNull Processor... attachedProcessors) { *

* This method should be called when hardware resources no longer * need to be allocated to operating the cameras, and should have the option to be re-enabled - * with start(). + * with {@link #start}. *

* Note: The VisionPortal is automatically closed at the end of the OpMode's run time, calling - * stop() or terminate() is not required at the end of an OpMode. + * {@link #stop} or {@link #terminate} is not required at the end of an OpMode. *

* Passing no arguments will pause the Camera Stream (Level 3). Pausing * the camera stream will automatically disable any running processors. Note this may - * take some very small time to resume the stream if start() is called again. If you don't plan - * on using the camera stream again, it is recommended to call terminate() instead. + * take some small amount of time to resume the stream if {@link #start} is called again. If you don't plan + * on using the camera stream again, it is recommended to call {@link #terminate} instead. * * @param attachedProcessors Processor instances * @return the vision instance @@ -292,7 +292,7 @@ public Vision stop() { /** * Get the culmination of data from all attached processors. - * It is recommended to instead call getData() on individual processors to get their data, + * It is recommended to instead call {@link Processor#getData()} on individual processors to get their data, * however, this method exists to provide a quick way to get all data at once. * * @return HashMap of all processor data from every attached processor @@ -313,12 +313,12 @@ public HashMap> getAllData() { *

* Use this method when you are completely done with the VisionPortal and want to free up * all available resources. This method will automatically disable all processors and close - * the VisionPortal, and cannot be undone without calling init() again. + * the VisionPortal, and cannot be undone without calling {@link #init} again. *

* It is strongly discouraged to reinitialise the VisionPortal in the same OpMode, as this * takes significant time and may cause the OpMode to hang or become unresponsive. Instead, - * use the {@code start()} and {@code stop()} methods to enable/disable the VisionPortal. - * Repeated calls to {@code init()} will also cause a termination of the VisionPortal. + * use the {@link #start} and {@link #stop} methods to enable/disable the VisionPortal. + * Repeated calls to {@link #init} will also cause a termination of the VisionPortal. * * @return the vision instance */ @@ -406,7 +406,7 @@ public double getFps() { /** * Returns the state of VisionPortal. Specifically if it is null or not. * - * @return whether the VisionPortal has been initialised with init() or not + * @return whether the VisionPortal has been initialised with {@link #init} or not */ public boolean isInitialised() { return visionPortal != null; @@ -433,7 +433,7 @@ public VisionPortal getVisionPortal() { * Without the preview active, the DS will display a raw unprocessed feed to save resources in * Camera Stream, and FtcDashboard will be disabled. This is the default state of Vision. * Activating this sender will set both FtcDashboard and the DS streams to be of a processor - * of your choosing, by changing a processor's name with setPreview() or via FtcDashboard. + * of your choosing, by changing a processor's name with {@link #setPreview} or via FtcDashboard. * * @see SwitchableVisionSender */ @@ -448,7 +448,7 @@ public void startPreview() { } /** - * Set the processor to display on FtcDashboard/DS from startPreview(). + * Set the processor to display on FtcDashboard/DS from {@link #startPreview()}. * This will automatically switch the instance index, allowing an instant stream of this camera and processor combo. * Will no-op if this processor name is invalid. * @@ -463,7 +463,7 @@ public void setPreview(@NonNull String processorName) { } /** - * Set the processor to display on FtcDashboard/DS from startPreview(). + * Set the processor to display on FtcDashboard/DS from {@link #startPreview()}. * This will automatically switch the instance index, allowing an instant stream of this camera and processor combo. * Will no-op if this processor is invalid. * @@ -476,7 +476,7 @@ public void setPreview(@NonNull Processor processor) { } /** - * Optional telemetry for subsystem attachment + * Optional telemetry for subsystem attachment, as updates are managed by the {@link VisionPortal}. */ @Override protected void periodic() { diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/AprilTag.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/AprilTag.java index a332de7ff..c5e3893ec 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/AprilTag.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/AprilTag.java @@ -177,9 +177,9 @@ public CameraPoseBuilder withCameraPosition(@NonNull Position position) { * Set the position of the camera relative to the robot's center of rotation. * Defaults to the camera being directly above the robot's center of rotation at field height. * - * @param forward the distance forward of the robot's center of rotation (+forward is forward) - * @param left the distance left of the robot's center of rotation (+left is left) - * @param up the distance above the robot's center of rotation at field height (+up is up) + * @param forward the distance forward of the robot's center of rotation (+forward = forward) + * @param left the distance left of the robot's center of rotation (+left = left) + * @param up the distance above the robot's center of rotation at field height (+up = up) * @return this instance */ @NonNull @@ -223,7 +223,7 @@ public CameraPoseBuilder withCameraOrientation(@NonNull Measure yaw, @Non /** * Set the forward distance of the camera relative to the robot's center of rotation. * - * @param forward the distance forward of the robot's center of rotation (+forward is forward) + * @param forward the distance forward of the robot's center of rotation (+forward = forward) * @return this instance */ @NonNull @@ -235,7 +235,7 @@ public CameraPoseBuilder forward(@NonNull Measure forward) { /** * Set the backward distance of the camera relative to the robot's center of rotation. * - * @param backward the distance backward of the robot's center of rotation (+backward is backward) + * @param backward the distance backward of the robot's center of rotation (+backward = backward) * @return this instance */ @NonNull @@ -247,7 +247,7 @@ public CameraPoseBuilder backward(@NonNull Measure backward) { /** * Set the left distance of the camera relative to the robot's center of rotation. * - * @param left the distance left of the robot's center of rotation (+left is left) + * @param left the distance left of the robot's center of rotation (+left = left) * @return this instance */ @NonNull @@ -259,7 +259,7 @@ public CameraPoseBuilder left(@NonNull Measure left) { /** * Set the right distance of the camera relative to the robot's center of rotation. * - * @param right the distance right of the robot's center of rotation (+right is right) + * @param right the distance right of the robot's center of rotation (+right = right) * @return this instance */ @NonNull @@ -271,7 +271,7 @@ public CameraPoseBuilder right(@NonNull Measure right) { /** * Set the up distance of the camera relative to the robot's center of rotation. * - * @param up the distance above the robot's center of rotation at field height (+up is up) + * @param up the distance above the robot's center of rotation at field height (+up = up) * @return this instance */ @NonNull @@ -283,7 +283,7 @@ public CameraPoseBuilder up(@NonNull Measure up) { /** * Set the down distance of the camera relative to the robot's center of rotation. * - * @param down the distance above the robot's center of rotation at field height (+down is down) + * @param down the distance above the robot's center of rotation at field height (+down = down) * @return this instance */ @NonNull diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourSensor.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourSensor.java index 4dbaeefbd..6dc92d93f 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourSensor.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourSensor.java @@ -19,7 +19,7 @@ *

* The {@link PredominantColorProcessor} acts like a "Color Sensor", * allowing you to define a Region of Interest (ROI) of the camera - * stream inside of which the dominant color is found. Additionally, + * stream inside which the dominant color is found. Additionally, * said color is matched to one of the {@link PredominantColorProcessor.Swatch}s specified by * the user as a "best guess" at the general shade of the color. * diff --git a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourThreshold.java b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourThreshold.java index cd6dbc6cf..e78728d51 100644 --- a/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourThreshold.java +++ b/src/main/java/au/edu/sa/mbhs/studentrobotics/bunyipslib/vision/processors/ColourThreshold.java @@ -285,7 +285,7 @@ public void setBoxColour(@ColorInt int staticColour) { } /** - * Set the lower percentage that will be used as a mininum. + * Set the lower percentage that will be used as a minimum. * This is an optional method. * * @param percent the minimum percentage of the screen the contour should be to register, default 1.2% @@ -295,7 +295,7 @@ public void setContourAreaMinPercent(@NonNull DoubleSupplier percent) { } /** - * Set the lower percentage that will be used as a mininum. + * Set the lower percentage that will be used as a minimum. * This is an optional method. * * @param staticPercent the static minimum percentage of the screen the contour should be to register, default 1.2% @@ -406,7 +406,7 @@ public void setExternalContoursOnly(boolean staticUseExternalContours) { /** * Sets the size of the eroding element to use during thresholding. - * Erosion eats away at the mask, reducing noise by eliminating super small areas, but also reduces the + * Erosion eats away at the mask, reducing noise by eliminating tiny areas, but also reduces the * contour areas of everything a little bit. * This is an optional method. * @@ -418,7 +418,7 @@ public void setErodeSize(@NonNull DoubleSupplier erodeSize) { /** * Sets the size of the eroding element to use during thresholding. - * Erosion eats away at the mask, reducing noise by eliminating super small areas, but also reduces the + * Erosion eats away at the mask, reducing noise by eliminating tiny areas, but also reduces the * contour areas of everything a little bit. * This is an optional method. * @@ -806,7 +806,7 @@ protected final void onFrameDraw(@NonNull Canvas canvas) { canvas.drawPath(path, borderPaint); } - // Draw angle on the top left corner of the contour + // Draw angle in the top left corner of the contour canvas.drawText( String.format(Locale.getDefault(), "%.1f°", contour.getAngle().in(Degrees)), (float) rotRectPts[1].x,