mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[docs] Fix Doxygen warnings, add CI docs lint job (#3639)
The CI docs lint build is configured to fail on Doxygen warnings.
This commit is contained in:
@@ -140,7 +140,7 @@ class AddressableLED {
|
||||
* <p>The sync time is the time to hold output so LEDs enable. Default set for
|
||||
* WS2812.
|
||||
*
|
||||
* @param syncTimeMicroSeconds the sync time
|
||||
* @param syncTime the sync time
|
||||
*/
|
||||
void SetSyncTime(units::microsecond_t syncTime);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class AnalogGyro : public Gyro,
|
||||
explicit AnalogGyro(int channel);
|
||||
|
||||
/**
|
||||
* @Gyro constructor with a precreated AnalogInput object.
|
||||
* Gyro constructor with a precreated AnalogInput object.
|
||||
*
|
||||
* Use this constructor when the analog channel needs to be shared.
|
||||
* This object will not clean up the AnalogInput object when using this
|
||||
|
||||
@@ -198,8 +198,7 @@ class AnalogInput : public wpi::Sendable,
|
||||
*
|
||||
* This will be added to all values returned to the user.
|
||||
*
|
||||
* @param initialValue The value that the accumulator should start from when
|
||||
* reset.
|
||||
* @param value The value that the accumulator should start from when reset.
|
||||
*/
|
||||
void SetAccumulatorInitialValue(int64_t value);
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class AnalogPotentiometer : public wpi::Sendable,
|
||||
* This will calculate the result from the fullRange times the fraction of the
|
||||
* supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The existing Analog Input pointer
|
||||
* @param input The existing Analog Input pointer
|
||||
* @param fullRange The value (in desired units) representing the full
|
||||
* 0-5V range of the input.
|
||||
* @param offset The value (in desired units) representing the
|
||||
@@ -80,7 +80,7 @@ class AnalogPotentiometer : public wpi::Sendable,
|
||||
* This will calculate the result from the fullRange times the fraction of the
|
||||
* supply voltage, plus the offset.
|
||||
*
|
||||
* @param channel The existing Analog Input pointer
|
||||
* @param input The existing Analog Input pointer
|
||||
* @param fullRange The value (in desired units) representing the full
|
||||
* 0-5V range of the input.
|
||||
* @param offset The value (in desired units) representing the
|
||||
|
||||
@@ -36,14 +36,14 @@ class AnalogTrigger : public wpi::Sendable,
|
||||
* This should be used in the case of sharing an analog channel between the
|
||||
* trigger and an analog input object.
|
||||
*
|
||||
* @param channel The pointer to the existing AnalogInput object
|
||||
* @param input The pointer to the existing AnalogInput object
|
||||
*/
|
||||
explicit AnalogTrigger(AnalogInput* channel);
|
||||
explicit AnalogTrigger(AnalogInput* input);
|
||||
|
||||
/**
|
||||
* Construct an analog trigger given a duty cycle input.
|
||||
*
|
||||
* @param channel The pointer to the existing DutyCycle object
|
||||
* @param dutyCycle The pointer to the existing DutyCycle object
|
||||
*/
|
||||
explicit AnalogTrigger(DutyCycle* dutyCycle);
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ class Debouncer {
|
||||
/**
|
||||
* Creates a new Debouncer.
|
||||
*
|
||||
* @param debounce The number of seconds the value must change from
|
||||
* baseline for the filtered value to change.
|
||||
* @param type Which type of state change the debouncing will be performed
|
||||
* on.
|
||||
* @param debounceTime The number of seconds the value must change from
|
||||
* baseline for the filtered value to change.
|
||||
* @param type Which type of state change the debouncing will be
|
||||
* performed on.
|
||||
*/
|
||||
explicit Debouncer(units::second_t debounceTime,
|
||||
DebounceType type = DebounceType::kRising);
|
||||
|
||||
@@ -139,6 +139,7 @@ class DriverStation {
|
||||
* Returns the types of Axes on a given joystick port.
|
||||
*
|
||||
* @param stick The joystick port number and the target axis
|
||||
* @param axis The analog axis value to read from the joystick.
|
||||
* @return What type of axis the axis is reporting to be
|
||||
*/
|
||||
static int GetJoystickAxisType(int stick, int axis);
|
||||
|
||||
@@ -58,21 +58,21 @@ class DutyCycleEncoder : public wpi::Sendable,
|
||||
/**
|
||||
* Construct a new DutyCycleEncoder attached to a DigitalSource object.
|
||||
*
|
||||
* @param source the digital source to attach to
|
||||
* @param digitalSource the digital source to attach to
|
||||
*/
|
||||
explicit DutyCycleEncoder(DigitalSource& digitalSource);
|
||||
|
||||
/**
|
||||
* Construct a new DutyCycleEncoder attached to a DigitalSource object.
|
||||
*
|
||||
* @param source the digital source to attach to
|
||||
* @param digitalSource the digital source to attach to
|
||||
*/
|
||||
explicit DutyCycleEncoder(DigitalSource* digitalSource);
|
||||
|
||||
/**
|
||||
* Construct a new DutyCycleEncoder attached to a DigitalSource object.
|
||||
*
|
||||
* @param source the digital source to attach to
|
||||
* @param digitalSource the digital source to attach to
|
||||
*/
|
||||
explicit DutyCycleEncoder(std::shared_ptr<DigitalSource> digitalSource);
|
||||
|
||||
|
||||
@@ -325,8 +325,8 @@ class Encoder : public CounterBase,
|
||||
*
|
||||
* When this source is activated, the encoder count automatically resets.
|
||||
*
|
||||
* @param channel A digital source to set as the encoder index
|
||||
* @param type The state that will cause the encoder to reset
|
||||
* @param source A digital source to set as the encoder index
|
||||
* @param type The state that will cause the encoder to reset
|
||||
*/
|
||||
void SetIndexSource(const DigitalSource& source,
|
||||
IndexingType type = kResetOnRisingEdge);
|
||||
|
||||
@@ -52,12 +52,12 @@ const char* GetErrorMessage(int32_t* code);
|
||||
* Reports an error to the driver station (using HAL_SendError).
|
||||
* Generally the FRC_ReportError wrapper macro should be used instead.
|
||||
*
|
||||
* @param status error code
|
||||
* @param fileName source file name
|
||||
* @param lineNumber source line number
|
||||
* @param funcName source function name
|
||||
* @param format error message format
|
||||
* @param args error message format args
|
||||
* @param[out] status error code
|
||||
* @param[in] fileName source file name
|
||||
* @param[in] lineNumber source line number
|
||||
* @param[in] funcName source function name
|
||||
* @param[in] format error message format
|
||||
* @param[in] args error message format args
|
||||
*/
|
||||
void ReportErrorV(int32_t status, const char* fileName, int lineNumber,
|
||||
const char* funcName, fmt::string_view format,
|
||||
@@ -67,12 +67,12 @@ void ReportErrorV(int32_t status, const char* fileName, int lineNumber,
|
||||
* Reports an error to the driver station (using HAL_SendError).
|
||||
* Generally the FRC_ReportError wrapper macro should be used instead.
|
||||
*
|
||||
* @param status error code
|
||||
* @param fileName source file name
|
||||
* @param lineNumber source line number
|
||||
* @param funcName source function name
|
||||
* @param format error message format
|
||||
* @param args error message format args
|
||||
* @param[out] status error code
|
||||
* @param[in] fileName source file name
|
||||
* @param[in] lineNumber source line number
|
||||
* @param[in] funcName source function name
|
||||
* @param[in] format error message format
|
||||
* @param[in] args error message format args
|
||||
*/
|
||||
template <typename S, typename... Args>
|
||||
inline void ReportError(int32_t status, const char* fileName, int lineNumber,
|
||||
@@ -86,11 +86,11 @@ inline void ReportError(int32_t status, const char* fileName, int lineNumber,
|
||||
* by the caller. Generally the FRC_MakeError wrapper macro should be used
|
||||
* instead.
|
||||
*
|
||||
* @param status error code
|
||||
* @param message error message details
|
||||
* @param fileName source file name
|
||||
* @param lineNumber source line number
|
||||
* @param funcName source function name
|
||||
* @param[out] status error code
|
||||
* @param[in] message error message details
|
||||
* @param[in] fileName source file name
|
||||
* @param[in] lineNumber source line number
|
||||
* @param[in] funcName source function name
|
||||
* @return runtime error object
|
||||
*/
|
||||
[[nodiscard]] RuntimeError MakeErrorV(int32_t status, const char* fileName,
|
||||
@@ -124,8 +124,8 @@ namespace warn {
|
||||
/**
|
||||
* Reports an error to the driver station (using HAL_SendError).
|
||||
*
|
||||
* @param status error code
|
||||
* @param format error message format
|
||||
* @param[out] status error code
|
||||
* @param[in] format error message format
|
||||
*/
|
||||
#define FRC_ReportError(status, format, ...) \
|
||||
do { \
|
||||
@@ -139,8 +139,8 @@ namespace warn {
|
||||
* Makes a runtime error exception object. This object should be thrown
|
||||
* by the caller.
|
||||
*
|
||||
* @param status error code
|
||||
* @param format error message format
|
||||
* @param[out] status error code
|
||||
* @param[in] format error message format
|
||||
* @return runtime error object
|
||||
*/
|
||||
#define FRC_MakeError(status, format, ...) \
|
||||
@@ -151,8 +151,8 @@ namespace warn {
|
||||
* Checks a status code and depending on its value, either throws a
|
||||
* RuntimeError exception, calls ReportError, or does nothing (if no error).
|
||||
*
|
||||
* @param status error code
|
||||
* @param format error message format
|
||||
* @param[out] status error code
|
||||
* @param[in] format error message format
|
||||
*/
|
||||
#define FRC_CheckErrorStatus(status, format, ...) \
|
||||
do { \
|
||||
|
||||
@@ -98,7 +98,7 @@ class I2C {
|
||||
*
|
||||
* @param registerAddress The register to read first in the transaction.
|
||||
* @param count The number of bytes to read in the transaction.
|
||||
* @param buffer A pointer to the array of bytes to store the data
|
||||
* @param data A pointer to the array of bytes to store the data
|
||||
* read from the device.
|
||||
* @return Transfer Aborted... false for success, true for aborted.
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,6 @@ class Joystick : public GenericHID {
|
||||
/**
|
||||
* Set the channel associated with the Y axis.
|
||||
*
|
||||
* @param axis The axis to set the channel for.
|
||||
* @param channel The channel to set the axis to.
|
||||
*/
|
||||
void SetYChannel(int channel);
|
||||
@@ -62,7 +61,6 @@ class Joystick : public GenericHID {
|
||||
/**
|
||||
* Set the channel associated with the Z axis.
|
||||
*
|
||||
* @param axis The axis to set the channel for.
|
||||
* @param channel The channel to set the axis to.
|
||||
*/
|
||||
void SetZChannel(int channel);
|
||||
@@ -70,7 +68,6 @@ class Joystick : public GenericHID {
|
||||
/**
|
||||
* Set the channel associated with the twist axis.
|
||||
*
|
||||
* @param axis The axis to set the channel for.
|
||||
* @param channel The channel to set the axis to.
|
||||
*/
|
||||
void SetTwistChannel(int channel);
|
||||
@@ -78,7 +75,6 @@ class Joystick : public GenericHID {
|
||||
/**
|
||||
* Set the channel associated with the throttle axis.
|
||||
*
|
||||
* @param axis The axis to set the channel for.
|
||||
* @param channel The channel to set the axis to.
|
||||
*/
|
||||
void SetThrottleChannel(int channel);
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace frc {
|
||||
*
|
||||
* This class is thread safe.
|
||||
*
|
||||
* This will also interact with {@link NetworkTable} by creating a table called
|
||||
* This will also interact with NetworkTable by creating a table called
|
||||
* "Preferences" with all the key-value pairs.
|
||||
*/
|
||||
class Preferences {
|
||||
|
||||
@@ -135,10 +135,12 @@ class SPI {
|
||||
* If the receive FIFO is empty, there is no active transfer, and initiate
|
||||
* is false, errors.
|
||||
*
|
||||
* @param initiate If true, this function pushes "0" into the transmit buffer
|
||||
* and initiates a transfer. If false, this function assumes
|
||||
* that data is already in the receive FIFO from a previous
|
||||
* write.
|
||||
* @param initiate If true, this function pushes "0" into the transmit
|
||||
* buffer and initiates a transfer. If false, this
|
||||
* function assumes that data is already in the receive
|
||||
* FIFO from a previous write.
|
||||
* @param dataReceived Buffer to receive data from the device
|
||||
* @param size The length of the transaction, in bytes
|
||||
*/
|
||||
virtual int Read(bool initiate, uint8_t* dataReceived, int size);
|
||||
|
||||
@@ -268,17 +270,17 @@ class SPI {
|
||||
/**
|
||||
* Initialize the accumulator.
|
||||
*
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xferSize SPI transfer size, in bytes
|
||||
* @param validMask Mask to apply to received data for validity checking
|
||||
* @param validData After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param dataShift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param dataSize Size (in bits) of data field
|
||||
* @param isSigned Is data field signed?
|
||||
* @param bigEndian Is device big endian?
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xferSize SPI transfer size, in bytes
|
||||
* @param validMask Mask to apply to received data for validity checking
|
||||
* @param validValue After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param dataShift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param dataSize Size (in bits) of data field
|
||||
* @param isSigned Is data field signed?
|
||||
* @param bigEndian Is device big endian?
|
||||
*/
|
||||
void InitAccumulator(units::second_t period, int cmd, int xferSize,
|
||||
int validMask, int validValue, int dataShift,
|
||||
@@ -292,17 +294,17 @@ class SPI {
|
||||
* --> xferSize, int validMask, int validValue, int dataShift, <!--
|
||||
* --> int dataSize, bool isSigned, bool bigEndian)
|
||||
*
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xferSize SPI transfer size, in bytes
|
||||
* @param validMask Mask to apply to received data for validity checking
|
||||
* @param validData After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param dataShift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param dataSize Size (in bits) of data field
|
||||
* @param isSigned Is data field signed?
|
||||
* @param bigEndian Is device big endian?
|
||||
* @param period Time between reads
|
||||
* @param cmd SPI command to send to request data
|
||||
* @param xferSize SPI transfer size, in bytes
|
||||
* @param validMask Mask to apply to received data for validity checking
|
||||
* @param validValue After valid_mask is applied, required matching value for
|
||||
* validity checking
|
||||
* @param dataShift Bit shift to apply to received data to get actual data
|
||||
* value
|
||||
* @param dataSize Size (in bits) of data field
|
||||
* @param isSigned Is data field signed?
|
||||
* @param bigEndian Is device big endian?
|
||||
*/
|
||||
WPI_DEPRECATED("Use InitAccumulator with unit-safety instead")
|
||||
void InitAccumulator(double period, int cmd, int xferSize, int validMask,
|
||||
|
||||
@@ -64,7 +64,7 @@ class Servo : public PWM {
|
||||
* X being set and angles of more than Y degrees result in an angle of Y being
|
||||
* set.
|
||||
*
|
||||
* @param degrees The angle in degrees to set the servo.
|
||||
* @param angle The angle in degrees to set the servo.
|
||||
*/
|
||||
void SetAngle(double angle);
|
||||
|
||||
|
||||
@@ -91,8 +91,7 @@ class Solenoid : public wpi::Sendable, public wpi::SendableHelper<Solenoid> {
|
||||
* the startPulse method to allow the PCM to control the timing of a pulse.
|
||||
* The timing can be controlled in 0.01 second increments.
|
||||
*
|
||||
* @param durationSeconds The duration of the pulse, from 0.01 to 2.55
|
||||
* seconds.
|
||||
* @param duration The duration of the pulse, from 0.01 to 2.55 seconds.
|
||||
*
|
||||
* @see startPulse()
|
||||
*/
|
||||
|
||||
@@ -89,8 +89,8 @@ class Timer {
|
||||
/**
|
||||
* Check if the period specified has passed.
|
||||
*
|
||||
* @param seconds The period to check.
|
||||
* @return True if the period has passed.
|
||||
* @param period The period to check.
|
||||
* @return True if the period has passed.
|
||||
*/
|
||||
bool HasElapsed(units::second_t period) const;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class RobotDriveBase : public MotorSafety {
|
||||
* @deprecated Use ApplyDeadband() in frc/MathUtil.h.
|
||||
*/
|
||||
WPI_DEPRECATED("Use ApplyDeadband() in frc/MathUtil.h")
|
||||
static double ApplyDeadband(double number, double deadband);
|
||||
static double ApplyDeadband(double value, double deadband);
|
||||
|
||||
/**
|
||||
* Normalize all wheel speeds if the magnitude of any wheel is greater than
|
||||
|
||||
@@ -48,14 +48,14 @@ class LiveWindow {
|
||||
/**
|
||||
* Enable telemetry for a single component.
|
||||
*
|
||||
* @param sendable component
|
||||
* @param component sendable
|
||||
*/
|
||||
static void EnableTelemetry(wpi::Sendable* component);
|
||||
|
||||
/**
|
||||
* Disable telemetry for a single component.
|
||||
*
|
||||
* @param sendable component
|
||||
* @param component sendable
|
||||
*/
|
||||
static void DisableTelemetry(wpi::Sendable* component);
|
||||
|
||||
|
||||
@@ -36,14 +36,14 @@ class PWMMotorController : public MotorController,
|
||||
* The PWM value is set using a range of -1.0 to 1.0, appropriately scaling
|
||||
* the value for the FPGA.
|
||||
*
|
||||
* @param speed The speed value between -1.0 and 1.0 to set.
|
||||
* @param value The speed value between -1.0 and 1.0 to set.
|
||||
*/
|
||||
void Set(double value) override;
|
||||
|
||||
/**
|
||||
* Get the recently set value of the PWM. This value is affected by the
|
||||
* inversion property. If you want the value that is sent directly to the
|
||||
* MotorController, use {@link PWM#getSpeed()} instead.
|
||||
* MotorController, use PWM::GetSpeed() instead.
|
||||
*
|
||||
* @return The most recently set value for the PWM between -1.0 and 1.0.
|
||||
*/
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace frc {
|
||||
class ShuffleboardContainer;
|
||||
|
||||
/**
|
||||
* A Shuffleboard widget that handles a {@link Sendable} object such as a speed
|
||||
* A Shuffleboard widget that handles a Sendable object such as a speed
|
||||
* controller or sensor.
|
||||
*/
|
||||
class ComplexWidget final : public ShuffleboardWidget<ComplexWidget> {
|
||||
|
||||
@@ -147,7 +147,7 @@ class Shuffleboard final {
|
||||
* Clears the custom name format for recording files. New recordings will use
|
||||
* the default format.
|
||||
*
|
||||
* @see #setRecordingFileNameFormat(String)
|
||||
* @see SetRecordingFileNameFormat(std::string_view)
|
||||
*/
|
||||
static void ClearRecordingFileNameFormat();
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* Gets the layout with the given type and title, creating it if it does not
|
||||
* already exist at the time this method is called.
|
||||
*
|
||||
* @param title the title of the layout
|
||||
* @param layoutType the type of the layout, eg "List" or "Grid"
|
||||
* @param title the title of the layout
|
||||
* @param type the type of the layout, eg "List" or "Grid"
|
||||
* @return the layout
|
||||
*/
|
||||
ShuffleboardLayout& GetLayout(std::string_view title, BuiltInLayouts type);
|
||||
@@ -67,8 +67,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* Gets the layout with the given type and title, creating it if it does not
|
||||
* already exist at the time this method is called.
|
||||
*
|
||||
* @param title the title of the layout
|
||||
* @param layoutType the type of the layout, eg "List" or "Grid"
|
||||
* @param title the title of the layout
|
||||
* @param type the type of the layout, eg "List" or "Grid"
|
||||
* @return the layout
|
||||
*/
|
||||
ShuffleboardLayout& GetLayout(std::string_view title, const LayoutType& type);
|
||||
@@ -78,13 +78,13 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* already exist at the time this method is called. Note: this method should
|
||||
* only be used to use a layout type that is not already built into
|
||||
* Shuffleboard. To use a layout built into Shuffleboard, use
|
||||
* {@link #GetLayout(String, LayoutType)} and the layouts in {@link
|
||||
* BuiltInLayouts}.
|
||||
* GetLayout(std::string_view, const LayoutType&) and the layouts in
|
||||
* BuiltInLayouts.
|
||||
*
|
||||
* @param title the title of the layout
|
||||
* @param type the type of the layout, eg "List Layout" or "Grid Layout"
|
||||
* @return the layout
|
||||
* @see #GetLayout(String, LayoutType)
|
||||
* @see GetLayout(std::string_view, const LayoutType&)
|
||||
*/
|
||||
ShuffleboardLayout& GetLayout(std::string_view title, std::string_view type);
|
||||
|
||||
@@ -156,7 +156,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, std::shared_ptr<nt::Value>)
|
||||
* Add(std::string_view title, std::shared_ptr<nt::Value> defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title,
|
||||
std::shared_ptr<nt::Value> defaultValue);
|
||||
@@ -169,7 +170,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, bool)
|
||||
* Add(std::string_view title, bool defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, bool defaultValue);
|
||||
|
||||
@@ -181,7 +183,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, double)
|
||||
* Add(std::string_view title, double defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, double defaultValue);
|
||||
|
||||
@@ -193,7 +196,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, int)
|
||||
* Add(std::string_view title, int defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, int defaultValue);
|
||||
|
||||
@@ -205,7 +209,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, std::string_view)
|
||||
* Add(std::string_view title, std::string_view defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, std::string_view defaultValue);
|
||||
|
||||
@@ -217,7 +222,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, const char*)
|
||||
* Add(std::string_view title, const char* defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, const char* defaultValue);
|
||||
|
||||
@@ -229,7 +235,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, wpi::span<const bool>)
|
||||
* Add(std::string_view title, wpi::span<const bool> defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title, wpi::span<const bool> defaultValue);
|
||||
|
||||
@@ -241,7 +248,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, wpi::span<const double>)
|
||||
* Add(std::string_view title, wpi::span<const double> defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title,
|
||||
wpi::span<const double> defaultValue);
|
||||
@@ -254,7 +262,8 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* @return a widget to display the sendable data
|
||||
* @throws IllegalArgumentException if a widget already exists in this
|
||||
* container with the given title
|
||||
* @see #addPersistent(String, Object) add(String title, Object defaultValue)
|
||||
* @see AddPersistent(std::string_view, wpi::span<const std::string>)
|
||||
* Add(std::string_view title, wpi::span<const std::string> defaultValue)
|
||||
*/
|
||||
SimpleWidget& Add(std::string_view title,
|
||||
wpi::span<const std::string> defaultValue);
|
||||
@@ -266,7 +275,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<std::string>& AddString(
|
||||
@@ -279,7 +288,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<double>& AddNumber(std::string_view title,
|
||||
@@ -292,7 +301,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<bool>& AddBoolean(std::string_view title,
|
||||
@@ -305,7 +314,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<std::vector<std::string>>& AddStringArray(
|
||||
@@ -319,7 +328,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<std::vector<double>>& AddNumberArray(
|
||||
@@ -332,7 +341,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<std::vector<int>>& AddBooleanArray(
|
||||
@@ -345,7 +354,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
* supplier.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param valueSupplier the supplier for values
|
||||
* @param supplier the supplier for values
|
||||
* @return a widget to display data
|
||||
*/
|
||||
SuppliedValueWidget<std::string_view>& AddRaw(
|
||||
@@ -354,14 +363,15 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, std::shared_ptr<nt::Value>), the value in the
|
||||
* widget will be saved on the robot and will be used when the robot program
|
||||
* next starts rather than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(stdd::string_view, std::shared_ptr<nt::Value>)
|
||||
* Add(std::string_view title, std::shared_ptr<nt::Value> defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title,
|
||||
std::shared_ptr<nt::Value> defaultValue);
|
||||
@@ -369,56 +379,60 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* Unlike Add(std::string_view, bool), the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, bool)
|
||||
* Add(std::string_view title, bool defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title, bool defaultValue);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* Unlike Add(std::string_view, double), the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, double)
|
||||
* Add(std::string_view title, double defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title, double defaultValue);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, int), the value in the widget will be saved on
|
||||
* the robot and will be used when the robot program next starts rather than
|
||||
* {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std:string_view, int)
|
||||
* Add(std::string_view title, int defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title, int defaultValue);
|
||||
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, std::string_view), the value in the widget
|
||||
* will be saved on the robot and will be used when the robot program next
|
||||
* starts rather than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, std::string_view)
|
||||
* Add(std::string_view title, std::string_view defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title,
|
||||
std::string_view defaultValue);
|
||||
@@ -426,14 +440,15 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, wpi::span<const bool>), the value in the
|
||||
* widget will be saved on the robot and will be used when the robot program
|
||||
* next starts rather than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, wpi::span<const bool>)
|
||||
* Add(std::string_view title, wpi::span<const bool> defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title,
|
||||
wpi::span<const bool> defaultValue);
|
||||
@@ -441,14 +456,15 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, wpi::span<const double>), the value in the
|
||||
* widget will be saved on the robot and will be used when the robot program
|
||||
* next starts rather than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, wpi::span<const double>)
|
||||
* Add(std::string_view title, wpi::span<const double> defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title,
|
||||
wpi::span<const double> defaultValue);
|
||||
@@ -456,14 +472,15 @@ class ShuffleboardContainer : public virtual ShuffleboardValue {
|
||||
/**
|
||||
* Adds a widget to this container to display a simple piece of data.
|
||||
*
|
||||
* Unlike {@link #add(String, Object)}, the value in the widget will be saved
|
||||
* on the robot and will be used when the robot program next starts rather
|
||||
* than {@code defaultValue}.
|
||||
* Unlike Add(std::string_view, wpi::span<const std::string>), the value in
|
||||
* the widget will be saved on the robot and will be used when the robot
|
||||
* program next starts rather than {@code defaultValue}.
|
||||
*
|
||||
* @param title the title of the widget
|
||||
* @param defaultValue the default value of the widget
|
||||
* @return a widget to display the sendable data
|
||||
* @see #add(String, Object) add(String title, Object defaultValue)
|
||||
* @see Add(std::string_view, wpi::span<const std::string>)
|
||||
* Add(std::string_view title, wpi::span<const std::string> defaultValue)
|
||||
*/
|
||||
SimpleWidget& AddPersistent(std::string_view title,
|
||||
wpi::span<const std::string> defaultValue);
|
||||
|
||||
@@ -17,10 +17,11 @@ class ShuffleboardRoot;
|
||||
|
||||
/**
|
||||
* Represents a tab in the Shuffleboard dashboard. Widgets can be added to the
|
||||
* tab with {@link #add(Sendable)}, {@link #add(String, Object)}, and
|
||||
* {@link #add(String, Sendable)}. Widgets can also be added to layouts with
|
||||
* {@link #getLayout(String, String)}; layouts can be nested arbitrarily deep
|
||||
* (note that too many levels may make deeper components unusable).
|
||||
* tab with Add(Sendable), Add(std::string_view, Object), and
|
||||
* Add(String, Sendable). Widgets can also be added to layouts with
|
||||
* GetLayout(std::string_view, std::string_view); layouts can be nested
|
||||
* arbitrarily deep (note that too many levels may make deeper components
|
||||
* unusable).
|
||||
*/
|
||||
class ShuffleboardTab final : public ShuffleboardContainer {
|
||||
public:
|
||||
|
||||
@@ -47,7 +47,7 @@ class ShuffleboardValue {
|
||||
*
|
||||
* This method is package-private to prevent users from enabling control
|
||||
* themselves. Has no effect if the sendable is not marked as an actuator with
|
||||
* {@link SendableBuilder#setActuator}.
|
||||
* SendableBuilder::SetActuator().
|
||||
*/
|
||||
virtual void EnableIfActuator() {}
|
||||
|
||||
@@ -56,7 +56,7 @@ class ShuffleboardValue {
|
||||
*
|
||||
* This method is package-private to prevent users from enabling control
|
||||
* themselves. Has no effect if the sendable is not marked as an actuator with
|
||||
* {@link SendableBuilder#setActuator}.
|
||||
* SendableBuilder::SetActuator().
|
||||
*/
|
||||
virtual void DisableIfActuator() {}
|
||||
|
||||
|
||||
@@ -60,8 +60,7 @@ class ShuffleboardWidget : public ShuffleboardComponent<Derived> {
|
||||
* widget type will be used. This method should only be used to use a widget
|
||||
* that does not come built into Shuffleboard (i.e. one that comes with a
|
||||
* custom or third-party plugin). To use a widget that is built into
|
||||
* Shuffleboard, use {@link #withWidget(WidgetType)} and {@link
|
||||
* BuiltInWidgets}.
|
||||
* Shuffleboard, use WithWidget(WidgetType) and BuiltInWidgets.
|
||||
*
|
||||
* @param widgetType the type of the widget used to display the data
|
||||
* @return this widget object
|
||||
|
||||
@@ -21,29 +21,35 @@ class ADXL345Sim {
|
||||
/**
|
||||
* Constructs from a ADXL345_I2C object.
|
||||
*
|
||||
* @param ADXL345 accel to simulate
|
||||
* @param accel ADXL345 accel to simulate
|
||||
*/
|
||||
explicit ADXL345Sim(const ADXL345_I2C& accel);
|
||||
|
||||
/**
|
||||
* Constructs from a ADXL345_SPI object.
|
||||
*
|
||||
* @param ADXL345 accel to simulate
|
||||
* @param accel ADXL345 accel to simulate
|
||||
*/
|
||||
explicit ADXL345Sim(const ADXL345_SPI& accel);
|
||||
|
||||
/**
|
||||
* Sets the X acceleration.
|
||||
*
|
||||
* @param accel The X acceleration.
|
||||
*/
|
||||
void SetX(double accel);
|
||||
|
||||
/**
|
||||
* Sets the Y acceleration.
|
||||
*
|
||||
* @param accel The Y acceleration.
|
||||
*/
|
||||
void SetY(double accel);
|
||||
|
||||
/**
|
||||
* Sets the Z acceleration.
|
||||
*
|
||||
* @param accel The Z acceleration.
|
||||
*/
|
||||
void SetZ(double accel);
|
||||
|
||||
|
||||
@@ -20,22 +20,28 @@ class ADXL362Sim {
|
||||
/**
|
||||
* Constructs from a ADXL362 object.
|
||||
*
|
||||
* @param ADXL362 accel to simulate
|
||||
* @param accel ADXL362 accel to simulate
|
||||
*/
|
||||
explicit ADXL362Sim(const ADXL362& accel);
|
||||
|
||||
/**
|
||||
* Sets the X acceleration.
|
||||
*
|
||||
* @param accel The X acceleration.
|
||||
*/
|
||||
void SetX(double accel);
|
||||
|
||||
/**
|
||||
* Sets the Y acceleration.
|
||||
*
|
||||
* @param accel The Y acceleration.
|
||||
*/
|
||||
void SetY(double accel);
|
||||
|
||||
/**
|
||||
* Sets the Z acceleration.
|
||||
*
|
||||
* @param accel The Z acceleration.
|
||||
*/
|
||||
void SetZ(double accel);
|
||||
|
||||
|
||||
@@ -157,6 +157,7 @@ class AddressableLEDSim {
|
||||
*
|
||||
* @param callback the callback that will be called whenever the LED data is
|
||||
* changed
|
||||
* @param initialNotify if true, the callback will be run on the initial value
|
||||
* @return the CallbackStore object associated with this callback
|
||||
*/
|
||||
[[nodiscard]] std::unique_ptr<CallbackStore> RegisterDataCallback(
|
||||
|
||||
@@ -19,9 +19,9 @@ class BatterySim {
|
||||
public:
|
||||
/**
|
||||
* Calculate the loaded battery voltage. Use this with
|
||||
* {@link RoboRioSim#setVInVoltage(double)} to set the simulated battery
|
||||
* voltage, which can then be retrieved with the {@link
|
||||
* RobotController#getBatteryVoltage()} method.
|
||||
* RoboRioSim::SetVInVoltage(double) to set the simulated battery voltage,
|
||||
* which can then be retrieved with the RobotController::GetBatteryVoltage()
|
||||
* method.
|
||||
*
|
||||
* @param nominalVoltage The nominal battery voltage. Usually 12v.
|
||||
* @param resistance The forward resistance of the battery. Most batteries
|
||||
@@ -38,10 +38,10 @@ class BatterySim {
|
||||
|
||||
/**
|
||||
* Calculate the loaded battery voltage. Use this with
|
||||
* {@link RoboRioSim#setVInVoltage(double)} to set the simulated battery
|
||||
* voltage, which can then be retrieved with the {@link
|
||||
* RobotController#getBatteryVoltage()} method. This function assumes a
|
||||
* nominal voltage of 12v and a resistance of 20 milliohms (0.020 ohms)
|
||||
* RoboRioSimSetVInVoltage(double) to set the simulated battery voltage, which
|
||||
* can then be retrieved with the RobotController::GetBatteryVoltage() method.
|
||||
* This function assumes a nominal voltage of 12V and a resistance of 20
|
||||
* milliohms (0.020 ohms).
|
||||
*
|
||||
* @param currents The currents drawn from the battery.
|
||||
* @return The battery's voltage under load.
|
||||
|
||||
@@ -37,7 +37,6 @@ class CTREPCMSim {
|
||||
/**
|
||||
* Register a callback to be run when a solenoid is initialized on a channel.
|
||||
*
|
||||
* @param channel the channel to monitor
|
||||
* @param callback the callback
|
||||
* @param initialNotify should the callback be run with the initial state
|
||||
* @return the CallbackStore object associated with this callback
|
||||
@@ -55,7 +54,6 @@ class CTREPCMSim {
|
||||
/**
|
||||
* Define whether a solenoid has been initialized on a specific channel.
|
||||
*
|
||||
* @param channel the channel
|
||||
* @param solenoidInitialized is there a solenoid initialized on that channel
|
||||
*/
|
||||
void SetInitialized(bool solenoidInitialized);
|
||||
|
||||
@@ -21,24 +21,24 @@ class DifferentialDrivetrainSim {
|
||||
/**
|
||||
* Create a SimDrivetrain.
|
||||
*
|
||||
* @param drivetrainPlant The LinearSystem representing the robot's
|
||||
* drivetrain. This system can be created with
|
||||
* LinearSystemId#createDrivetrainVelocitySystem or
|
||||
* LinearSystemId#identifyDrivetrainSystem.
|
||||
* @param trackWidth The robot's track width.
|
||||
* @param driveMotor A {@link DCMotor} representing the left side of
|
||||
* the drivetrain.
|
||||
* @param gearingRatio The gearingRatio ratio of the left side, as output
|
||||
* over input. This must be the same ratio as the ratio used to identify or
|
||||
* create the drivetrainPlant.
|
||||
* @param wheelRadiusMeters The radius of the wheels on the drivetrain, in
|
||||
* meters.
|
||||
* @param plant The LinearSystem representing the robot's drivetrain. This
|
||||
* system can be created with
|
||||
* LinearSystemId::DrivetrainVelocitySystem() or
|
||||
* LinearSystemId::IdentifyDrivetrainSystem().
|
||||
* @param trackWidth The robot's track width.
|
||||
* @param driveMotor A DCMotor representing the left side of the drivetrain.
|
||||
* @param gearingRatio The gearingRatio ratio of the left side, as output over
|
||||
* input. This must be the same ratio as the ratio used to
|
||||
* identify or create the plant.
|
||||
* @param wheelRadius The radius of the wheels on the drivetrain, in meters.
|
||||
* @param measurementStdDevs Standard deviations for measurements, in the form
|
||||
* [x, y, heading, left velocity, right velocity, left distance, right
|
||||
* distance]ᵀ. Can be omitted if no noise is desired. Gyro standard
|
||||
* deviations of 0.0001 radians, velocity standard deviations of 0.05 m/s, and
|
||||
* position measurement standard deviations of 0.005 meters are a reasonable
|
||||
* starting point.
|
||||
* [x, y, heading, left velocity, right velocity,
|
||||
* left distance, right distance]ᵀ. Can be omitted
|
||||
* if no noise is desired. Gyro standard deviations
|
||||
* of 0.0001 radians, velocity standard deviations
|
||||
* of 0.05 m/s, and position measurement standard
|
||||
* deviations of 0.005 meters are a reasonable
|
||||
* starting point.
|
||||
*/
|
||||
DifferentialDrivetrainSim(
|
||||
LinearSystem<2, 2, 2> plant, units::meter_t trackWidth,
|
||||
@@ -48,23 +48,24 @@ class DifferentialDrivetrainSim {
|
||||
/**
|
||||
* Create a SimDrivetrain.
|
||||
*
|
||||
* @param driveMotor A {@link DCMotor} representing the left side of the
|
||||
* drivetrain.
|
||||
* @param driveMotor A DCMotor representing the left side of the drivetrain.
|
||||
* @param gearing The gearing on the drive between motor and wheel, as
|
||||
* output over input. This must be the same ratio as the ratio used to
|
||||
* identify or create the drivetrainPlant.
|
||||
* output over input. This must be the same ratio as the
|
||||
* ratio used to identify or create the plant.
|
||||
* @param J The moment of inertia of the drivetrain about its
|
||||
* center.
|
||||
* center.
|
||||
* @param mass The mass of the drivebase.
|
||||
* @param wheelRadius The radius of the wheels on the drivetrain.
|
||||
* @param trackWidth The robot's track width, or distance between left and
|
||||
* right wheels.
|
||||
* right wheels.
|
||||
* @param measurementStdDevs Standard deviations for measurements, in the form
|
||||
* [x, y, heading, left velocity, right velocity, left distance, right
|
||||
* distance]ᵀ. Can be omitted if no noise is desired. Gyro standard
|
||||
* deviations of 0.0001 radians, velocity standard deviations of 0.05 m/s, and
|
||||
* position measurement standard deviations of 0.005 meters are a reasonable
|
||||
* starting point.
|
||||
* [x, y, heading, left velocity, right velocity,
|
||||
* left distance, right distance]ᵀ. Can be omitted
|
||||
* if no noise is desired. Gyro standard deviations
|
||||
* of 0.0001 radians, velocity standard deviations
|
||||
* of 0.05 m/s, and position measurement standard
|
||||
* deviations of 0.005 meters are a reasonable
|
||||
* starting point.
|
||||
*/
|
||||
DifferentialDrivetrainSim(
|
||||
frc::DCMotor driveMotor, double gearing, units::kilogram_square_meter_t J,
|
||||
@@ -73,11 +74,10 @@ class DifferentialDrivetrainSim {
|
||||
const std::array<double, 7>& measurementStdDevs = {});
|
||||
|
||||
/**
|
||||
* Clamp the input vector such that no element exceeds the given voltage. If
|
||||
* any does, the relative magnitudes of the input will be maintained.
|
||||
* Clamp the input vector such that no element exceeds the battery voltage.
|
||||
* If any does, the relative magnitudes of the input will be maintained.
|
||||
*
|
||||
* @param u The input vector.
|
||||
* @param maxVoltage The maximum voltage.
|
||||
* @param u The input vector.
|
||||
* @return The normalized input.
|
||||
*/
|
||||
Eigen::Vector<double, 2> ClampInput(const Eigen::Vector<double, 2>& u);
|
||||
@@ -102,8 +102,8 @@ class DifferentialDrivetrainSim {
|
||||
/**
|
||||
* Updates the simulation.
|
||||
*
|
||||
* @param dt The time that's passed since the last {@link #update(double)}
|
||||
* call.
|
||||
* @param dt The time that's passed since the last Update(units::second_t)
|
||||
* call.
|
||||
*/
|
||||
void Update(units::second_t dt);
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class DutyCycleEncoderSim {
|
||||
/**
|
||||
* Constructs from a DutyCycleEncoder object.
|
||||
*
|
||||
* @param dutyCycleEncoder DutyCycleEncoder to simulate
|
||||
* @param encoder DutyCycleEncoder to simulate
|
||||
*/
|
||||
explicit DutyCycleEncoderSim(const DutyCycleEncoder& encoder);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ class DutyCycleSim {
|
||||
*
|
||||
* @param frequency the new frequency
|
||||
*/
|
||||
void SetFrequency(int count);
|
||||
void SetFrequency(int frequency);
|
||||
|
||||
/**
|
||||
* Register a callback to be run whenever the output changes.
|
||||
@@ -114,7 +114,7 @@ class DutyCycleSim {
|
||||
*
|
||||
* @param output the new output value
|
||||
*/
|
||||
void SetOutput(double period);
|
||||
void SetOutput(double output);
|
||||
|
||||
/**
|
||||
* Reset all simulation data for the duty cycle output.
|
||||
|
||||
@@ -140,7 +140,8 @@ class PowerDistributionSim {
|
||||
*
|
||||
* @param currents output array; set to the current in each channel. The
|
||||
* array must be big enough to hold all the PowerDistribution
|
||||
* channels
|
||||
* channels
|
||||
* @param length length of output array
|
||||
*/
|
||||
void GetAllCurrents(double* currents, int length) const;
|
||||
|
||||
@@ -149,7 +150,8 @@ class PowerDistributionSim {
|
||||
*
|
||||
* @param currents array containing the current values for each channel. The
|
||||
* array must be big enough to hold all the PowerDistribution
|
||||
* channels
|
||||
* channels
|
||||
* @param length length of array
|
||||
*/
|
||||
void SetAllCurrents(const double* currents, int length);
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ class REVPHSim {
|
||||
/**
|
||||
* Register a callback to be run when a solenoid is initialized on a channel.
|
||||
*
|
||||
* @param channel the channel to monitor
|
||||
* @param callback the callback
|
||||
* @param initialNotify should the callback be run with the initial state
|
||||
* @return the CallbackStore object associated with this callback
|
||||
@@ -55,7 +54,6 @@ class REVPHSim {
|
||||
/**
|
||||
* Define whether a solenoid has been initialized on a specific channel.
|
||||
*
|
||||
* @param channel the channel
|
||||
* @param solenoidInitialized is there a solenoid initialized on that channel
|
||||
*/
|
||||
void SetInitialized(bool solenoidInitialized);
|
||||
|
||||
@@ -38,7 +38,7 @@ class RoboRioSim {
|
||||
/**
|
||||
* Define the state of the FPGA button.
|
||||
*
|
||||
* @param fpgaButton the new state
|
||||
* @param fPGAButton the new state
|
||||
*/
|
||||
static void SetFPGAButton(bool fPGAButton);
|
||||
|
||||
@@ -414,7 +414,7 @@ class RoboRioSim {
|
||||
/**
|
||||
* Define the brownout voltage.
|
||||
*
|
||||
* @param vInVoltage the new voltage
|
||||
* @param brownoutVoltage the new voltage
|
||||
*/
|
||||
static void SetBrownoutVoltage(units::volt_t brownoutVoltage);
|
||||
|
||||
|
||||
@@ -28,14 +28,14 @@ class UltrasonicSim {
|
||||
/**
|
||||
* Sets if the range measurement is valid.
|
||||
*
|
||||
* @param valid True if valid
|
||||
* @param isValid True if valid
|
||||
*/
|
||||
void SetRangeValid(bool isValid);
|
||||
|
||||
/**
|
||||
* Sets the range measurement
|
||||
*
|
||||
* @param rate The range
|
||||
* @param range The range
|
||||
*/
|
||||
void SetRange(units::meter_t range);
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ class FieldObject2d {
|
||||
* Set multiple poses from an array of Pose objects.
|
||||
* The total number of poses is limited to 85.
|
||||
*
|
||||
* @param obj Object entry
|
||||
* @param poses array of 2D poses
|
||||
*/
|
||||
void SetPoses(std::initializer_list<Pose2d> poses);
|
||||
@@ -95,7 +94,6 @@ class FieldObject2d {
|
||||
/**
|
||||
* Get multiple poses.
|
||||
*
|
||||
* @param obj Object entry
|
||||
* @param out output SmallVector to hold 2D poses
|
||||
* @return span referring to output SmallVector
|
||||
*/
|
||||
|
||||
@@ -48,6 +48,7 @@ class Mechanism2d : public nt::NTSendable,
|
||||
*
|
||||
* @param width the width
|
||||
* @param height the height
|
||||
* @param backgroundColor the background color
|
||||
*/
|
||||
Mechanism2d(double width, double height,
|
||||
const Color8Bit& backgroundColor = {0, 0, 32});
|
||||
|
||||
@@ -53,7 +53,7 @@ class MechanismLigament2d : public MechanismObject2d {
|
||||
/**
|
||||
* Set the ligament's angle relative to its parent.
|
||||
*
|
||||
* @param degrees the angle
|
||||
* @param angle the angle
|
||||
*/
|
||||
void SetAngle(units::degree_t angle);
|
||||
|
||||
@@ -67,7 +67,7 @@ class MechanismLigament2d : public MechanismObject2d {
|
||||
/**
|
||||
* Set the line thickness.
|
||||
*
|
||||
* @param weight the line thickness
|
||||
* @param lineWidth the line thickness
|
||||
*/
|
||||
void SetLineWeight(double lineWidth);
|
||||
|
||||
|
||||
@@ -114,8 +114,8 @@ class SmartDashboard {
|
||||
* In order for the value to appear in the dashboard, it must be registered
|
||||
* with SendableRegistry. WPILib components do this automatically.
|
||||
*
|
||||
* @param keyName the key
|
||||
* @param value the value
|
||||
* @param key the key
|
||||
* @param data the value
|
||||
*/
|
||||
static void PutData(std::string_view key, wpi::Sendable* data);
|
||||
|
||||
@@ -167,6 +167,7 @@ class SmartDashboard {
|
||||
* If the key is not found, returns the default value.
|
||||
*
|
||||
* @param keyName the key
|
||||
* @param defaultValue the default value to set if key doesn't exist
|
||||
* @return the value
|
||||
*/
|
||||
static bool GetBoolean(std::string_view keyName, bool defaultValue);
|
||||
@@ -198,6 +199,7 @@ class SmartDashboard {
|
||||
* If the key is not found, returns the default value.
|
||||
*
|
||||
* @param keyName the key
|
||||
* @param defaultValue the default value to set if the key doesn't exist
|
||||
* @return the value
|
||||
*/
|
||||
static double GetNumber(std::string_view keyName, double defaultValue);
|
||||
@@ -230,6 +232,7 @@ class SmartDashboard {
|
||||
* If the key is not found, returns the default value.
|
||||
*
|
||||
* @param keyName the key
|
||||
* @param defaultValue the default value to set if the key doesn't exist
|
||||
* @return the value
|
||||
*/
|
||||
static std::string GetString(std::string_view keyName,
|
||||
@@ -418,7 +421,6 @@ class SmartDashboard {
|
||||
* complex data object.
|
||||
*
|
||||
* @param keyName the key
|
||||
* @param value the object to retrieve the value into
|
||||
*/
|
||||
static std::shared_ptr<nt::Value> GetValue(std::string_view keyName);
|
||||
|
||||
|
||||
@@ -743,9 +743,9 @@ class Color {
|
||||
/**
|
||||
* Constructs a Color.
|
||||
*
|
||||
* @param red Red value (0-1)
|
||||
* @param green Green value (0-1)
|
||||
* @param blue Blue value (0-1)
|
||||
* @param r Red value (0-1)
|
||||
* @param g Green value (0-1)
|
||||
* @param b Blue value (0-1)
|
||||
*/
|
||||
constexpr Color(double r, double g, double b)
|
||||
: red(roundAndClamp(r)),
|
||||
|
||||
@@ -20,9 +20,9 @@ class Color8Bit {
|
||||
/**
|
||||
* Constructs a Color8Bit.
|
||||
*
|
||||
* @param red Red value (0-255)
|
||||
* @param green Green value (0-255)
|
||||
* @param blue Blue value (0-255)
|
||||
* @param r Red value (0-255)
|
||||
* @param g Green value (0-255)
|
||||
* @param b Blue value (0-255)
|
||||
*/
|
||||
constexpr Color8Bit(int r, int g, int b)
|
||||
: red(std::clamp(r, 0, 255)),
|
||||
|
||||
Reference in New Issue
Block a user