mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +00:00
Spelling and grammar cleanups (#4849)
This commit is contained in:
@@ -114,8 +114,8 @@ public class AprilTagFieldLayout {
|
||||
* Sets the origin based on a predefined enumeration of coordinate frame origins. The origins are
|
||||
* calculated from the field dimensions.
|
||||
*
|
||||
* <p>This transforms the Pose3ds returned by {@link #getTagPose(int)} to return the correct pose
|
||||
* relative to a predefined coordinate frame.
|
||||
* <p>This transforms the Pose3d objects returned by {@link #getTagPose(int)} to return the
|
||||
* correct pose relative to a predefined coordinate frame.
|
||||
*
|
||||
* @param origin The predefined origin
|
||||
*/
|
||||
@@ -139,8 +139,8 @@ public class AprilTagFieldLayout {
|
||||
/**
|
||||
* Sets the origin for tag pose transformation.
|
||||
*
|
||||
* <p>This transforms the Pose3ds returned by {@link #getTagPose(int)} to return the correct pose
|
||||
* relative to the provided origin.
|
||||
* <p>This transforms the Pose3d objects returned by {@link #getTagPose(int)} to return the
|
||||
* correct pose relative to the provided origin.
|
||||
*
|
||||
* @param origin The new origin for tag transformations
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.function.BooleanSupplier;
|
||||
/**
|
||||
* A state machine representing a complete action to be performed by the robot. Commands are run by
|
||||
* the {@link CommandScheduler}, and can be composed into CommandGroups to allow users to build
|
||||
* complicated multi-step actions without the need to roll the state machine logic themselves.
|
||||
* complicated multistep actions without the need to roll the state machine logic themselves.
|
||||
*
|
||||
* <p>Commands are run synchronously from the main robot loop; no multithreading is used, unless
|
||||
* specified explicitly from the command implementation.
|
||||
@@ -299,7 +299,7 @@ public interface Command {
|
||||
/**
|
||||
* Decorates this command to only run if this condition is not met. If the command is already
|
||||
* running and the condition changes to true, the command will not stop running. The requirements
|
||||
* of this command will be kept for the new conditonal command.
|
||||
* of this command will be kept for the new conditional command.
|
||||
*
|
||||
* @param condition the condition that will prevent the command from running
|
||||
* @return the decorated command
|
||||
@@ -390,8 +390,8 @@ public interface Command {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether or not the command is currently scheduled. Note that this does not detect whether the
|
||||
* command is in a composition, only whether it is directly being run by the scheduler.
|
||||
* Whether the command is currently scheduled. Note that this does not detect whether the command
|
||||
* is in a composition, only whether it is directly being run by the scheduler.
|
||||
*
|
||||
* @return Whether the command is scheduled.
|
||||
*/
|
||||
|
||||
@@ -218,7 +218,7 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* trajectory. The user should implement a velocity PID on the desired output wheel velocities.
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path -
|
||||
* this is left to the user, since it is not appropriate for paths with non-stationary end-states.
|
||||
* this is left to the user, since it is not appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* @param trajectory The trajectory to follow.
|
||||
* @param pose A function that supplies the robot pose - use one of the odometry classes to
|
||||
@@ -286,7 +286,7 @@ public class MecanumControllerCommand extends CommandBase {
|
||||
* trajectory. The user should implement a velocity PID on the desired output wheel velocities.
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path -
|
||||
* this is left to the user, since it is not appropriate for paths with non-stationary end-states.
|
||||
* this is left to the user, since it is not appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* <p>Note 2: The final rotation of the robot will be set to the rotation of the final pose in the
|
||||
* trajectory. The robot will not follow the rotations from the poses at each timestep. If
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.Set;
|
||||
/**
|
||||
* Schedules the given commands when this command is initialized, and ends when all the commands are
|
||||
* no longer scheduled. Useful for forking off from CommandGroups. If this command is interrupted,
|
||||
* it will cancel all of the commands.
|
||||
* it will cancel all the commands.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
|
||||
@@ -29,7 +29,7 @@ public class SelectCommand extends CommandBase {
|
||||
private InterruptionBehavior m_interruptBehavior = InterruptionBehavior.kCancelIncoming;
|
||||
|
||||
/**
|
||||
* Creates a new selectcommand.
|
||||
* Creates a new SelectCommand.
|
||||
*
|
||||
* @param commands the map of commands to choose from
|
||||
* @param selector the selector to determine which command to run
|
||||
@@ -53,7 +53,7 @@ public class SelectCommand extends CommandBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new selectcommand.
|
||||
* Creates a new SelectCommand.
|
||||
*
|
||||
* @param toRun a supplier providing the command to run
|
||||
* @deprecated Replace with {@link ProxyCommand}
|
||||
|
||||
@@ -6,7 +6,7 @@ package edu.wpi.first.wpilibj2.command;
|
||||
|
||||
/**
|
||||
* A robot subsystem. Subsystems are the basic unit of robot organization in the Command-based
|
||||
* framework; they encapsulate low-level hardware objects (motor controllers, sensors, etc) and
|
||||
* framework; they encapsulate low-level hardware objects (motor controllers, sensors, etc.) and
|
||||
* provide methods through which they can be used by {@link Command}s. Subsystems are used by the
|
||||
* {@link CommandScheduler}'s resource management system to ensure multiple robot actions are not
|
||||
* "fighting" over the same hardware; Commands that use a subsystem should include that subsystem in
|
||||
|
||||
@@ -45,8 +45,9 @@ public class SwerveControllerCommand extends CommandBase {
|
||||
* trajectory. This command will not return output voltages but rather raw module states from the
|
||||
* position controllers which need to be put into a velocity PID.
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path-
|
||||
* this is left to the user, since it is not appropriate for paths with nonstationary endstates.
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path.
|
||||
* This is left to the user to do since it is not appropriate for paths with nonstationary
|
||||
* endstates.
|
||||
*
|
||||
* @param trajectory The trajectory to follow.
|
||||
* @param pose A function that supplies the robot pose - use one of the odometry classes to
|
||||
@@ -88,8 +89,8 @@ public class SwerveControllerCommand extends CommandBase {
|
||||
* trajectory. This command will not return output voltages but rather raw module states from the
|
||||
* position controllers which need to be put into a velocity PID.
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path-
|
||||
* this is left to the user, since it is not appropriate for paths with nonstationary endstates.
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon completion of the path.
|
||||
* This is left to the user since it is not appropriate for paths with nonstationary endstates.
|
||||
*
|
||||
* <p>Note 2: The final rotation of the robot will be set to the rotation of the final pose in the
|
||||
* trajectory. The robot will not follow the rotations from the poses at each timestep. If
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Button extends Trigger {
|
||||
/**
|
||||
* Creates a new button with the given condition determining whether it is pressed.
|
||||
*
|
||||
* @param isPressed returns whether or not the trigger should be active
|
||||
* @param isPressed returns whether the trigger should be active
|
||||
* @deprecated Replace with Trigger.
|
||||
*/
|
||||
@Deprecated
|
||||
@@ -141,8 +141,8 @@ public class Button extends Trigger {
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggles the command whenever the button is pressed (on then off then on). The command is set to
|
||||
* be interruptible.
|
||||
* Toggles the command whenever the button is pressed (on, then off, then on). The command is set
|
||||
* to be interruptible.
|
||||
*
|
||||
* @param command the command to start
|
||||
* @return this button, so calls can be chained
|
||||
|
||||
@@ -62,7 +62,7 @@ public class CommandGenericHID {
|
||||
* attached to {@link CommandScheduler#getDefaultButtonLoop() the default command scheduler button
|
||||
* loop}.
|
||||
*
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90,
|
||||
* upper-left is 315).
|
||||
*
|
||||
* @param angle POV angle in degrees, or -1 for the center / not pressed.
|
||||
@@ -75,7 +75,7 @@ public class CommandGenericHID {
|
||||
/**
|
||||
* Constructs a Trigger instance based around this angle of a POV on the HID.
|
||||
*
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90,
|
||||
* upper-left is 315).
|
||||
*
|
||||
* @param pov index of the POV to read (starting at 0). Defaults to 0.
|
||||
@@ -89,88 +89,88 @@ public class CommandGenericHID {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 0-degree angle (up) of the default (index 0) POV
|
||||
* Constructs a Trigger instance based around the 0 degree angle (up) of the default (index 0) POV
|
||||
* on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 0-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 0 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povUp() {
|
||||
return pov(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 45-degree angle (right up) of the default (index
|
||||
* Constructs a Trigger instance based around the 45 degree angle (right up) of the default (index
|
||||
* 0) POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default
|
||||
* command scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 45-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 45 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povUpRight() {
|
||||
return pov(45);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 90-degree angle (right) of the default (index 0)
|
||||
* Constructs a Trigger instance based around the 90 degree angle (right) of the default (index 0)
|
||||
* POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 90-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 90 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povRight() {
|
||||
return pov(90);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 135-degree angle (right down) of the default
|
||||
* Constructs a Trigger instance based around the 135 degree angle (right down) of the default
|
||||
* (index 0) POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the
|
||||
* default command scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 135-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 135 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povDownRight() {
|
||||
return pov(135);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 180-degree angle (down) of the default (index 0)
|
||||
* Constructs a Trigger instance based around the 180 degree angle (down) of the default (index 0)
|
||||
* POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 180-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 180 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povDown() {
|
||||
return pov(180);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 225-degree angle (down left) of the default
|
||||
* Constructs a Trigger instance based around the 225 degree angle (down left) of the default
|
||||
* (index 0) POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the
|
||||
* default command scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 225-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 225 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povDownLeft() {
|
||||
return pov(225);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 270-degree angle (left) of the default (index 0)
|
||||
* Constructs a Trigger instance based around the 270 degree angle (left) of the default (index 0)
|
||||
* POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 270-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 270 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povLeft() {
|
||||
return pov(270);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 315-degree angle (left up) of the default (index
|
||||
* Constructs a Trigger instance based around the 315 degree angle (left up) of the default (index
|
||||
* 0) POV on the HID, attached to {@link CommandScheduler#getDefaultButtonLoop() the default
|
||||
* command scheduler button loop}.
|
||||
*
|
||||
* @return a Trigger instance based around the 315-degree angle of a POV on the HID.
|
||||
* @return a Trigger instance based around the 315 degree angle of a POV on the HID.
|
||||
*/
|
||||
public Trigger povUpLeft() {
|
||||
return pov(315);
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* This class is intended to be used within a program. The programmer can manually set its value.
|
||||
* Also includes a setting for whether or not it should invert its value.
|
||||
* Also includes a setting for whether it should invert its value.
|
||||
*
|
||||
* <p>This class is provided by the NewCommands VendorDep
|
||||
*/
|
||||
|
||||
@@ -238,7 +238,7 @@ safe) semantics.
|
||||
* Decorates this command to only run if this condition is not met. If the
|
||||
* command is already running and the condition changes to true, the command
|
||||
* will not stop running. The requirements of this command will be kept for
|
||||
* the new conditonal command.
|
||||
* the new conditional command.
|
||||
*
|
||||
* @param condition the condition that will prevent the command from running
|
||||
* @return the decorated command
|
||||
|
||||
@@ -163,7 +163,7 @@ class CommandPtr final {
|
||||
* Decorates this command to only run if this condition is not met. If the
|
||||
* command is already running and the condition changes to true, the command
|
||||
* will not stop running. The requirements of this command will be kept for
|
||||
* the new conditonal command.
|
||||
* the new conditional command.
|
||||
*
|
||||
* @param condition the condition that will prevent the command from running
|
||||
* @return the decorated command
|
||||
|
||||
@@ -268,7 +268,7 @@ class MecanumControllerCommand
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon
|
||||
* completion of the path - this is left to the user, since it is not
|
||||
* appropriate for paths with non-stationary end-states.
|
||||
* appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* @param trajectory The trajectory to follow.
|
||||
* @param pose A function that supplies the robot pose - use one
|
||||
@@ -306,7 +306,7 @@ class MecanumControllerCommand
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon
|
||||
* completion of the path - this is left to the user, since it is not
|
||||
* appropriate for paths with non-stationary end-states.
|
||||
* appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* <p>Note 2: The final rotation of the robot will be set to the rotation of
|
||||
* the final pose in the trajectory. The robot will not follow the rotations
|
||||
@@ -346,7 +346,7 @@ class MecanumControllerCommand
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon
|
||||
* completion of the path - this is left to the user, since it is not
|
||||
* appropriate for paths with non-stationary end-states.
|
||||
* appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* @param trajectory The trajectory to follow.
|
||||
* @param pose A function that supplies the robot pose - use one
|
||||
@@ -384,7 +384,7 @@ class MecanumControllerCommand
|
||||
*
|
||||
* <p>Note: The controllers will *not* set the outputVolts to zero upon
|
||||
* completion of the path - this is left to the user, since it is not
|
||||
* appropriate for paths with non-stationary end-states.
|
||||
* appropriate for paths with nonstationary end-states.
|
||||
*
|
||||
* <p>Note2: The final rotation of the robot will be set to the rotation of
|
||||
* the final pose in the trajectory. The robot will not follow the rotations
|
||||
|
||||
@@ -59,7 +59,7 @@ class ParallelCommandGroup
|
||||
|
||||
ParallelCommandGroup(ParallelCommandGroup&& other) = default;
|
||||
|
||||
// No copy constructors for commandgroups
|
||||
// No copy constructors for command groups
|
||||
ParallelCommandGroup(const ParallelCommandGroup&) = delete;
|
||||
|
||||
// Prevent template expansion from emulating copy ctor
|
||||
|
||||
@@ -38,7 +38,7 @@ template <typename Key>
|
||||
class SelectCommand : public CommandHelper<CommandBase, SelectCommand<Key>> {
|
||||
public:
|
||||
/**
|
||||
* Creates a new selectcommand.
|
||||
* Creates a new SelectCommand.
|
||||
*
|
||||
* @param commands the map of commands to choose from
|
||||
* @param selector the selector to determine which command to run
|
||||
|
||||
@@ -243,7 +243,7 @@ class Button : public Trigger {
|
||||
|
||||
/**
|
||||
* Binds a command to start when the button is pressed, and be canceled when
|
||||
* it is pessed again. Transfers command ownership to the button scheduler,
|
||||
* it is pressed again. Transfers command ownership to the button scheduler,
|
||||
* so the user does not have to worry about lifespan - rvalue refs will be
|
||||
* *moved*, lvalue refs will be *copied.*
|
||||
*
|
||||
|
||||
@@ -66,49 +66,49 @@ class CommandGenericHID : public frc::GenericHID {
|
||||
CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 0-degree angle (up) of the
|
||||
* Constructs a Trigger instance based around the 0 degree angle (up) of the
|
||||
* default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 0-degree angle of a POV on the
|
||||
* @return a Trigger instance based around the 0 degree angle of a POV on the
|
||||
* HID.
|
||||
*/
|
||||
Trigger POVUp(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 45-degree angle (right up)
|
||||
* Constructs a Trigger instance based around the 45 degree angle (right up)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 45-degree angle of a POV on the
|
||||
* @return a Trigger instance based around the 45 degree angle of a POV on the
|
||||
* HID.
|
||||
*/
|
||||
Trigger POVUpRight(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 90-degree angle (right) of
|
||||
* Constructs a Trigger instance based around the 90 degree angle (right) of
|
||||
* the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 90-degree angle of a POV on the
|
||||
* @return a Trigger instance based around the 90 degree angle of a POV on the
|
||||
* HID.
|
||||
*/
|
||||
Trigger POVRight(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 135-degree angle (right
|
||||
* Constructs a Trigger instance based around the 135 degree angle (right
|
||||
* down) of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a Trigger instance based around the 135-degree angle of a POV on
|
||||
* @return a Trigger instance based around the 135 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
Trigger POVDownRight(
|
||||
@@ -116,52 +116,52 @@ class CommandGenericHID : public frc::GenericHID {
|
||||
CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 180-degree angle (down) of
|
||||
* Constructs a Trigger instance based around the 180 degree angle (down) of
|
||||
* the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 180-degree angle of a POV on
|
||||
* @return a Trigger instance based around the 180 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
Trigger POVDown(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 225-degree angle (down left)
|
||||
* Constructs a Trigger instance based around the 225 degree angle (down left)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 225-degree angle of a POV on
|
||||
* @return a Trigger instance based around the 225 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
Trigger POVDownLeft(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 270-degree angle (left) of
|
||||
* Constructs a Trigger instance based around the 270 degree angle (left) of
|
||||
* the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 270-degree angle of a POV on
|
||||
* @return a Trigger instance based around the 270 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
Trigger POVLeft(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
.GetDefaultButtonLoop()) const;
|
||||
|
||||
/**
|
||||
* Constructs a Trigger instance based around the 315-degree angle (left up)
|
||||
* Constructs a Trigger instance based around the 315 degree angle (left up)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to. Defaults to
|
||||
* {@link CommandScheduler::GetDefaultButtonLoop() the default command
|
||||
* scheduler button loop}.
|
||||
* @return a Trigger instance based around the 315-degree angle of a POV on
|
||||
* @return a Trigger instance based around the 315 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
Trigger POVUpLeft(frc::EventLoop* loop = CommandScheduler::GetInstance()
|
||||
|
||||
@@ -23,7 +23,7 @@ class JoystickButton : public Button {
|
||||
* Creates a JoystickButton that commands can be bound to.
|
||||
*
|
||||
* @param joystick The joystick on which the button is located.
|
||||
* @param buttonNumber The number of the button on the joystic.
|
||||
* @param buttonNumber The number of the button on the joystick.
|
||||
*/
|
||||
WPI_IGNORE_DEPRECATED
|
||||
explicit JoystickButton(frc::GenericHID* joystick, int buttonNumber)
|
||||
|
||||
@@ -151,73 +151,73 @@ class GenericHID {
|
||||
BooleanEvent POV(int pov, int angle, EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 0-degree angle (up) of
|
||||
* Constructs a BooleanEvent instance based around the 0 degree angle (up) of
|
||||
* the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 0-degree angle of a POV on
|
||||
* @return a BooleanEvent instance based around the 0 degree angle of a POV on
|
||||
* the HID.
|
||||
*/
|
||||
BooleanEvent POVUp(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 45-degree angle (right
|
||||
* Constructs a BooleanEvent instance based around the 45 degree angle (right
|
||||
* up) of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 45-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 45 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVUpRight(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 90-degree angle (right)
|
||||
* Constructs a BooleanEvent instance based around the 90 degree angle (right)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 90-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 90 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVRight(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 135-degree angle (right
|
||||
* Constructs a BooleanEvent instance based around the 135 degree angle (right
|
||||
* down) of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 135-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 135 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVDownRight(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 180-degree angle (down)
|
||||
* Constructs a BooleanEvent instance based around the 180 degree angle (down)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 180-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 180 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVDown(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 225-degree angle (down
|
||||
* Constructs a BooleanEvent instance based around the 225 degree angle (down
|
||||
* left) of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 225-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 225 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVDownLeft(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 270-degree angle (left)
|
||||
* Constructs a BooleanEvent instance based around the 270 degree angle (left)
|
||||
* of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 270-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 270 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVLeft(EventLoop* loop) const;
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 315-degree angle (left
|
||||
* Constructs a BooleanEvent instance based around the 315 degree angle (left
|
||||
* up) of the default (index 0) POV on the HID.
|
||||
*
|
||||
* @return a BooleanEvent instance based around the 315-degree angle of a POV
|
||||
* @return a BooleanEvent instance based around the 315 degree angle of a POV
|
||||
* on the HID.
|
||||
*/
|
||||
BooleanEvent POVUpLeft(EventLoop* loop) const;
|
||||
|
||||
@@ -318,7 +318,7 @@ public class ADIS16448_IMU implements AutoCloseable, NTSendable {
|
||||
calibrate();
|
||||
// Reset accumulated offsets
|
||||
reset();
|
||||
// Tell the acquire loop that we're done starting up
|
||||
// Indicate to the acquire loop that we're done starting up
|
||||
m_start_up_mode = false;
|
||||
// Let the user know the IMU was initiallized successfully
|
||||
DriverStation.reportWarning("ADIS16448 IMU Successfully Initialized!", false);
|
||||
@@ -1105,28 +1105,28 @@ public class ADIS16448_IMU implements AutoCloseable, NTSendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return X axis complementary angle in degrees
|
||||
* @return X-axis complementary angle in degrees
|
||||
*/
|
||||
public synchronized double getXComplementaryAngle() {
|
||||
return m_compAngleX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Y axis complementary angle in degrees
|
||||
* @return Y-axis complementary angle in degrees
|
||||
*/
|
||||
public synchronized double getYComplementaryAngle() {
|
||||
return m_compAngleY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return X axis filtered acceleration angle in degrees
|
||||
* @return X-axis filtered acceleration angle in degrees
|
||||
*/
|
||||
public synchronized double getXFilteredAccelAngle() {
|
||||
return m_accelAngleX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Y axis filtered acceleration angle in degrees
|
||||
* @return Y-axis filtered acceleration angle in degrees
|
||||
*/
|
||||
public synchronized double getYFilteredAccelAngle() {
|
||||
return m_accelAngleY;
|
||||
@@ -1136,7 +1136,7 @@ public class ADIS16448_IMU implements AutoCloseable, NTSendable {
|
||||
* @return Barometric Pressure in PSI
|
||||
*/
|
||||
public synchronized double getBarometricPressure() {
|
||||
// mbar to PSI
|
||||
// mbar to PSI conversion
|
||||
return m_baro * 0.0145;
|
||||
}
|
||||
|
||||
|
||||
@@ -1005,28 +1005,28 @@ public class ADIS16470_IMU implements AutoCloseable, NTSendable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return X axis complementary angle
|
||||
* @return X-axis complementary angle
|
||||
*/
|
||||
public synchronized double getXComplementaryAngle() {
|
||||
return m_compAngleX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Y axis complementary angle
|
||||
* @return Y-axis complementary angle
|
||||
*/
|
||||
public synchronized double getYComplementaryAngle() {
|
||||
return m_compAngleY;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return X axis filtered acceleration angle
|
||||
* @return X-axis filtered acceleration angle
|
||||
*/
|
||||
public synchronized double getXFilteredAccelAngle() {
|
||||
return m_accelAngleX;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Y axis filtered acceleration angle
|
||||
* @return Y-axis filtered acceleration angle
|
||||
*/
|
||||
public synchronized double getYFilteredAccelAngle() {
|
||||
return m_accelAngleY;
|
||||
|
||||
@@ -42,7 +42,7 @@ public class AddressableLED implements AutoCloseable {
|
||||
/**
|
||||
* Sets the length of the LED strip.
|
||||
*
|
||||
* <p>Calling this is an expensive call, so its best to call it once, then just update data.
|
||||
* <p>Calling this is an expensive call, so it's best to call it once, then just update data.
|
||||
*
|
||||
* <p>The max length is 5460 LEDs.
|
||||
*
|
||||
@@ -53,7 +53,7 @@ public class AddressableLED implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the led output data.
|
||||
* Sets the LED output data.
|
||||
*
|
||||
* <p>If the output is enabled, this will start writing the next data cycle. It is safe to call,
|
||||
* even while output is enabled.
|
||||
|
||||
@@ -144,9 +144,9 @@ public class AnalogEncoder implements Sendable, AutoCloseable {
|
||||
|
||||
/**
|
||||
* Set the distance per rotation of the encoder. This sets the multiplier used to determine the
|
||||
* distance driven based on the rotation value from the encoder. Set this value based on the how
|
||||
* far the mechanism travels in 1 rotation of the encoder, and factor in gearing reductions
|
||||
* following the encoder shaft. This distance can be in any units you like, linear or angular.
|
||||
* distance driven based on the rotation value from the encoder. Set this value based on how far
|
||||
* the mechanism travels in 1 rotation of the encoder, and factor in gearing reductions following
|
||||
* the encoder shaft. This distance can be in any units you like, linear or angular.
|
||||
*
|
||||
* @param distancePerRotation the distance per rotation of the encoder
|
||||
*/
|
||||
|
||||
@@ -107,8 +107,8 @@ public class AnalogInput implements Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the factory scaling least significant bit weight constant. The least significant bit weight
|
||||
* constant for the channel that was calibrated in manufacturing and stored in an eeprom.
|
||||
* Get the factory scaling the least significant bit weight constant. The least significant bit
|
||||
* weight constant for the channel that was calibrated in manufacturing and stored in an eeprom.
|
||||
*
|
||||
* <p>Volts = ((LSB_Weight * 1e-9) * raw) - (Offset * 1e-9)
|
||||
*
|
||||
|
||||
@@ -23,8 +23,8 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* AnalogPotentiometer constructor.
|
||||
*
|
||||
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
|
||||
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
|
||||
* 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
|
||||
* have a 270 degree potentiometer, and you want the output to be degrees with the halfway point
|
||||
* as 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
|
||||
* point after scaling is 135 degrees. This will calculate the result from the fullRange times the
|
||||
* fraction of the supply voltage, plus the offset.
|
||||
*
|
||||
@@ -43,8 +43,8 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* AnalogPotentiometer constructor.
|
||||
*
|
||||
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
|
||||
* have a 270 degree potentiometer and you want the output to be degrees with the halfway point as
|
||||
* 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
|
||||
* have a 270 degree potentiometer, and you want the output to be degrees with the halfway point
|
||||
* as 0 degrees. The fullRange value is 270.0(degrees) and the offset is -135.0 since the halfway
|
||||
* point after scaling is 135 degrees. This will calculate the result from the fullRange times the
|
||||
* fraction of the supply voltage, plus the offset.
|
||||
*
|
||||
@@ -66,7 +66,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* AnalogPotentiometer constructor.
|
||||
*
|
||||
* <p>Use the scale value so that the output produces meaningful values. I.E: you have a 270
|
||||
* degree potentiometer and you want the output to be degrees with the starting point as 0
|
||||
* degree potentiometer, and you want the output to be degrees with the starting point as 0
|
||||
* degrees. The scale value is 270.0(degrees).
|
||||
*
|
||||
* @param channel The analog input channel this potentiometer is plugged into. 0-3 are on-board
|
||||
@@ -81,7 +81,7 @@ public class AnalogPotentiometer implements Sendable, AutoCloseable {
|
||||
* AnalogPotentiometer constructor.
|
||||
*
|
||||
* <p>Use the fullRange and offset values so that the output produces meaningful values. I.E: you
|
||||
* have a 270 degree potentiometer and you want the output to be degrees with the starting point
|
||||
* have a 270 degree potentiometer, and you want the output to be degrees with the starting point
|
||||
* as 0 degrees. The scale value is 270.0(degrees).
|
||||
*
|
||||
* @param input The {@link AnalogInput} this potentiometer is plugged into.
|
||||
|
||||
@@ -22,8 +22,8 @@ import edu.wpi.first.util.sendable.SendableBuilder;
|
||||
* upper limit, then the output is true. If the analog value is in between, then the trigger output
|
||||
* state maintains its most recent value.
|
||||
*
|
||||
* <p>The InWindow output indicates whether or not the analog signal is inside the range defined by
|
||||
* the limits.
|
||||
* <p>The InWindow output indicates whether the analog signal is inside the range defined by the
|
||||
* limits.
|
||||
*
|
||||
* <p>The RisingPulse and FallingPulse outputs detect an instantaneous transition from above the
|
||||
* upper limit to below the lower limit, and vise versa. These pulses represent a rollover condition
|
||||
|
||||
@@ -149,7 +149,7 @@ public class CAN implements Closeable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a CAN packet. The will continuously return the last packet received, without accounting
|
||||
* Read a CAN packet. This will continuously return the last packet received, without accounting
|
||||
* for packet age.
|
||||
*
|
||||
* @param apiId The API ID to read.
|
||||
@@ -161,7 +161,7 @@ public class CAN implements Closeable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a CAN packet. The will return the last packet received until the packet is older then the
|
||||
* Read a CAN packet. This will return the last packet received until the packet is older than the
|
||||
* requested timeout. Then it will return false.
|
||||
*
|
||||
* @param apiId The API ID to read.
|
||||
|
||||
@@ -385,7 +385,7 @@ public class Counter implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the Counter to zero. Set the counter value to zero. This doesn't effect the running state
|
||||
* Reset the Counter to zero. Set the counter value to zero. This doesn't affect the running state
|
||||
* of the counter, just sets the current value to zero.
|
||||
*/
|
||||
@Override
|
||||
@@ -425,7 +425,7 @@ public class Counter implements CounterBase, Sendable, AutoCloseable {
|
||||
/**
|
||||
* Determine if the clock is stopped. Determine if the clocked input is stopped based on the
|
||||
* MaxPeriod value set using the SetMaxPeriod method. If the clock exceeds the MaxPeriod, then the
|
||||
* device (and counter) are assumed to be stopped and it returns true.
|
||||
* device (and counter) are assumed to be stopped and the method will return true.
|
||||
*
|
||||
* @return true if the most recent counter period exceeds the MaxPeriod value set by SetMaxPeriod.
|
||||
*/
|
||||
|
||||
@@ -6,14 +6,14 @@ package edu.wpi.first.wpilibj;
|
||||
|
||||
/**
|
||||
* Interface for counting the number of ticks on a digital input channel. Encoders, Gear tooth
|
||||
* sensors, and counters should all subclass this so it can be used to build more advanced classes
|
||||
* for control and driving.
|
||||
* sensors, and counters should all subclass this in order to build more advanced classes for
|
||||
* control and driving.
|
||||
*
|
||||
* <p>All counters will immediately start counting - reset() them if you need them to be zeroed
|
||||
* before use.
|
||||
*/
|
||||
public interface CounterBase {
|
||||
/** The number of edges for the counterbase to increment or decrement on. */
|
||||
/** The number of edges for the CounterBase to increment or decrement on. */
|
||||
enum EncodingType {
|
||||
/** Count only the rising edge. */
|
||||
k1X(0),
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
|
||||
/**
|
||||
* Class to enable glitch filtering on a set of digital inputs. This class will manage adding and
|
||||
* removing digital inputs from a FPGA glitch filter. The filter lets the user configure the time
|
||||
* removing digital inputs from an FPGA glitch filter. The filter lets the user configure the time
|
||||
* that an input must remain high or low before it is classified as high or low.
|
||||
*/
|
||||
public class DigitalGlitchFilter implements Sendable, AutoCloseable {
|
||||
|
||||
@@ -138,7 +138,7 @@ public class DigitalOutput extends DigitalSource implements Sendable {
|
||||
*
|
||||
* <p>Allocate one of the 6 DO PWM generator resources.
|
||||
*
|
||||
* <p>Supply the initial duty-cycle to output so as to avoid a glitch when first starting.
|
||||
* <p>Supply the initial duty-cycle to output in order to avoid a glitch when first starting.
|
||||
*
|
||||
* <p>The resolution of the duty cycle is 8-bit for low frequencies (1kHz or less) but is reduced
|
||||
* the higher the frequency of the PWM signal is.
|
||||
|
||||
@@ -1160,7 +1160,7 @@ public final class DriverStation {
|
||||
public static void refreshData() {
|
||||
DriverStationJNI.refreshDSData();
|
||||
|
||||
// Get the status of all of the joysticks
|
||||
// Get the status of all the joysticks
|
||||
for (byte stick = 0; stick < kJoystickPorts; stick++) {
|
||||
m_joystickAxesCache[stick].m_count =
|
||||
DriverStationJNI.getJoystickAxes(stick, m_joystickAxesCache[stick].m_axes);
|
||||
|
||||
@@ -200,9 +200,9 @@ public class DutyCycleEncoder implements Sendable, AutoCloseable {
|
||||
|
||||
/**
|
||||
* Set the distance per rotation of the encoder. This sets the multiplier used to determine the
|
||||
* distance driven based on the rotation value from the encoder. Set this value based on the how
|
||||
* far the mechanism travels in 1 rotation of the encoder, and factor in gearing reductions
|
||||
* following the encoder shaft. This distance can be in any units you like, linear or angular.
|
||||
* distance driven based on the rotation value from the encoder. Set this value based on how far
|
||||
* the mechanism travels in 1 rotation of the encoder, and factor in gearing reductions following
|
||||
* the encoder shaft. This distance can be in any units you like, linear or angular.
|
||||
*
|
||||
* @param distancePerRotation the distance per rotation of the encoder
|
||||
*/
|
||||
|
||||
@@ -42,9 +42,9 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
}
|
||||
|
||||
/** The a source. */
|
||||
/** The 'a' source. */
|
||||
protected DigitalSource m_aSource; // the A phase of the quad encoder
|
||||
/** The b source. */
|
||||
/** The 'b' source. */
|
||||
protected DigitalSource m_bSource; // the B phase of the quad encoder
|
||||
/** The index source. */
|
||||
protected DigitalSource m_indexSource; // Index on some encoders
|
||||
@@ -84,8 +84,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param channelA The a channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channelB The b channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channelA The 'a' channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param channelB The 'b' channel DIO channel. 0-9 are on-board, 10-25 are on the MXP port
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
*/
|
||||
@@ -94,7 +94,7 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels.
|
||||
* Encoder constructor. Construct an Encoder given a and b channels.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
@@ -106,7 +106,7 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels.
|
||||
* Encoder constructor. Construct an Encoder given a and b channels.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
@@ -117,7 +117,7 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
* @param encodingType either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is
|
||||
* selected, then an encoder FPGA object is used and the returned counts will be 4x the
|
||||
* encoder spec'd value since all rising and falling edges are counted. If 1X or 2X are
|
||||
* selected then a m_counter object will be used and the returned value will either exactly
|
||||
* selected, then a counter object will be used and the returned value will either exactly
|
||||
* match the spec'd count or be double (2x) the spec'd count.
|
||||
*/
|
||||
public Encoder(
|
||||
@@ -139,8 +139,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels. Using an index pulse forces 4x
|
||||
* encoding
|
||||
* Encoder constructor. Construct an Encoder given a and b channels. Using an index pulse forces
|
||||
* 4x encoding
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
@@ -160,8 +160,8 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels. Using an index pulse forces 4x
|
||||
* encoding
|
||||
* Encoder constructor. Construct an Encoder given a and b channels. Using an index pulse forces
|
||||
* 4x encoding
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
@@ -174,14 +174,14 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
|
||||
* in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* Encoder constructor. Construct an Encoder given a and b channels as digital inputs. This is
|
||||
* used in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* digital inputs and assume that they already are counted.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param sourceA The source that should be used for the a channel.
|
||||
* @param sourceB the source that should be used for the b channel.
|
||||
* @param sourceA The source that should be used for the 'a' channel.
|
||||
* @param sourceB the source that should be used for the 'b' channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
*/
|
||||
@@ -190,34 +190,34 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
|
||||
* in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* Encoder constructor. Construct an Encoder given a and b channels as digital inputs. This is
|
||||
* used in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* digital inputs and assume that they already are counted.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param sourceA The source that should be used for the a channel.
|
||||
* @param sourceB the source that should be used for the b channel.
|
||||
* @param sourceA The source that should be used for the 'a' channel.
|
||||
* @param sourceB the source that should be used for the 'b' channel.
|
||||
*/
|
||||
public Encoder(DigitalSource sourceA, DigitalSource sourceB) {
|
||||
this(sourceA, sourceB, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a and b channels as digital inputs. This is used
|
||||
* in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* Encoder constructor. Construct an Encoder given a and b channels as digital inputs. This is
|
||||
* used in the case where the digital inputs are shared. The Encoder class will not allocate the
|
||||
* digital inputs and assume that they already are counted.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param sourceA The source that should be used for the a channel.
|
||||
* @param sourceB the source that should be used for the b channel.
|
||||
* @param sourceA The source that should be used for the 'a' channel.
|
||||
* @param sourceB the source that should be used for the 'b' channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
* @param encodingType either k1X, k2X, or k4X to indicate 1X, 2X or 4X decoding. If 4X is
|
||||
* selected, then an encoder FPGA object is used and the returned counts will be 4x the
|
||||
* encoder spec'd value since all rising and falling edges are counted. If 1X or 2X are
|
||||
* selected then a m_counter object will be used and the returned value will either exactly
|
||||
* selected then a counter object will be used and the returned value will either exactly
|
||||
* match the spec'd count or be double (2x) the spec'd count.
|
||||
*/
|
||||
public Encoder(
|
||||
@@ -239,14 +239,14 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a, b and index channels as digital inputs. This
|
||||
* Encoder constructor. Construct an Encoder given a, b and index channels as digital inputs. This
|
||||
* is used in the case where the digital inputs are shared. The Encoder class will not allocate
|
||||
* the digital inputs and assume that they already are counted.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param sourceA The source that should be used for the a channel.
|
||||
* @param sourceB the source that should be used for the b channel.
|
||||
* @param sourceA The source that should be used for the 'a' channel.
|
||||
* @param sourceB the source that should be used for the 'b' channel.
|
||||
* @param indexSource the source that should be used for the index channel.
|
||||
* @param reverseDirection represents the orientation of the encoder and inverts the output values
|
||||
* if necessary so forward represents positive values.
|
||||
@@ -263,14 +263,14 @@ public class Encoder implements CounterBase, Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encoder constructor. Construct a Encoder given a, b and index channels as digital inputs. This
|
||||
* Encoder constructor. Construct an Encoder given a, b and index channels as digital inputs. This
|
||||
* is used in the case where the digital inputs are shared. The Encoder class will not allocate
|
||||
* the digital inputs and assume that they already are counted.
|
||||
*
|
||||
* <p>The encoder will start counting immediately.
|
||||
*
|
||||
* @param sourceA The source that should be used for the a channel.
|
||||
* @param sourceB the source that should be used for the b channel.
|
||||
* @param sourceA The source that should be used for the 'a' channel.
|
||||
* @param sourceB the source that should be used for the 'b' channel.
|
||||
* @param indexSource the source that should be used for the index channel.
|
||||
*/
|
||||
public Encoder(DigitalSource sourceA, DigitalSource sourceB, DigitalSource indexSource) {
|
||||
|
||||
@@ -41,12 +41,11 @@ public final class Filesystem {
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtains the deploy directory of the program, which is the remote location src/main/deploy is
|
||||
* deployed to by default. On the roboRIO, this is /home/lvuser/deploy. In simulation, it is where
|
||||
* the simulation was launched from, in the subdirectory "src/main/deploy"
|
||||
* (`pwd`/src/main/deploy).
|
||||
* Obtains the 'deploy' directory of the program, located at src/main/deploy, which is deployed by
|
||||
* default. On the roboRIO, this is /home/lvuser/deploy. In simulation, it is where the simulation
|
||||
* was launched from, in the subdirectory "src/main/deploy" (`pwd`/src/main/deploy).
|
||||
*
|
||||
* @return The deploy directory
|
||||
* @return The 'deploy' directory
|
||||
*/
|
||||
public static File getDeployDirectory() {
|
||||
if (RobotBase.isReal()) {
|
||||
|
||||
@@ -147,7 +147,7 @@ public class GenericHID {
|
||||
/**
|
||||
* Get the angle in degrees of a POV on the HID.
|
||||
*
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90,
|
||||
* upper-left is 315).
|
||||
*
|
||||
* @param pov The index of the POV to read (starting at 0). Defaults to 0.
|
||||
@@ -160,7 +160,7 @@ public class GenericHID {
|
||||
/**
|
||||
* Get the angle in degrees of the default POV (index 0) on the HID.
|
||||
*
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90,
|
||||
* upper-left is 315).
|
||||
*
|
||||
* @return the angle of the POV in degrees, or -1 if the POV is not pressed.
|
||||
@@ -186,7 +186,7 @@ public class GenericHID {
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around this angle of a POV on the HID.
|
||||
*
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (eg right is 90,
|
||||
* <p>The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90,
|
||||
* upper-left is 315).
|
||||
*
|
||||
* @param pov index of the POV to read (starting at 0). Defaults to 0.
|
||||
@@ -199,88 +199,88 @@ public class GenericHID {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 0-degree angle (up) of the default (index
|
||||
* Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index
|
||||
* 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 0-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 0 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povUp(EventLoop loop) {
|
||||
return pov(0, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 45-degree angle (right up) of the default
|
||||
* Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 45-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 45 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povUpRight(EventLoop loop) {
|
||||
return pov(45, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 90-degree angle (right) of the default
|
||||
* Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 90-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 90 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povRight(EventLoop loop) {
|
||||
return pov(90, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 135-degree angle (right down) of the
|
||||
* Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the
|
||||
* default (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 135-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 135 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povDownRight(EventLoop loop) {
|
||||
return pov(135, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 180-degree angle (down) of the default
|
||||
* Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 180-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 180 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povDown(EventLoop loop) {
|
||||
return pov(180, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 225-degree angle (down left) of the default
|
||||
* Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 225-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 225 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povDownLeft(EventLoop loop) {
|
||||
return pov(225, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 270-degree angle (left) of the default
|
||||
* Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 270-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 270 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povLeft(EventLoop loop) {
|
||||
return pov(270, loop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a BooleanEvent instance based around the 315-degree angle (left up) of the default
|
||||
* Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default
|
||||
* (index 0) POV on the HID.
|
||||
*
|
||||
* @param loop the event loop instance to attach the event to.
|
||||
* @return a BooleanEvent instance based around the 315-degree angle of a POV on the HID.
|
||||
* @return a BooleanEvent instance based around the 315 degree angle of a POV on the HID.
|
||||
*/
|
||||
public BooleanEvent povUpLeft(EventLoop loop) {
|
||||
return pov(315, loop);
|
||||
@@ -379,10 +379,10 @@ public class GenericHID {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the axis type of a joystick axis.
|
||||
* Get the axis type of the provided joystick axis.
|
||||
*
|
||||
* @param axis The axis to read, starting at 0.
|
||||
* @return the axis type of a joystick axis.
|
||||
* @return the axis type of the given joystick axis
|
||||
*/
|
||||
public int getAxisType(int axis) {
|
||||
return DriverStation.getJoystickAxisType(m_port, axis);
|
||||
|
||||
@@ -213,7 +213,7 @@ public class PWM implements Sendable, AutoCloseable {
|
||||
return PWMJNI.getPWMRaw(m_handle);
|
||||
}
|
||||
|
||||
/** Temporarily disables the PWM output. The next set call will reenable the output. */
|
||||
/** Temporarily disables the PWM output. The next set call will re-enable the output. */
|
||||
public void setDisabled() {
|
||||
PWMJNI.setPWMDisabled(m_handle);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ public final class Preferences {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether or not there is a key with the given name.
|
||||
* Returns whether there is a key with the given name.
|
||||
*
|
||||
* @param key the key
|
||||
* @return if there is a value at the given key
|
||||
|
||||
@@ -159,7 +159,7 @@ public class Relay extends MotorSafety implements Sendable, AutoCloseable {
|
||||
* <p>When set to kBothDirections, the relay can be set to any of the four states: 0v-0v, 12v-0v,
|
||||
* 0v-12v, 12v-12v
|
||||
*
|
||||
* <p>When set to kForwardOnly or kReverseOnly, you can specify the constant for the direction or
|
||||
* <p>When set to kForwardOnly or kReverseOnly, you can specify the constant for the direction, or
|
||||
* you can simply specify kOff and kOn. Using only kOff and kOn is recommended.
|
||||
*
|
||||
* @param value The state to set the relay.
|
||||
|
||||
@@ -9,14 +9,14 @@ import edu.wpi.first.hal.util.CheckedAllocationException;
|
||||
|
||||
/**
|
||||
* Track resources in the program. The Resource class is a convenient way of keeping track of
|
||||
* allocated arbitrary resources in the program. Resources are just indices that have an lower and
|
||||
* allocated arbitrary resources in the program. Resources are just indices that have a lower and
|
||||
* upper bound that are tracked by this class. In the library they are used for tracking allocation
|
||||
* of hardware channels but this is purely arbitrary. The resource class does not do any actual
|
||||
* allocation, but simply tracks if a given index is currently in use.
|
||||
*
|
||||
* <p><b>WARNING:</b> this should only be statically allocated. When the program loads into memory
|
||||
* all the static constructors are called. At that time a linked list of all the "Resources" is
|
||||
* created. Then when the program actually starts - in the Robot constructor, all resources are
|
||||
* created. Then, when the program actually starts - in the Robot constructor, all resources are
|
||||
* initialized. This ensures that the program is restartable in memory without having to
|
||||
* unload/reload.
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ public final class Resource {
|
||||
|
||||
/**
|
||||
* Allocate a specific resource value. The user requests a specific resource value, i.e. channel
|
||||
* number and it is verified unallocated, then returned.
|
||||
* number, and it is verified unallocated, then returned.
|
||||
*
|
||||
* @param index The resource to allocate
|
||||
* @return The index of the allocated block
|
||||
@@ -90,8 +90,8 @@ public final class Resource {
|
||||
|
||||
/**
|
||||
* Free an allocated resource. After a resource is no longer needed, for example a destructor is
|
||||
* called for a channel assignment class, Free will release the resource value so it can be reused
|
||||
* somewhere else in the program.
|
||||
* called for a channel assignment class, this method will release the resource value, so it can
|
||||
* be reused somewhere else in the program.
|
||||
*
|
||||
* @param index The index of the resource to free.
|
||||
*/
|
||||
|
||||
@@ -137,14 +137,14 @@ public abstract class RobotBase implements AutoCloseable {
|
||||
* completion before Autonomous is entered.
|
||||
*
|
||||
* <p>This must be used to ensure that the communications code starts. In the future it would be
|
||||
* nice to put this code into it's own task that loads on boot so ensure that it runs.
|
||||
* nice to put this code into its own task that loads on boot so ensure that it runs.
|
||||
*/
|
||||
protected RobotBase() {
|
||||
final NetworkTableInstance inst = NetworkTableInstance.getDefault();
|
||||
m_threadId = Thread.currentThread().getId();
|
||||
setupCameraServerShared();
|
||||
setupMathShared();
|
||||
// subscribe to "" to force persistent values to progagate to local
|
||||
// subscribe to "" to force persistent values to propagate to local
|
||||
m_suball = new MultiSubscriber(inst, new String[] {""});
|
||||
if (isReal()) {
|
||||
inst.startServer("/home/lvuser/networktables.json");
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
/** Represents a SPI bus port. */
|
||||
/** Represents an SPI bus port. */
|
||||
public class SPI implements AutoCloseable {
|
||||
public enum Port {
|
||||
kOnboardCS0(SPIJNI.ONBOARD_CS0_PORT),
|
||||
@@ -84,7 +84,7 @@ public class SPI implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the order that bits are sent and received on the wire to be most significant bit
|
||||
* Configure the order that bits are sent and received on the wire to be the most significant bit
|
||||
* first.
|
||||
*
|
||||
* @deprecated Does not work, will be removed.
|
||||
@@ -95,7 +95,7 @@ public class SPI implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure the order that bits are sent and received on the wire to be least significant bit
|
||||
* Configure the order that bits are sent and received on the wire to be the least significant bit
|
||||
* first.
|
||||
*
|
||||
* @deprecated Does not work, will be removed.
|
||||
|
||||
@@ -164,9 +164,8 @@ public class SerialPort implements AutoCloseable {
|
||||
/**
|
||||
* Enable termination and specify the termination character.
|
||||
*
|
||||
* <p>Termination is currently only implemented for receive. When the the terminator is received,
|
||||
* the read() or readString() will return fewer bytes than requested, stopping after the
|
||||
* terminator.
|
||||
* <p>Termination is currently only implemented for receive. When the terminator is received, the
|
||||
* read() or readString() will return fewer bytes than requested, stopping after the terminator.
|
||||
*
|
||||
* @param terminator The character to use for termination.
|
||||
*/
|
||||
@@ -177,9 +176,8 @@ public class SerialPort implements AutoCloseable {
|
||||
/**
|
||||
* Enable termination with the default terminator '\n'
|
||||
*
|
||||
* <p>Termination is currently only implemented for receive. When the the terminator is received,
|
||||
* the read() or readString() will return fewer bytes than requested, stopping after the
|
||||
* terminator.
|
||||
* <p>Termination is currently only implemented for receive. When the terminator is received, the
|
||||
* read() or readString() will return fewer bytes than requested, stopping after the terminator.
|
||||
*
|
||||
* <p>The default terminator is '\n'
|
||||
*/
|
||||
@@ -268,7 +266,7 @@ public class SerialPort implements AutoCloseable {
|
||||
* <p>This defines the timeout for transactions with the hardware. It will affect reads if less
|
||||
* bytes are available than the read buffer size (defaults to 1) and very large writes.
|
||||
*
|
||||
* @param timeout The number of seconds to to wait for I/O.
|
||||
* @param timeout The number of seconds to wait for I/O.
|
||||
*/
|
||||
public void setTimeout(double timeout) {
|
||||
SerialPortJNI.serialSetTimeout(m_portHandle, timeout);
|
||||
|
||||
@@ -101,14 +101,14 @@ public class SynchronousInterrupt implements AutoCloseable {
|
||||
* @param ignorePrevious True to ignore if a previous interrupt has occurred, and only wait for a
|
||||
* new trigger. False will consider if an interrupt has occurred since the last time the
|
||||
* interrupt was read.
|
||||
* @return Result of which edges were triggered, or if an timeout occurred.
|
||||
* @return Result of which edges were triggered, or if a timeout occurred.
|
||||
*/
|
||||
public WaitResult waitForInterrupt(double timeoutSeconds, boolean ignorePrevious) {
|
||||
long result = InterruptJNI.waitForInterrupt(m_handle, timeoutSeconds, ignorePrevious);
|
||||
|
||||
// Rising edge result is the interrupt bit set in the byte 0xFF
|
||||
// Falling edge result is the interrupt bit set in the byte 0xFF00
|
||||
// Set any bit set to be true for that edge, and AND the 2 results
|
||||
// Set any bit set to be true for that edge, and then conduct a logical AND on the 2 results
|
||||
// together to match the existing enum for all interrupts
|
||||
boolean rising = (result & 0xFF) != 0;
|
||||
boolean falling = (result & 0xFF00) != 0;
|
||||
@@ -119,7 +119,7 @@ public class SynchronousInterrupt implements AutoCloseable {
|
||||
* Wait for an interrupt, ignoring any previously occurring interrupts.
|
||||
*
|
||||
* @param timeoutSeconds The timeout in seconds. 0 or less will return immediately.
|
||||
* @return Result of which edges were triggered, or if an timeout occurred.
|
||||
* @return Result of which edges were triggered, or if a timeout occurred.
|
||||
*/
|
||||
public WaitResult waitForInterrupt(double timeoutSeconds) {
|
||||
return waitForInterrupt(timeoutSeconds, true);
|
||||
|
||||
@@ -79,7 +79,7 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
/**
|
||||
* Initialize the Ultrasonic Sensor. This is the common code that initializes the ultrasonic
|
||||
* sensor given that there are two digital I/O channels allocated. If the system was running in
|
||||
* automatic mode (round robin) when the new sensor is added, it is stopped, the sensor is added,
|
||||
* automatic mode (round-robin) when the new sensor is added, it is stopped, the sensor is added,
|
||||
* then automatic mode is restored.
|
||||
*/
|
||||
private synchronized void initialize() {
|
||||
@@ -103,7 +103,7 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
m_counter.setMaxPeriod(1.0);
|
||||
m_counter.setSemiPeriodMode(true);
|
||||
m_counter.reset();
|
||||
m_enabled = true; // make it available for round robin scheduling
|
||||
m_enabled = true; // make it available for round-robin scheduling
|
||||
setAutomaticMode(originalMode);
|
||||
|
||||
m_instances++;
|
||||
@@ -116,7 +116,7 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of the Ultrasonic Sensor. This is designed to supchannel the Daventech SRF04
|
||||
* Create an instance of the Ultrasonic Sensor. This is designed to support the Daventech SRF04
|
||||
* and Vex ultrasonic sensors.
|
||||
*
|
||||
* @param pingChannel The digital output channel that sends the pulse to initiate the sensor
|
||||
@@ -153,7 +153,7 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
|
||||
/**
|
||||
* Destructor for the ultrasonic sensor. Delete the instance of the ultrasonic sensor by freeing
|
||||
* the allocated digital channels. If the system was in automatic mode (round robin), then it is
|
||||
* the allocated digital channels. If the system was in automatic mode (round-robin), then it is
|
||||
* stopped, then started again after this sensor is removed (provided this wasn't the last
|
||||
* sensor).
|
||||
*/
|
||||
@@ -194,10 +194,10 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
/**
|
||||
* Turn Automatic mode on/off for all sensors.
|
||||
*
|
||||
* <p>When in Automatic mode, all sensors will fire in round robin, waiting a set time between
|
||||
* <p>When in Automatic mode, all sensors will fire in round-robin, waiting a set time between
|
||||
* each sensor.
|
||||
*
|
||||
* @param enabling Set to true if round robin scheduling should start for all the ultrasonic
|
||||
* @param enabling Set to true if round-robin scheduling should start for all the ultrasonic
|
||||
* sensors. This scheduling method assures that the sensors are non-interfering because no two
|
||||
* sensors fire at the same time. If another scheduling algorithm is preferred, it can be
|
||||
* implemented by pinging the sensors manually and waiting for the results to come back.
|
||||
@@ -239,12 +239,12 @@ public class Ultrasonic implements Sendable, AutoCloseable {
|
||||
|
||||
/**
|
||||
* Single ping to ultrasonic sensor. Send out a single ping to the ultrasonic sensor. This only
|
||||
* works if automatic (round robin) mode is disabled. A single ping is sent out, and the counter
|
||||
* works if automatic (round-robin) mode is disabled. A single ping is sent out, and the counter
|
||||
* should count the semi-period when it comes in. The counter is reset to make the current value
|
||||
* invalid.
|
||||
*/
|
||||
public void ping() {
|
||||
setAutomaticMode(false); // turn off automatic round robin if pinging
|
||||
setAutomaticMode(false); // turn off automatic round-robin if pinging
|
||||
// single sensor
|
||||
m_counter.reset(); // reset the counter to zero (invalid data now)
|
||||
// do the ping to start getting a single range
|
||||
|
||||
@@ -72,7 +72,7 @@ public class ExternalDirectionCounter implements Sendable, AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets to revese the counter direction.
|
||||
* Sets to reverse the counter direction.
|
||||
*
|
||||
* @param reverseDirection True to reverse counting direction.
|
||||
*/
|
||||
|
||||
@@ -135,7 +135,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* Drive method for Mecanum platform.
|
||||
*
|
||||
* <p>Angles are measured counterclockwise from the positive X axis. The robot's speed is
|
||||
* independent from its angle or rotation rate.
|
||||
* independent of its angle or rotation rate.
|
||||
*
|
||||
* @param xSpeed The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
|
||||
* @param ySpeed The robot's speed along the Y axis [-1.0..1.0]. Left is positive.
|
||||
@@ -150,7 +150,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* Drive method for Mecanum platform.
|
||||
*
|
||||
* <p>Angles are measured counterclockwise from the positive X axis. The robot's speed is
|
||||
* independent from its angle or rotation rate.
|
||||
* independent of its angle or rotation rate.
|
||||
*
|
||||
* @param xSpeed The robot's speed along the Y axis [-1.0..1.0]. Forward is positive.
|
||||
* @param ySpeed The robot's speed along the X axis [-1.0..1.0]. Left is positive.
|
||||
@@ -183,7 +183,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* Drive method for Mecanum platform.
|
||||
*
|
||||
* <p>Angles are measured counterclockwise from straight ahead. The speed at which the robot
|
||||
* drives (translation) is independent from its angle or rotation rate.
|
||||
* drives (translation) is independent of its angle or rotation rate.
|
||||
*
|
||||
* @param magnitude The robot's speed at a given angle [-1.0..1.0]. Forward is positive.
|
||||
* @param angle The gyro heading around the Z axis at which the robot drives.
|
||||
@@ -204,7 +204,7 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
* Cartesian inverse kinematics for Mecanum platform.
|
||||
*
|
||||
* <p>Angles are measured counterclockwise from the positive X axis. The robot's speed is
|
||||
* independent from its angle or rotation rate.
|
||||
* independent of its angle or rotation rate.
|
||||
*
|
||||
* @param xSpeed The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
|
||||
* @param ySpeed The robot's speed along the Y axis [-1.0..1.0]. Left is positive.
|
||||
@@ -219,8 +219,8 @@ public class MecanumDrive extends RobotDriveBase implements Sendable, AutoClosea
|
||||
/**
|
||||
* Cartesian inverse kinematics for Mecanum platform.
|
||||
*
|
||||
* <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent
|
||||
* from its angle or rotation rate.
|
||||
* <p>Angles are measured clockwise from the positive X axis. The robot's speed is independent of
|
||||
* its angle or rotation rate.
|
||||
*
|
||||
* @param xSpeed The robot's speed along the X axis [-1.0..1.0]. Forward is positive.
|
||||
* @param ySpeed The robot's speed along the Y axis [-1.0..1.0]. Left is positive.
|
||||
|
||||
@@ -22,16 +22,16 @@ public interface Accelerometer {
|
||||
void setRange(Range range);
|
||||
|
||||
/**
|
||||
* Common interface for getting the x axis acceleration.
|
||||
* Common interface for getting the x-axis acceleration.
|
||||
*
|
||||
* @return The acceleration along the x axis in g-forces
|
||||
* @return The acceleration along the x-axis in g-forces
|
||||
*/
|
||||
double getX();
|
||||
|
||||
/**
|
||||
* Common interface for getting the y axis acceleration.
|
||||
* Common interface for getting the y-axis acceleration.
|
||||
*
|
||||
* @return The acceleration along the y axis in g-forces
|
||||
* @return The acceleration along the y-axis in g-forces
|
||||
*/
|
||||
double getY();
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public interface Gyro extends AutoCloseable {
|
||||
|
||||
/**
|
||||
* Reset the gyro. Resets the gyro to a heading of zero. This can be used if there is significant
|
||||
* drift in the gyro and it needs to be recalibrated after it has been running.
|
||||
* drift in the gyro, and it needs to be recalibrated after it has been running.
|
||||
*/
|
||||
void reset();
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public final class LiveWindow {
|
||||
*
|
||||
* <p>If it's being enabled, turn off the scheduler and remove all the commands from the queue and
|
||||
* enable all the components registered for LiveWindow. If it's being disabled, stop all the
|
||||
* registered components and reenable the scheduler.
|
||||
* registered components and re-enable the scheduler.
|
||||
*
|
||||
* <p>TODO: add code to disable PID loops when enabling LiveWindow. The commands should reenable
|
||||
* the PID loops themselves when they get rescheduled. This prevents arms from starting to move
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
utility functions like timing and field management. The library is designed
|
||||
to:
|
||||
<ul>
|
||||
<li>Deal with all the low level interfacing to these components so you
|
||||
<li>Deal with all the low level interfacing to these components, so you
|
||||
can concentrate on solving this year's "robot problem". This is a
|
||||
philosophical decision to let you focus on the higher-level design of
|
||||
your robot rather than deal with the details of the processor and the
|
||||
|
||||
@@ -473,7 +473,7 @@ public enum BuiltInWidgets implements WidgetType {
|
||||
*/
|
||||
kCameraStream("Camera Stream"),
|
||||
/**
|
||||
* Displays a field2d object.<br>
|
||||
* Displays a Field2d object.<br>
|
||||
* Supported types:
|
||||
*
|
||||
* <ul>
|
||||
|
||||
@@ -32,7 +32,7 @@ public class DIOSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs from an digital I/O channel number.
|
||||
* Constructs from a digital I/O channel number.
|
||||
*
|
||||
* @param channel Channel number
|
||||
*/
|
||||
|
||||
@@ -118,7 +118,7 @@ public class GenericHIDSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the type of an axis.
|
||||
* Set the type of the provided axis channel.
|
||||
*
|
||||
* @param axis the axis
|
||||
* @param type the type
|
||||
|
||||
@@ -69,7 +69,7 @@ public class PS4ControllerSim extends GenericHIDSim {
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the L2 axis axis value of the controller.
|
||||
* Change the L2 axis value of the controller.
|
||||
*
|
||||
* @param value the new value
|
||||
*/
|
||||
|
||||
@@ -64,7 +64,7 @@ public class FieldObject2d implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set multiple poses from an list of Pose objects. The total number of poses is limited to 85.
|
||||
* Set multiple poses from a list of Pose objects. The total number of poses is limited to 85.
|
||||
*
|
||||
* @param poses list of 2D poses
|
||||
*/
|
||||
@@ -77,7 +77,7 @@ public class FieldObject2d implements AutoCloseable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set multiple poses from an list of Pose objects. The total number of poses is limited to 85.
|
||||
* Set multiple poses from a list of Pose objects. The total number of poses is limited to 85.
|
||||
*
|
||||
* @param poses list of 2D poses
|
||||
*/
|
||||
|
||||
@@ -252,7 +252,7 @@ public class SendableBuilderImpl implements NTSendableBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a flag indicating if this sendable should be treated as an actuator. By default this flag
|
||||
* Set a flag indicating if this sendable should be treated as an actuator. By default, this flag
|
||||
* is false.
|
||||
*
|
||||
* @param value true if actuator, false if not
|
||||
|
||||
@@ -43,7 +43,7 @@ public class SendableChooser<V> implements NTSendable, AutoCloseable {
|
||||
private static final String OPTIONS = "options";
|
||||
/** The key for the instance number. */
|
||||
private static final String INSTANCE = ".instance";
|
||||
/** A map linking strings to the objects the represent. */
|
||||
/** A map linking strings to the objects they represent. */
|
||||
private final Map<String, V> m_map = new LinkedHashMap<>();
|
||||
|
||||
private String m_defaultChoice = "";
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class SmartDashboard {
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps the specified key (where the key is the name of the {@link Sendable} to the specified
|
||||
* Maps the specified key (where the key is the name of the {@link Sendable}) to the specified
|
||||
* value in this table. The value can be retrieved by calling the get method with a key that is
|
||||
* equal to the original key.
|
||||
*
|
||||
|
||||
@@ -37,7 +37,7 @@ class DriverStationSimTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testAutonomus() {
|
||||
void testAutonomous() {
|
||||
HAL.initialize(500, 0);
|
||||
DriverStationSim.resetData();
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
class RelaySimTest {
|
||||
@Test
|
||||
void testInitializationBidrectional() {
|
||||
void testInitializationBidirectional() {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
RelaySim sim = new RelaySim(0);
|
||||
|
||||
@@ -10,7 +10,7 @@ public final class Drake {
|
||||
private Drake() {}
|
||||
|
||||
/**
|
||||
* Solves the discrete alegebraic Riccati equation.
|
||||
* Solves the discrete algebraic Riccati equation.
|
||||
*
|
||||
* @param A System matrix.
|
||||
* @param B Input matrix.
|
||||
@@ -33,7 +33,7 @@ public final class Drake {
|
||||
}
|
||||
|
||||
/**
|
||||
* Solves the discrete alegebraic Riccati equation.
|
||||
* Solves the discrete algebraic Riccati equation.
|
||||
*
|
||||
* @param <States> Number of states.
|
||||
* @param <Inputs> Number of inputs.
|
||||
@@ -55,7 +55,7 @@ public final class Drake {
|
||||
}
|
||||
|
||||
/**
|
||||
* Solves the discrete alegebraic Riccati equation.
|
||||
* Solves the discrete algebraic Riccati equation.
|
||||
*
|
||||
* @param A System matrix.
|
||||
* @param B Input matrix.
|
||||
@@ -85,7 +85,7 @@ public final class Drake {
|
||||
}
|
||||
|
||||
/**
|
||||
* Solves the discrete alegebraic Riccati equation.
|
||||
* Solves the discrete algebraic Riccati equation.
|
||||
*
|
||||
* @param <States> Number of states.
|
||||
* @param <Inputs> Number of inputs.
|
||||
|
||||
@@ -573,10 +573,9 @@ public class Matrix<R extends Num, C extends Num> {
|
||||
* Decompose "this" matrix using Cholesky Decomposition. If the "this" matrix is zeros, it will
|
||||
* return the zero matrix.
|
||||
*
|
||||
* @param lowerTriangular Whether or not we want to decompose to the lower triangular Cholesky
|
||||
* matrix.
|
||||
* @param lowerTriangular Whether we want to decompose to the lower triangular Cholesky matrix.
|
||||
* @return The decomposed matrix.
|
||||
* @throws RuntimeException if the matrix could not be decomposed(ie. is not positive
|
||||
* @throws RuntimeException if the matrix could not be decomposed(i.e. is not positive
|
||||
* semidefinite).
|
||||
*/
|
||||
public Matrix<R, C> lltDecompose(boolean lowerTriangular) {
|
||||
@@ -670,10 +669,10 @@ public class Matrix<R extends Num, C extends Num> {
|
||||
* same symbolic meaning they both must be either Double.NaN, Double.POSITIVE_INFINITY, or
|
||||
* Double.NEGATIVE_INFINITY.
|
||||
*
|
||||
* <p>NOTE:It is recommend to use {@link Matrix#isEqual(Matrix, double)} over this method when
|
||||
* <p>NOTE:It is recommended to use {@link Matrix#isEqual(Matrix, double)} over this method when
|
||||
* checking if two matrices are equal as {@link Matrix#isEqual(Matrix, double)} will return false
|
||||
* if an element is uncountable. This method should only be used when uncountable elements need to
|
||||
* compared.
|
||||
* be compared.
|
||||
*
|
||||
* @param other The {@link Matrix} to check against this one.
|
||||
* @param tolerance The tolerance to check equality with.
|
||||
@@ -709,7 +708,7 @@ public class Matrix<R extends Num, C extends Num> {
|
||||
*
|
||||
* @param v Vector to use for the update.
|
||||
* @param sigma Sigma to use for the update.
|
||||
* @param lowerTriangular Whether or not this matrix is lower triangular.
|
||||
* @param lowerTriangular Whether this matrix is lower triangular.
|
||||
*/
|
||||
public void rankUpdate(Matrix<R, N1> v, double sigma, boolean lowerTriangular) {
|
||||
WPIMathJNI.rankUpdate(this.getData(), this.getNumRows(), v.getData(), sigma, lowerTriangular);
|
||||
|
||||
@@ -192,7 +192,7 @@ public final class SimpleMatrixUtils {
|
||||
*
|
||||
* @param src The matrix to decompose.
|
||||
* @return The decomposed matrix.
|
||||
* @throws RuntimeException if the matrix could not be decomposed (ie. is not positive
|
||||
* @throws RuntimeException if the matrix could not be decomposed (i.e. is not positive
|
||||
* semidefinite).
|
||||
*/
|
||||
public static SimpleMatrix lltDecompose(SimpleMatrix src) {
|
||||
@@ -206,7 +206,7 @@ public final class SimpleMatrixUtils {
|
||||
* @param src The matrix to decompose.
|
||||
* @param lowerTriangular if we want to decompose to the lower triangular Cholesky matrix.
|
||||
* @return The decomposed matrix.
|
||||
* @throws RuntimeException if the matrix could not be decomposed (ie. is not positive
|
||||
* @throws RuntimeException if the matrix could not be decomposed (i.e. is not positive
|
||||
* semidefinite).
|
||||
*/
|
||||
public static SimpleMatrix lltDecompose(SimpleMatrix src, boolean lowerTriangular) {
|
||||
|
||||
@@ -130,7 +130,7 @@ public final class WPIMathJNI {
|
||||
* matrix.
|
||||
*
|
||||
* @param mat Array of elements of the matrix to be updated.
|
||||
* @param lowerTriangular Whether or not mat is lower triangular.
|
||||
* @param lowerTriangular Whether mat is lower triangular.
|
||||
* @param rows How many rows there are.
|
||||
* @param vec Vector to use for the rank update.
|
||||
* @param sigma Sigma value to use for the rank update.
|
||||
|
||||
@@ -35,7 +35,7 @@ public class PIDController implements Sendable, AutoCloseable {
|
||||
|
||||
private double m_minimumInput;
|
||||
|
||||
// Do the endpoints wrap around? eg. Absolute encoder
|
||||
// Do the endpoints wrap around? e.g. Absolute encoder
|
||||
private boolean m_continuous;
|
||||
|
||||
// The error at the time of the most recent call to calculate()
|
||||
|
||||
@@ -297,7 +297,7 @@ public class ProfiledPIDController implements Sendable {
|
||||
*/
|
||||
public double calculate(double measurement) {
|
||||
if (m_controller.isContinuousInputEnabled()) {
|
||||
// Get error which is smallest distance between goal and measurement
|
||||
// Get error which is the smallest distance between goal and measurement
|
||||
double errorBound = (m_maximumInput - m_minimumInput) / 2.0;
|
||||
double goalMinDistance =
|
||||
MathUtil.inputModulus(m_goal.position - measurement, -errorBound, errorBound);
|
||||
|
||||
@@ -244,7 +244,7 @@ public class DifferentialDrivePoseEstimator {
|
||||
* don't use your own time source by calling {@link
|
||||
* DifferentialDrivePoseEstimator#updateWithTime(double,Rotation2d,double,double)}, then you
|
||||
* must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this timestamp is
|
||||
* the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This means that
|
||||
* the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}). This means that
|
||||
* you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your time source
|
||||
* in this case.
|
||||
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position
|
||||
|
||||
@@ -200,7 +200,7 @@ public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Output
|
||||
* Returns an element of the state estimate x-hat.
|
||||
*
|
||||
* @param row Row of x-hat.
|
||||
* @return the value of the state estimate x-hat at i.
|
||||
* @return the value of the state estimate x-hat at that row.
|
||||
*/
|
||||
@Override
|
||||
public double getXhat(int row) {
|
||||
@@ -249,7 +249,7 @@ public class ExtendedKalmanFilter<States extends Num, Inputs extends Num, Output
|
||||
* Project the model into the future with a new control input u.
|
||||
*
|
||||
* @param u New control input from controller.
|
||||
* @param f The function used to linearlize the model.
|
||||
* @param f The function used to linearize the model.
|
||||
* @param dtSeconds Timestep for prediction.
|
||||
*/
|
||||
public void predict(
|
||||
|
||||
@@ -169,7 +169,7 @@ public class KalmanFilter<States extends Num, Inputs extends Num, Outputs extend
|
||||
* Returns an element of the state estimate x-hat.
|
||||
*
|
||||
* @param row Row of x-hat.
|
||||
* @return the state estimate x-hat at i.
|
||||
* @return the state estimate x-hat at that row.
|
||||
*/
|
||||
public double getXhat(int row) {
|
||||
return m_xHat.get(row, 0);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class KalmanFilterLatencyCompensator<S extends Num, I extends Num, O exte
|
||||
* @param observer The observer.
|
||||
* @param u The input at the timestamp.
|
||||
* @param localY The local output at the timestamp
|
||||
* @param timestampSeconds The timesnap of the state.
|
||||
* @param timestampSeconds The timestamp of the state.
|
||||
*/
|
||||
public void addObserverState(
|
||||
KalmanTypeFilter<S, I, O> observer,
|
||||
@@ -117,7 +117,7 @@ public class KalmanFilterLatencyCompensator<S extends Num, I extends Num, O exte
|
||||
|
||||
// Index of snapshot taken before the global measurement. Since we already
|
||||
// handled the case where the index points to the first snapshot, this
|
||||
// computation is guaranteed to be nonnegative.
|
||||
// computation is guaranteed to be non-negative.
|
||||
int prevIdx = nextIdx - 1;
|
||||
|
||||
// Find the snapshot closest in time to global measurement
|
||||
|
||||
@@ -227,9 +227,9 @@ public class MecanumDrivePoseEstimator {
|
||||
* don't use your own time source by calling {@link
|
||||
* MecanumDrivePoseEstimator#updateWithTime(double,Rotation2d,MecanumDriveWheelPositions)},
|
||||
* then you must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this
|
||||
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This
|
||||
* means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your
|
||||
* time source in this case.
|
||||
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}).
|
||||
* This means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as
|
||||
* your time source in this case.
|
||||
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position
|
||||
* in meters, y position in meters, and heading in radians). Increase these numbers to trust
|
||||
* the vision pose measurement less.
|
||||
|
||||
@@ -72,7 +72,7 @@ public class MerweScaledSigmaPoints<S extends Num> {
|
||||
*
|
||||
* @param x An array of the means.
|
||||
* @param s Square-root covariance of the filter.
|
||||
* @return Two dimensional array of sigma points. Each column contains all of the sigmas for one
|
||||
* @return Two-dimensional array of sigma points. Each column contains all the sigmas for one
|
||||
* dimension in the problem space. Ordered by Xi_0, Xi_{1..n}, Xi_{n+1..2n}.
|
||||
*/
|
||||
public Matrix<S, ?> squareRootSigmaPoints(Matrix<S, N1> x, Matrix<S, S> s) {
|
||||
|
||||
@@ -228,9 +228,9 @@ public class SwerveDrivePoseEstimator {
|
||||
* don't use your own time source by calling {@link
|
||||
* SwerveDrivePoseEstimator#updateWithTime(double,Rotation2d,SwerveModulePosition[])}, then
|
||||
* you must use a timestamp with an epoch since FPGA startup (i.e., the epoch of this
|
||||
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}. This
|
||||
* means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as your
|
||||
* time source in this case.
|
||||
* timestamp is the same epoch as {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()}).
|
||||
* This means that you should use {@link edu.wpi.first.wpilibj.Timer#getFPGATimestamp()} as
|
||||
* your time source in this case.
|
||||
* @param visionMeasurementStdDevs Standard deviations of the vision pose measurement (x position
|
||||
* in meters, y position in meters, and heading in radians). Increase these numbers to trust
|
||||
* the vision pose measurement less.
|
||||
|
||||
@@ -284,7 +284,7 @@ public class UnscentedKalmanFilter<States extends Num, Inputs extends Num, Outpu
|
||||
* Returns an element of the state estimate x-hat.
|
||||
*
|
||||
* @param row Row of x-hat.
|
||||
* @return the value of the state estimate x-hat at i.
|
||||
* @return the value of the state estimate x-hat at 'i'.
|
||||
*/
|
||||
@Override
|
||||
public double getXhat(int row) {
|
||||
|
||||
@@ -167,7 +167,7 @@ public class LinearFilter {
|
||||
// [s₁ⁿ⁻¹ ⋯ sₙⁿ⁻¹][aₙ] [δₙ₋₁,d]
|
||||
//
|
||||
// where δᵢ,ⱼ are the Kronecker delta. The FIR gains are the elements of the
|
||||
// vector a in reverse order divided by hᵈ.
|
||||
// vector 'a' in reverse order divided by hᵈ.
|
||||
//
|
||||
// The order of accuracy of the approximation is of the form O(hⁿ⁻ᵈ).
|
||||
|
||||
|
||||
@@ -209,8 +209,8 @@ public class Pose2d implements Interpolatable<Pose2d> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Twist2d that maps this pose to the end pose. If c is the output of a.Log(b), then
|
||||
* a.Exp(c) would yield b.
|
||||
* Returns a Twist2d that maps this pose to the end pose. If c is the output of {@code a.Log(b)},
|
||||
* then {@code a.Exp(c)} would yield b.
|
||||
*
|
||||
* @param end The end pose for the transformation.
|
||||
* @return The twist that maps this to end.
|
||||
|
||||
@@ -233,8 +233,8 @@ public class Pose3d implements Interpolatable<Pose3d> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Twist3d that maps this pose to the end pose. If c is the output of a.Log(b), then
|
||||
* a.Exp(c) would yield b.
|
||||
* Returns a Twist3d that maps this pose to the end pose. If c is the output of {@code a.Log(b)},
|
||||
* then {@code a.Exp(c)} would yield b.
|
||||
*
|
||||
* @param end The end pose for the transformation.
|
||||
* @return The twist that maps this to end.
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A change in distance along a 2D arc since the last pose update. We can use ideas from
|
||||
* differential calculus to create new Pose2ds from a Twist2d and vise versa.
|
||||
* differential calculus to create new Pose2d objects from a Twist2d and vise versa.
|
||||
*
|
||||
* <p>A Twist can be used to represent a difference between two poses.
|
||||
*/
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.Objects;
|
||||
|
||||
/**
|
||||
* A change in distance along a 3D arc since the last pose update. We can use ideas from
|
||||
* differential calculus to create new Pose3ds from a Twist3d and vise versa.
|
||||
* differential calculus to create new Pose3d objects from a Twist3d and vise versa.
|
||||
*
|
||||
* <p>A Twist can be used to represent a difference between two poses.
|
||||
*/
|
||||
|
||||
@@ -16,8 +16,8 @@ import org.ejml.simple.SimpleMatrix;
|
||||
*
|
||||
* <p>The inverse kinematics (converting from a desired chassis velocity to individual wheel speeds)
|
||||
* uses the relative locations of the wheels with respect to the center of rotation. The center of
|
||||
* rotation for inverse kinematics is also variable. This means that you can set your set your
|
||||
* center of rotation in a corner of the robot to perform special evasion maneuvers.
|
||||
* rotation for inverse kinematics is also variable. This means that you can set your center of
|
||||
* rotation in a corner of the robot to perform special evasion maneuvers.
|
||||
*
|
||||
* <p>Forward kinematics (converting an array of wheel speeds into the overall chassis motion) is
|
||||
* performs the exact opposite of what inverse kinematics does. Since this is an overdetermined
|
||||
|
||||
@@ -19,8 +19,8 @@ import org.ejml.simple.SimpleMatrix;
|
||||
*
|
||||
* <p>The inverse kinematics (converting from a desired chassis velocity to individual module
|
||||
* states) uses the relative locations of the modules with respect to the center of rotation. The
|
||||
* center of rotation for inverse kinematics is also variable. This means that you can set your set
|
||||
* your center of rotation in a corner of the robot to perform special evasion maneuvers.
|
||||
* center of rotation for inverse kinematics is also variable. This means that you can set your
|
||||
* center of rotation in a corner of the robot to perform special evasion maneuvers.
|
||||
*
|
||||
* <p>Forward kinematics (converting an array of module states into the overall chassis motion) is
|
||||
* performs the exact opposite of what inverse kinematics does. Since this is an overdetermined
|
||||
@@ -44,9 +44,10 @@ public class SwerveDriveKinematics {
|
||||
|
||||
/**
|
||||
* Constructs a swerve drive kinematics object. This takes in a variable number of wheel locations
|
||||
* as Translation2ds. The order in which you pass in the wheel locations is the same order that
|
||||
* you will receive the module states when performing inverse kinematics. It is also expected that
|
||||
* you pass in the module states in the same order when calling the forward kinematics methods.
|
||||
* as Translation2d objects. The order in which you pass in the wheel locations is the same order
|
||||
* that you will receive the module states when performing inverse kinematics. It is also expected
|
||||
* that you pass in the module states in the same order when calling the forward kinematics
|
||||
* methods.
|
||||
*
|
||||
* @param wheelsMeters The locations of the wheels relative to the physical center of the robot.
|
||||
*/
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class Spline {
|
||||
}
|
||||
|
||||
// This simply multiplies by the coefficients. We need to divide out t some
|
||||
// n number of times where n is the derivative we want to take.
|
||||
// n number of times when n is the derivative we want to take.
|
||||
SimpleMatrix combined = coefficients.mult(polynomialBases);
|
||||
|
||||
// Get x and y
|
||||
|
||||
@@ -21,7 +21,7 @@ import org.ejml.simple.SimpleMatrix;
|
||||
*
|
||||
* <p>For everything in this file, "inputs" and "outputs" are defined from the perspective of the
|
||||
* plant. This means U is an input and Y is an output (because you give the plant U (powers) and it
|
||||
* gives you back a Y (sensor values). This is the opposite of what they mean from the perspective
|
||||
* gives you back a Y (sensor values)). This is the opposite of what they mean from the perspective
|
||||
* of the controller (U is an output because that's what goes to the motors and Y is an input
|
||||
* because that's what comes back from the sensors).
|
||||
*
|
||||
|
||||
@@ -111,7 +111,7 @@ public class DifferentialDriveVoltageConstraint implements TrajectoryConstraint
|
||||
/ 2);
|
||||
}
|
||||
|
||||
// When turning about a point inside of the wheelbase (i.e. radius less than half
|
||||
// When turning about a point inside the wheelbase (i.e. radius less than half
|
||||
// the trackwidth), the inner wheel's direction changes, but the magnitude remains
|
||||
// the same. The formula above changes sign for the inner wheel when this happens.
|
||||
// We can accurately account for this by simply negating the inner wheel.
|
||||
|
||||
@@ -47,7 +47,7 @@ class MecanumDriveOdometryTest {
|
||||
|
||||
@Test
|
||||
void testTwoIterations() {
|
||||
// 5 units/sec in the x axis (forward)
|
||||
// 5 units/sec in the x-axis (forward)
|
||||
final var wheelPositions = new MecanumDriveWheelPositions(0.3536, 0.3536, 0.3536, 0.3536);
|
||||
m_odometry.resetPosition(new Rotation2d(), new MecanumDriveWheelPositions(), new Pose2d());
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ class SwerveDriveKinematicsTest {
|
||||
the vx and vy of our chassis center. Because our COR is at a 45 degree angle from the center,
|
||||
we know that vx and vy must be the same. Furthermore, we know that the center of mass makes
|
||||
a full revolution about the center of revolution once every second. Therefore, the center of
|
||||
mass must be moving at 106.629in/sec. Recalling that the ratios of a 45/45/90 triagle are
|
||||
mass must be moving at 106.629in/sec. Recalling that the ratios of a 45/45/90 triangle are
|
||||
1:√(2)/2:√(2)/2, we find that the COM vx is -75.398, and vy is 75.398.
|
||||
*/
|
||||
|
||||
@@ -235,7 +235,7 @@ class SwerveDriveKinematicsTest {
|
||||
the vx and vy of our chassis center. Because our COR is at a 45 degree angle from the center,
|
||||
we know that vx and vy must be the same. Furthermore, we know that the center of mass makes
|
||||
a full revolution about the center of revolution once every second. Therefore, the center of
|
||||
mass must be moving at 106.629in/sec. Recalling that the ratios of a 45/45/90 triagle are
|
||||
mass must be moving at 106.629in/sec. Recalling that the ratios of a 45/45/90 triangle are
|
||||
1:√(2)/2:√(2)/2, we find that the COM vx is -75.398, and vy is 75.398.
|
||||
*/
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class SwerveDriveOdometryTest {
|
||||
|
||||
@Test
|
||||
void testTwoIterations() {
|
||||
// 5 units/sec in the x axis (forward)
|
||||
// 5 units/sec in the x-axis (forward)
|
||||
final SwerveModulePosition[] wheelDeltas = {
|
||||
new SwerveModulePosition(0.5, Rotation2d.fromDegrees(0)),
|
||||
new SwerveModulePosition(0.5, Rotation2d.fromDegrees(0)),
|
||||
|
||||
@@ -21,7 +21,7 @@ public final class RuntimeLoader<T> {
|
||||
private static String defaultExtractionRoot;
|
||||
|
||||
/**
|
||||
* Gets the default extration root location (~/.wpilib/nativecache).
|
||||
* Gets the default extraction root location (~/.wpilib/nativecache).
|
||||
*
|
||||
* @return The default extraction root location.
|
||||
*/
|
||||
@@ -87,20 +87,20 @@ public final class RuntimeLoader<T> {
|
||||
} catch (UnsatisfiedLinkError ule) {
|
||||
// Then load the hash from the resources
|
||||
String hashName = RuntimeDetector.getHashLibraryResource(m_libraryName);
|
||||
String resname = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String resName = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
try (InputStream hashIs = m_loadClass.getResourceAsStream(hashName)) {
|
||||
if (hashIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
try (Scanner scanner = new Scanner(hashIs, StandardCharsets.UTF_8.name())) {
|
||||
String hash = scanner.nextLine();
|
||||
File jniLibrary = new File(m_extractionRoot, resname + "." + hash);
|
||||
File jniLibrary = new File(m_extractionRoot, resName + "." + hash);
|
||||
try {
|
||||
// Try to load from an already extracted hash
|
||||
System.load(jniLibrary.getAbsolutePath());
|
||||
} catch (UnsatisfiedLinkError ule2) {
|
||||
// If extraction failed, extract
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
@@ -137,9 +137,9 @@ public final class RuntimeLoader<T> {
|
||||
System.loadLibrary(m_libraryName);
|
||||
} catch (UnsatisfiedLinkError ule) {
|
||||
// Then load the hash from the input file
|
||||
String resname = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String resName = RuntimeDetector.getLibraryResource(m_libraryName);
|
||||
String hash;
|
||||
try (InputStream is = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream is = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (is == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
@@ -165,13 +165,13 @@ public final class RuntimeLoader<T> {
|
||||
if (hash == null) {
|
||||
throw new IOException("Weird Hash?");
|
||||
}
|
||||
File jniLibrary = new File(m_extractionRoot, resname + "." + hash);
|
||||
File jniLibrary = new File(m_extractionRoot, resName + "." + hash);
|
||||
try {
|
||||
// Try to load from an already extracted hash
|
||||
System.load(jniLibrary.getAbsolutePath());
|
||||
} catch (UnsatisfiedLinkError ule2) {
|
||||
// If extraction failed, extract
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resname)) {
|
||||
try (InputStream resIs = m_loadClass.getResourceAsStream(resName)) {
|
||||
if (resIs == null) {
|
||||
throw new IOException(getLoadErrorMessage(ule));
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class WPIUtilJNI {
|
||||
public static native boolean releaseSemaphore(int semHandle, int releaseCount);
|
||||
|
||||
/**
|
||||
* Waits for an handle to be signaled.
|
||||
* Waits for a handle to be signaled.
|
||||
*
|
||||
* @param handle handle to wait on
|
||||
* @throws InterruptedException on failure (e.g. object was destroyed)
|
||||
@@ -89,7 +89,7 @@ public class WPIUtilJNI {
|
||||
public static native void waitForObject(int handle) throws InterruptedException;
|
||||
|
||||
/**
|
||||
* Waits for an handle to be signaled, with timeout.
|
||||
* Waits for a handle to be signaled, with timeout.
|
||||
*
|
||||
* @param handle handle to wait on
|
||||
* @param timeout timeout in seconds
|
||||
|
||||
@@ -18,7 +18,7 @@ public final class Semaphore implements AutoCloseable {
|
||||
* Constructor.
|
||||
*
|
||||
* @param initialCount initial value for the semaphore's internal counter
|
||||
* @param maximumCount maximum value for the samephore's internal counter
|
||||
* @param maximumCount maximum value for the semaphore's internal counter
|
||||
*/
|
||||
public Semaphore(int initialCount, int maximumCount) {
|
||||
m_handle = WPIUtilJNI.createSemaphore(initialCount, maximumCount);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BooleanArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(boolean[] value, long timestamp) {
|
||||
m_log.appendBooleanArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BooleanLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(boolean value, long timestamp) {
|
||||
m_log.appendBoolean(m_entry, value, timestamp);
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class DataLog implements AutoCloseable {
|
||||
* @param name Name
|
||||
* @param type Data type
|
||||
* @param metadata Initial metadata (e.g. data properties)
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
* @return Entry index
|
||||
*/
|
||||
public int start(String name, String type, String metadata, long timestamp) {
|
||||
@@ -151,7 +151,7 @@ public final class DataLog implements AutoCloseable {
|
||||
* Finish an entry.
|
||||
*
|
||||
* @param entry Entry index
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void finish(int entry, long timestamp) {
|
||||
DataLogJNI.finish(m_impl, entry, timestamp);
|
||||
@@ -171,7 +171,7 @@ public final class DataLog implements AutoCloseable {
|
||||
*
|
||||
* @param entry Entry index
|
||||
* @param metadata New metadata for the entry
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void setMetadata(int entry, String metadata, long timestamp) {
|
||||
DataLogJNI.setMetadata(m_impl, entry, metadata, timestamp);
|
||||
@@ -192,7 +192,7 @@ public final class DataLog implements AutoCloseable {
|
||||
*
|
||||
* @param entry Entry index, as returned by Start()
|
||||
* @param data Data to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void appendRaw(int entry, byte[] data, long timestamp) {
|
||||
DataLogJNI.appendRaw(m_impl, entry, data, timestamp);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class DataLogEntry {
|
||||
* Updates the metadata for the entry.
|
||||
*
|
||||
* @param metadata New metadata for the entry
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void setMetadata(String metadata, long timestamp) {
|
||||
m_log.setMetadata(m_entry, metadata, timestamp);
|
||||
@@ -41,7 +41,7 @@ public class DataLogEntry {
|
||||
/**
|
||||
* Finishes the entry.
|
||||
*
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void finish(long timestamp) {
|
||||
m_log.finish(m_entry, timestamp);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class DataLogReader implements Iterable<DataLogRecord> {
|
||||
* Constructs from a file.
|
||||
*
|
||||
* @param filename filename
|
||||
* @throws IOException if could not open/read file
|
||||
* @throws IOException if unable to open/read file
|
||||
*/
|
||||
public DataLogReader(String filename) throws IOException {
|
||||
RandomAccessFile f = new RandomAccessFile(filename, "r");
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DoubleArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(double[] value, long timestamp) {
|
||||
m_log.appendDoubleArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class DoubleLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(double value, long timestamp) {
|
||||
m_log.appendDouble(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FloatArrayLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(float[] value, long timestamp) {
|
||||
m_log.appendFloatArray(m_entry, value, timestamp);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class FloatLogEntry extends DataLogEntry {
|
||||
* Appends a record to the log.
|
||||
*
|
||||
* @param value Value to record
|
||||
* @param timestamp Time stamp (may be 0 to indicate now)
|
||||
* @param timestamp Time stamp (0 to indicate now)
|
||||
*/
|
||||
public void append(float value, long timestamp) {
|
||||
m_log.appendFloat(m_entry, value, timestamp);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user