Compare commits

...

66 Commits

Author SHA1 Message Date
Tyler Veness
7f4265facc [wpimath] Add LinearFilter::FiniteDifference() (#3900)
This allows making more general finite difference filters, like central
finite difference. SysId uses this for acceleration filtering.
2022-01-15 20:18:11 -08:00
Tyler Veness
63d1fb3bed [wpiutil] Modify fmt to not throw on write failure (#3919)
This was causing issues with tools, as the launchers would close stdout/stderr, resulting in write failures.
2022-01-15 20:10:32 -08:00
Tyler Veness
36af6d25a5 [wpimath] Fix input vector in pose estimator docs (NFC) (#3923) 2022-01-15 20:03:39 -08:00
Thad House
8f387f7255 [wpilibj] Switch ControlWord mutex to actual reentrant mutex (#3922)
It seems like the JVM does not handle recursive calls to object monitor based locks correctly. A few bugs in the past have been reported to have caused deadlocks if this occurs. It looks like the version of Java we use is fixed, but there could be other bugs, and it seems like this area of the code isn't tested much. Based on the stacks reported in #3896, it really seems like this is occurring. So we're going to attempt to switch to explicit mutex based classes, which shouldn't have bugs like this, and we will see if that fixes the issue.
2022-01-15 15:24:06 -08:00
David Vo
792e735e08 [wpimath] Move TrajectoryGenerator::SetErrorHandler definition to .cpp (#3920)
Otherwise this function causes linking errors when used on Windows.
2022-01-15 08:58:49 -08:00
Tyler Veness
3b76de83eb [commands] Fix ProfiledPIDCommand use-after-free (#3904)
Fixes #3903.
2022-01-14 23:56:48 -08:00
PJ Reiniger
ad9f738cfa [fieldimages] Fix maven publishing (#3897) 2022-01-14 23:55:10 -08:00
modelmat
49455199e5 [examples] Use left/rightGroup.Get() for simulator inputs to fix inversions (#3908) 2022-01-14 23:54:20 -08:00
modelmat
64426502ea [wpimath] Fix arm -> flywheel typo (NFC) (#3911) 2022-01-14 23:53:45 -08:00
Tyler Veness
8cc112d196 [wpiutil] Fix wpi::array for move-only types (#3917)
Fixes #3916.
2022-01-14 23:53:12 -08:00
Tyler Veness
e78cd49861 [build] Upgrade Java formatter plugins (#3894) 2022-01-11 22:24:16 -08:00
Tyler Veness
cfb4f756d6 [build] Upgrade to shadow 7.1.2 (#3893) 2022-01-11 21:10:15 -08:00
Tyler Veness
ba0908216c [wpimath] Fix crash in KF latency compensator (#3888)
It would crash in C++ if the global measurement was sooner than all the
snapshots.

Align Java with the changes and better document computation approach.
2022-01-09 23:01:04 -08:00
Peter Johnson
a3a0334fad [build] cmake: Move fieldImages to WITH_GUI (#3885)
This will only ever be used by GUI applications, and the jar build
method it uses can misbehave in some cross-compile scenarios.
2022-01-09 20:26:54 -08:00
sciencewhiz
cf7460c3a8 [fieldImages] Add 2022 field (#3883) 2022-01-08 23:24:24 -08:00
Tyler Veness
db0fbb6448 [wpimath] Fix LQR matrix constructor overload for Q, R, and N (#3884)
It was using the continuous B matrix to compute the feedback gain
instead of the discrete B matrix.

Tests were added for the matrix constructor overloads.
2022-01-08 23:23:53 -08:00
sciencewhiz
8ac45f20bb [commands] Update Command documentation (NFC) (#3881)
Add reference to which VendorDep the class is included in.
Add missing OldCommands C++ Documentation (copied from Java).
2022-01-08 11:11:34 -08:00
Tyler Veness
b3707cca0b [wpiutil] Upgrade to fmt 8.1.1 (#3879)
The changes to PneumaticsBase.cpp were to fix errors like the following
from enum classes not being formattable:
```
allwpilib/wpilibc/src/main/native/cpp/PneumaticsBase.cpp:36:9:   required from here
allwpilib/wpiutil/src/main/native/fmtlib/include/fmt/core.h:2672:12: error: use of deleted function ‘fmt::v8::detail::fallback_formatter<T, Char, Enable>::fallback_formatter() [with T = frc::PneumaticsModuleType; Char = char; Enable = void]’
 2672 |   auto f = conditional_t<has_formatter<mapped_type, context>::value,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2673 |                          formatter<mapped_type, char_type>,
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2674 |                          fallback_formatter<T, char_type>>();
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
2022-01-08 11:10:42 -08:00
Tyler Veness
a69ee3ece9 [wpimath] Const-qualify Twist2d scalar multiply (#3882)
Fixes #3880.
2022-01-08 11:09:29 -08:00
Drew Williams
750d9a30c9 [examples] Fix Eigen out of range error when running example (#3877)
Simple typo fix.
2022-01-08 00:15:26 -08:00
Peter Johnson
41c5b2b5ac [rtns] Add cmake build (#3866)
This needs libssh to build, so on Linux systems it's necessary to
install libssh-dev.
2022-01-08 00:14:48 -08:00
Tyler Veness
6cf3f9b28e [build] Upgrade to Gradle 7.3.3 (#3878)
This is the same version robot projects currently use.
2022-01-08 00:14:27 -08:00
Starlight220
269cf03472 [examples] Add communication examples (e.g. arduino) (#2500)
Co-authored-by: Andrew Dassonville <dassonville.andrew@gmail.com>
2022-01-06 18:08:57 -08:00
sciencewhiz
5ccfc4adbd [oldcommands] Deprecate PIDWrappers, since they use deprecated interfaces (#3868) 2022-01-06 18:05:24 -08:00
Peter Johnson
b6f44f98be [hal] Add warning about onboard I2C (#3871)
Adds HAL layer warning for #3842. This is needed in the case when a
vendor uses the HAL directly rather than using the WPILib I2C class.

This should not result in a duplicate warning for WPILib I2C users due
to the duplicate message checking performed in HAL_SendError().

We don't want to remove the WPILib I2C warning because it gives stack
trace information while the HAL layer one can't.
2022-01-06 17:44:27 -08:00
Peter Johnson
0dca57e9ec [templates] romieducational: Invert drivetrain and disable motor safety (#3869) 2022-01-06 11:29:15 -08:00
Tyler Veness
22c4da152e [wpilib] Add GetRate() to ADIS classes (#3864)
The angular rate is treated somewhat like an angle during calibration,
but the datasheet says it's angular rate. The variables were renamed to
make this clearer.
2022-01-04 22:26:23 -08:00
Peter Johnson
05d66f862d [templates] Change the template ordering to put command based first (#3863)
Previously it was a bit buried.
2022-01-04 21:23:57 -08:00
Dustin Spicuzza
b09f5b2cf2 [wpilibc] Add virtual dtor for LinearSystemSim (#3861) 2022-01-03 21:25:02 -08:00
Tyler Veness
a2510aaa0e [wpilib] Make ADIS IMU classes unit-safe (#3860)
The gyro rate getters were removed since that data isn't available.
2022-01-03 20:00:53 -08:00
Tyler Veness
947f589916 [wpilibc] Rename ADIS_16470_IMU.cpp to match class name (#3859) 2022-01-03 17:53:57 -08:00
Peter Johnson
bbd8980a20 [myRobot] Fix cameraserver library order (#3858) 2022-01-03 11:59:29 -08:00
Tyler Veness
831052f118 [wpilib] Add simulation support to ADIS classes (#3857) 2022-01-03 11:44:12 -08:00
Noah Andrews
c137569f91 [wpilib] Throw exception if the REV Pneumatic Hub firmware version is older than 22.0.0 (#3853) 2022-01-03 11:09:30 -08:00
sciencewhiz
dae61226fa Fix Maven Artifacts readme (#3856)
Add wpiutil to wpimath
Add wpimath to wpilibj and wpilibc
2022-01-03 10:18:49 -08:00
sciencewhiz
3ad4594a88 Update Maven artifacts readme for 2022 (#3855) 2022-01-01 13:28:36 -08:00
Matteo Kimura
112acb9a62 [wpilibc] Move ADIS IMU constants to inside class (#3852) 2022-01-01 11:40:28 -08:00
Peter Johnson
ecee224e81 [wpilib] Allow SendableCameraWrappers to take arbitrary URLs (#3850)
Useful for adding cameras that are streamed from a coprocessor

Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
Co-authored-by: Sam Carlberg <sam.carlberg@gmail.com>
2022-01-01 10:10:37 -08:00
Peter Johnson
a3645dea34 LICENSE: Bump year range to include 2022 (#3854) 2022-01-01 00:00:16 -08:00
Jan-Felix Abellera
7c09f44898 [wpilib] Use PSI for compressor config and sensor reading (#3847)
This adds the REV Analog Pressure Sensor PSI to volt (and vice versa) conversion to allow setting the compressor config in PSI and getting the sensor reading in PSI. Also adds input validation for pressure values at the higher level.

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2021-12-31 21:04:56 -08:00
Peter Johnson
f401ea9aae [wpigui] Remove wpiutil linkage (#3851)
It was only being used for fs::remove() (added in #3463), which is easily
replaced by std::remove().

The code change does not affect the WPILib tools, as this code is not used when JSON save files are used.
2021-12-31 07:56:31 -08:00
Peter Johnson
bf8517f1e6 [wpimath] TimeInterpolatableBufferTest: Fix lint warnings (#3849) 2021-12-31 00:06:08 -08:00
David Vo
528087e308 [hal] Use enums with fixed underlying type in clang C (#3297)
This will allow static analysis tools that use clang to always determine the correct intended parameter types for HAL functions.
2021-12-30 21:20:05 -08:00
Thad House
1f59ff72f9 [wpilib] Add ADIS IMUs (#3777)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: Matteo Kimura <mateus.sakata@gmail.com>
2021-12-30 19:43:53 -08:00
Matt
315be873c4 [wpimath] Add TimeInterpolatableBuffer (#2695)
These classes are useful for storing previous robot positions to use in conjunction with the upcoming pose estimators.

Co-authored-by: Prateek Machiraju <prateek.machiraju@gmail.com>
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
Co-authored-by: cttew <cttewari@gmail.com>
2021-12-30 19:08:05 -08:00
Oblarg
b8d019cdb4 [wpilib] Rename NormalizeWheelSpeeds to DesaturateWheelSpeeds (#3791) 2021-12-30 18:30:08 -08:00
Peter Johnson
102f23bbdb [wpilibj] DriverStation: Set thread interrupted state (#3846)
This is a Java best practice when catching InterruptedException.
2021-12-30 13:13:52 -08:00
Kevin-OConnor
b85c24a79c [wpilib] Add warning about onboard I2C (#3842) 2021-12-30 13:13:03 -08:00
Oblarg
eee29daaf9 [newCommands] Trigger: Allow override of debounce type (#3845)
Previously Trigger could only be debounced on rising edges.
This change preserves the default behavior but adds the capability to override it.
2021-12-29 16:10:43 -08:00
Oblarg
aa9dfabde2 [wpimath] Move debouncer to filters (#3838) 2021-12-28 09:49:41 -08:00
Peter Johnson
5999a26fba [wpiutil] Add GetSystemTime() (#3840)
This portably gets the time in microseconds since the Unix epoch.
2021-12-27 23:06:31 -08:00
sciencewhiz
1e82595ffb [examples] Fix arcade inversions (#3841)
Accounts for differences between ArcadeDrive and the methods used
in some other examples.
2021-12-27 23:05:42 -08:00
Peter Johnson
e373fa476b [wpiutil] Add disableMockTime to JNI (#3839)
This exposes the equivalent of SetNowImpl(nullptr) to Java.
2021-12-27 09:51:32 -08:00
sciencewhiz
dceb5364f4 [examples] Ensure right side motors are inverted (#3836)
Fixes #3827
Adds MotorController inversion for right side, removes inversion in
setVoltage methods.

Also fixes various XboxController negations (was inconsistent throughout examples).
2021-12-26 19:25:26 -08:00
Oblarg
baacbc8e24 [wpilib] Tachometer: Add function to return RPS (#3833) 2021-12-26 15:52:18 -08:00
Austin Shalit
84b15f0883 [templates] Add Java Romi Educational template (#3837)
This is a combination of a Romi Gradle project and Educational robot (added in #3309)
2021-12-26 15:46:22 -08:00
Dalton Smith
c0da9d2d35 [examples] Invert Right Motor in Romi Java examples (#3828) 2021-12-26 15:42:53 -08:00
sciencewhiz
0fe0be2733 [build] Change project year to intellisense (#3835)
This means VSCode won't prompt to upgrade (added in beta 4)
2021-12-25 20:50:06 -06:00
Tyler Veness
eafa947338 [wpimath] Make copies of trajectory constraint arguments (#3832)
This avoids stack-use-after-scope bugs in code like the following when
the original argument goes out of scope:
```cpp
frc2::Command* RobotContainer::GetAutonomousCommand() {
  // Create a voltage constraint to ensure we don't accelerate too fast
  frc::DifferentialDriveVoltageConstraint autoVoltageConstraint(
      frc::SimpleMotorFeedforward<units::meters>(
          DriveConstants::ks, DriveConstants::kv, DriveConstants::ka),
      DriveConstants::kDriveKinematics, 10_V);
```
2021-12-25 07:19:43 -06:00
sciencewhiz
9d13ae8d01 [wpilib] Add notes for Servo get that it only returns cmd (NFC) (#3820)
Co-authored-by: Peter Johnson <johnson.peter@gmail.com>
2021-12-23 22:22:18 -08:00
Tyler Veness
2a64e4bae5 [wpimath] Give drivetrain a more realistic width in TrajectoryJsonTest.java (#3822)
Fixes #3819.
2021-12-22 22:28:23 -08:00
Tyler Veness
c3fd20db59 [wpilib] Fix trajectory sampling in DifferentialDriveSim test (#3821)
Also rename C++ test file to match class name.

Fixes #3818.
2021-12-22 22:27:51 -08:00
WarrenReynolds
6f91f37cd0 [examples] Fix SwerveControllerCommand order of Module States (#3815)
DriveSubsystem::SetModulesStates applies module state to incorrect modules.

Fixes #3814.
2021-12-22 12:26:02 -08:00
Peter Johnson
5158730b81 [wpigui] Upgrade to imgui 1.86, GLFW 3.3.6 (#3817)
The GLFW upgrade fixes gamepads not being mapped at startup.
2021-12-22 12:24:36 -08:00
Thad House
2ad2d2ca96 [wpiutil] MulticastServiceResolver: Fix C array returning functions (#3816) 2021-12-22 09:52:57 -08:00
Starlight220
b5fd29774f [wpilibj] Trigger: implement BooleanSupplier interface (#3811) 2021-12-21 11:33:16 -08:00
391 changed files with 11956 additions and 2010 deletions

View File

@@ -1,6 +1,6 @@
{
"enableCppIntellisense": true,
"currentLanguage": "cpp",
"projectYear": "2021",
"projectYear": "intellisense",
"teamNumber": 0
}

View File

@@ -145,6 +145,8 @@ if (USE_VCPKG_EIGEN)
set (EIGEN_VCPKG_REPLACE "find_package(Eigen3 CONFIG)")
endif()
find_package(LIBSSH 0.7.1)
if (WITH_FLAT_INSTALL)
set(WPIUTIL_DEP_REPLACE "include($\{SELF_DIR\}/wpiutil-config.cmake)")
set(NTCORE_DEP_REPLACE "include($\{SELF_DIR\}/ntcore-config.cmake)")
@@ -245,7 +247,6 @@ if (WITH_TESTS)
include(GoogleTest)
endif()
add_subdirectory(fieldImages)
add_subdirectory(wpiutil)
add_subdirectory(ntcore)
@@ -254,10 +255,14 @@ if (WITH_WPIMATH)
endif()
if (WITH_GUI)
add_subdirectory(fieldImages)
add_subdirectory(imgui)
add_subdirectory(wpigui)
add_subdirectory(glass)
add_subdirectory(outlineviewer)
if (LIBSSH_FOUND)
add_subdirectory(roborioteamnumbersetter)
endif()
endif()
if (WITH_WPILIB OR WITH_SIMULATION_MODULES)

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2021 FIRST and other WPILib contributors
Copyright (c) 2009-2022 FIRST and other WPILib contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without

View File

@@ -69,15 +69,36 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
* wpiutil
* wpigui
* imgui
* ntcore
* wpiutil
* wpimath
* wpiutil
* glass/libglass
* wpiutil
* wpimath
* wpigui
* glass/libglassnt
* wpiutil
* ntcore
* wpimath
* wpigui
* hal
* wpiutil
* halsim
* imgui
* wpiutil
* ntcore
* wpiutil
* ntcore
* wpimath
* wpigui
* libglass
* libglassnt
* cscore
* opencv
@@ -101,6 +122,7 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
* cameraserver
* ntcore
* cscore
* wpimath
* wpiutil
* wpilibNewCommands
@@ -109,9 +131,10 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
* cameraserver
* ntcore
* cscore
* wpimath
* wpiutil
* wpilibNewCommands
* wpilibOldCommands
* wpilibc
* hal
* cameraserver
@@ -119,6 +142,7 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
* cscore
* wpiutil
### Third Party Artifacts
This repository provides the builds of the following third party software.
@@ -128,3 +152,4 @@ All artifacts are based at `edu.wpi.first.thirdparty.frcYEAR` in the repository.
* googletest
* imgui
* opencv
* libssh

View File

@@ -19,9 +19,9 @@ plugins {
id 'idea'
id 'visual-studio'
id 'net.ltgt.errorprone' version '2.0.2' apply false
id 'com.github.johnrengelman.shadow' version '7.1.1' apply false
id 'com.diffplug.spotless' version '6.0.5' apply false
id 'com.github.spotbugs' version '5.0.3' apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
id 'com.diffplug.spotless' version '6.1.2' apply false
id 'com.github.spotbugs' version '5.0.4' apply false
}
wpilibVersioning.buildServerMode = project.hasProperty('buildServer')
@@ -147,5 +147,5 @@ ext.getCurrentArch = {
}
wrapper {
gradleVersion = '7.3.2'
gradleVersion = '7.3.3'
}

View File

@@ -0,0 +1,116 @@
# - Try to find LibSSH
# Once done this will define
#
# LIBSSH_FOUND - system has LibSSH
# LIBSSH_INCLUDE_DIRS - the LibSSH include directory
# LIBSSH_LIBRARIES - link these to use LibSSH
# LIBSSH_VERSION -
#
# Author Michal Vasko <mvasko@cesnet.cz>
# Copyright (c) 2020 CESNET, z.s.p.o.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
include(FindPackageHandleStandardArgs)
if(LIBSSH_LIBRARIES AND LIBSSH_INCLUDE_DIRS)
# in cache already
set(LIBSSH_FOUND TRUE)
else()
find_path(LIBSSH_INCLUDE_DIR
NAMES
libssh/libssh.h
PATHS
/usr/include
/usr/local/include
/opt/local/include
/sw/include
${CMAKE_INCLUDE_PATH}
${CMAKE_INSTALL_PREFIX}/include
)
find_library(LIBSSH_LIBRARY
NAMES
ssh.so
libssh.so
libssh.dylib
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
${CMAKE_LIBRARY_PATH}
${CMAKE_INSTALL_PREFIX}/lib
)
if(LIBSSH_INCLUDE_DIR AND LIBSSH_LIBRARY)
# learn libssh version
if(EXISTS ${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h)
set(LIBSSH_HEADER_PATH ${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h)
else()
set(LIBSSH_HEADER_PATH ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h)
endif()
file(STRINGS ${LIBSSH_HEADER_PATH} LIBSSH_VERSION_MAJOR
REGEX "#define[ ]+LIBSSH_VERSION_MAJOR[ ]+[0-9]+")
if(NOT LIBSSH_VERSION_MAJOR)
message(STATUS "LIBSSH_VERSION_MAJOR not found, assuming libssh is too old and cannot be used!")
set(LIBSSH_INCLUDE_DIR "LIBSSH_INCLUDE_DIR-NOTFOUND")
set(LIBSSH_LIBRARY "LIBSSH_LIBRARY-NOTFOUND")
else()
string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MAJOR ${LIBSSH_VERSION_MAJOR})
file(STRINGS ${LIBSSH_HEADER_PATH} LIBSSH_VERSION_MINOR
REGEX "#define[ ]+LIBSSH_VERSION_MINOR[ ]+[0-9]+")
string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MINOR ${LIBSSH_VERSION_MINOR})
file(STRINGS ${LIBSSH_HEADER_PATH} LIBSSH_VERSION_PATCH
REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+")
string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH})
set(LIBSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH})
if(LIBSSH_VERSION VERSION_LESS 0.8.0)
# libssh_threads also needs to be linked for these versions
string(REPLACE "libssh.so" "libssh_threads.so"
LIBSSH_THREADS_LIBRARY
${LIBSSH_LIBRARY}
)
string(REPLACE "libssh.dylib" "libssh_threads.dylib"
LIBSSH_THREADS_LIBRARY
${LIBSSH_THREADS_LIBRARY}
)
string(REPLACE "ssh.so" "ssh_threads.so"
LIBSSH_THREADS_LIBRARY
${LIBSSH_THREADS_LIBRARY}
)
endif()
endif()
endif()
set(LIBSSH_INCLUDE_DIRS ${LIBSSH_INCLUDE_DIR})
set(LIBSSH_LIBRARIES ${LIBSSH_LIBRARY} ${LIBSSH_THREADS_LIBRARY})
mark_as_advanced(LIBSSH_INCLUDE_DIRS LIBSSH_LIBRARIES)
find_package_handle_standard_args(LibSSH FOUND_VAR LIBSSH_FOUND
REQUIRED_VARS LIBSSH_INCLUDE_DIRS LIBSSH_LIBRARIES
VERSION_VAR LIBSSH_VERSION)
endif()

View File

@@ -15,10 +15,14 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
ext {
nativeName = 'fieldImages'
baseId = nativeName
groupId = 'edu.wpi.first.fieldImages'
devMain = "edu.wpi.first.fieldImages.DevMain"
}
apply from: "${rootDir}/shared/resources.gradle"
apply from: "${rootDir}/shared/config.gradle"
apply from: "${rootDir}/shared/java/javacommon.gradle"
def generateTask = createGenerateResourcesTask('main', 'FIELDS', 'fields', project)

View File

@@ -1,14 +1,14 @@
apply plugin: 'maven-publish'
def baseArtifactId = 'fieldImages'
def artifactGroupId = 'edu.wpi.first.fieldImages'
def zipBaseName = '_GROUP_edu_wpi_first_field_images_ID_CLS'
def baseArtifactId = project.nativeName
def artifactGroupId = project.groupId
def cppZipBaseName = "_GROUP_edu_wpi_first_fieldIimages_ID_${baseArtifactId}-cpp_CLS"
def outputsFolder = file("$project.buildDir/outputs")
task cppSourcesZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
archiveBaseName = cppZipBaseName
classifier = "sources"
from(licenseFile) {
@@ -25,7 +25,7 @@ task cppSourcesZip(type: Zip) {
task cppHeadersZip(type: Zip) {
destinationDirectory = outputsFolder
archiveBaseName = zipBaseName
archiveBaseName = cppZipBaseName
classifier = "headers"
from(licenseFile) {
@@ -51,7 +51,7 @@ addTaskToCopyAllOutputs(cppSourcesZip)
model {
publishing {
def wpilibCTaskList = createComponentZipTasks($.components, ['fieldImages'], zipBaseName, Zip, project, includeStandardZipFormat)
def wpilibCTaskList = createComponentZipTasks($.components, ['fieldImages'], cppZipBaseName, Zip, project, includeStandardZipFormat)
publications {
cpp(MavenPublication) {
@@ -62,7 +62,7 @@ model {
artifact cppHeadersZip
artifact cppSourcesZip
artifactId = baseArtifactId
artifactId = "${baseArtifactId}-cpp"
groupId artifactGroupId
version wpilibVersioning.version.get()
}

View File

@@ -20,4 +20,6 @@ public class FieldImages {
public static final String k2021GalacticSearchBFieldConfig =
"/edu/wpi/first/fields/2021-galacticsearchb.json";
public static final String k2021SlalomFieldConfig = "/edu/wpi/first/fields/2021-slalompath.json";
public static final String k2022RapidReactFieldConfig =
"/edu/wpi/first/fields/2022-rapidreact.json";
}

View File

@@ -0,0 +1,12 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#pragma once
#include <string_view>
namespace fields {
std::string_view GetResource_2022_rapidreact_json();
std::string_view GetResource_2022_field_png();
} // namespace fields

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,10 @@
{
"game": "Rapid React",
"field-image": "2022-field.png",
"field-corners": {
"top-left": [74, 50],
"bottom-right": [1774, 900]
},
"field-size": [54, 27],
"field-unit": "foot"
}

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

10
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#

View File

@@ -54,6 +54,10 @@ void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) {
}
if (port == HAL_I2C_kOnboard) {
HAL_SendError(0, 0, 0,
"Onboard I2C port is subject to system lockups. See Known "
"Issues page for details",
"", "", true);
std::scoped_lock lock(digitalI2COnBoardMutex);
i2COnboardObjCount++;
if (i2COnboardObjCount > 1) {

View File

@@ -11,6 +11,7 @@
#include <hal/handles/IndexedHandleResource.h>
#include <cstring>
#include <thread>
#include <fmt/format.h>
@@ -35,6 +36,7 @@ struct REV_PDHObj {
int32_t controlPeriod;
HAL_CANHandle hcan;
std::string previousAllocation;
HAL_PowerDistributionVersion versionInfo;
};
} // namespace
@@ -226,6 +228,7 @@ HAL_REVPDHHandle HAL_InitializeREVPDH(int32_t module,
hpdh->previousAllocation = allocationLocation ? allocationLocation : "";
hpdh->hcan = hcan;
hpdh->controlPeriod = kDefaultControlPeriod;
std::memset(&hpdh->versionInfo, 0, sizeof(hpdh->versionInfo));
return handle;
}
@@ -490,6 +493,18 @@ void HAL_GetREVPDHVersion(HAL_REVPDHHandle handle,
return;
}
if (hpdh->versionInfo.firmwareMajor > 0) {
version->firmwareMajor = hpdh->versionInfo.firmwareMajor;
version->firmwareMinor = hpdh->versionInfo.firmwareMinor;
version->firmwareFix = hpdh->versionInfo.firmwareFix;
version->hardwareMajor = hpdh->versionInfo.hardwareMajor;
version->hardwareMinor = hpdh->versionInfo.hardwareMinor;
version->uniqueId = hpdh->versionInfo.uniqueId;
*status = 0;
return;
}
HAL_WriteCANRTRFrame(hpdh->hcan, PDH_VERSION_LENGTH, PDH_VERSION_FRAME_API,
status);
@@ -497,9 +512,15 @@ void HAL_GetREVPDHVersion(HAL_REVPDHHandle handle,
return;
}
HAL_ReadCANPacketTimeout(hpdh->hcan, PDH_VERSION_FRAME_API, packedData,
&length, &timestamp, kDefaultControlPeriod * 2,
status);
uint32_t timeoutMs = 100;
for (uint32_t i = 0; i <= timeoutMs; i++) {
HAL_ReadCANPacketNew(hpdh->hcan, PDH_VERSION_FRAME_API, packedData, &length,
&timestamp, status);
if (*status == 0) {
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (*status != 0) {
return;
@@ -513,6 +534,8 @@ void HAL_GetREVPDHVersion(HAL_REVPDHHandle handle,
version->hardwareMinor = result.hardware_minor;
version->hardwareMajor = result.hardware_major;
version->uniqueId = result.unique_id;
hpdh->versionInfo = *version;
}
void HAL_GetREVPDHFaults(HAL_REVPDHHandle handle,

View File

@@ -4,6 +4,8 @@
#include "hal/REVPH.h"
#include <thread>
#include <fmt/format.h>
#include "HALInitializer.h"
@@ -63,6 +65,7 @@ struct REV_PHObj {
wpi::mutex solenoidLock;
HAL_CANHandle hcan;
std::string previousAllocation;
HAL_REVPHVersion versionInfo;
};
} // namespace
@@ -221,6 +224,9 @@ HAL_REVPHHandle HAL_InitializeREVPH(int32_t module,
hph->previousAllocation = allocationLocation ? allocationLocation : "";
hph->hcan = hcan;
hph->controlPeriod = kDefaultControlPeriod;
std::memset(&hph->desiredSolenoidsState, 0,
sizeof(hph->desiredSolenoidsState));
std::memset(&hph->versionInfo, 0, sizeof(hph->versionInfo));
// Start closed-loop compressor control by starting solenoid state updates
HAL_SendREVPHSolenoidsState(hph.get(), status);
@@ -480,6 +486,18 @@ void HAL_GetREVPHVersion(HAL_REVPHHandle handle, HAL_REVPHVersion* version,
return;
}
if (ph->versionInfo.firmwareMajor > 0) {
version->firmwareMajor = ph->versionInfo.firmwareMajor;
version->firmwareMinor = ph->versionInfo.firmwareMinor;
version->firmwareFix = ph->versionInfo.firmwareFix;
version->hardwareMajor = ph->versionInfo.hardwareMajor;
version->hardwareMinor = ph->versionInfo.hardwareMinor;
version->uniqueId = ph->versionInfo.uniqueId;
*status = 0;
return;
}
HAL_WriteCANRTRFrame(ph->hcan, PH_VERSION_LENGTH, PH_VERSION_FRAME_API,
status);
@@ -487,8 +505,15 @@ void HAL_GetREVPHVersion(HAL_REVPHHandle handle, HAL_REVPHVersion* version,
return;
}
HAL_ReadCANPacketTimeout(ph->hcan, PH_VERSION_FRAME_API, packedData, &length,
&timestamp, kDefaultControlPeriod * 2, status);
uint32_t timeoutMs = 100;
for (uint32_t i = 0; i <= timeoutMs; i++) {
HAL_ReadCANPacketNew(ph->hcan, PH_VERSION_FRAME_API, packedData, &length,
&timestamp, status);
if (*status == 0) {
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
if (*status != 0) {
return;
@@ -502,6 +527,8 @@ void HAL_GetREVPHVersion(HAL_REVPHHandle handle, HAL_REVPHVersion* version,
version->hardwareMinor = result.hardware_minor;
version->hardwareMajor = result.hardware_major;
version->uniqueId = result.unique_id;
ph->versionInfo = *version;
}
int32_t HAL_GetREVPHSolenoids(HAL_REVPHHandle handle, int32_t* status) {

View File

@@ -74,6 +74,11 @@ typedef int32_t HAL_Bool;
#ifdef __cplusplus
#define HAL_ENUM(name) enum name : int32_t
#elif defined(__clang__)
#define HAL_ENUM(name) \
enum name : int32_t; \
typedef enum name name; \
enum name : int32_t
#else
#define HAL_ENUM(name) \
typedef int32_t name; \

View File

@@ -5,7 +5,7 @@ project(imgui-download NONE)
include(ExternalProject)
ExternalProject_Add(glfw3
GIT_REPOSITORY https://github.com/glfw/glfw.git
GIT_TAG 3.3.5
GIT_TAG 3.3.6
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/glfw-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/glfw-build"
CONFIGURE_COMMAND ""
@@ -23,7 +23,7 @@ ExternalProject_Add(gl3w
)
ExternalProject_Add(imgui
GIT_REPOSITORY https://github.com/ocornut/imgui.git
GIT_TAG v1.85
GIT_TAG v1.86
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/imgui-src"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/imgui-build"
CONFIGURE_COMMAND ""

View File

@@ -162,6 +162,7 @@ model {
lib project: ':wpilibNewCommands', library: 'wpilibNewCommands', linkage: 'shared'
lib project: ':wpilibc', library: 'wpilibc', linkage: 'shared'
lib project: ':wpimath', library: 'wpimath', linkage: 'shared'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
lib project: ':ntcore', library: 'ntcore', linkage: 'shared'
lib project: ':cscore', library: 'cscore', linkage: 'shared'
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
@@ -171,7 +172,6 @@ model {
project(':hal').addHalDependency(binary, 'shared')
project(':hal').addHalJniDependency(binary)
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'shared'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
} else {
@@ -209,11 +209,11 @@ model {
lib project: ':wpilibNewCommands', library: 'wpilibNewCommands', linkage: 'static'
lib project: ':wpilibc', library: 'wpilibc', linkage: 'static'
lib project: ':wpimath', library: 'wpimath', linkage: 'static'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'static'
lib project: ':ntcore', library: 'ntcore', linkage: 'static'
lib project: ':cscore', library: 'cscore', linkage: 'static'
project(':hal').addHalDependency(binary, 'static')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'static'
lib project: ':cameraserver', library: 'cameraserver', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}

View File

@@ -0,0 +1,29 @@
project(roborioteamnumbersetter)
include(CompileWarnings)
include(GenResources)
include(LinkMacOSGUI)
configure_file(src/main/generate/WPILibVersion.cpp.in WPILibVersion.cpp)
GENERATE_RESOURCES(src/main/native/resources generated/main/cpp RTNS rtns rtns_resources_src)
file(GLOB rtns_src src/main/native/cpp/*.cpp ${CMAKE_CURRENT_BINARY_DIR}/WPILibVersion.cpp)
if (WIN32)
set(rtns_rc src/main/native/win/roborioteamnumbersetter.rc)
elseif(APPLE)
set(MACOSX_BUNDLE_ICON_FILE glass.icns)
set(APP_ICON_MACOSX src/main/native/mac/rtns.icns)
set_source_files_properties(${APP_ICON_MACOSX} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
endif()
add_executable(roborioteamnumbersetter ${rtns_src} ${rtns_resources_src} ${rtns_rc} ${APP_ICON_MACOSX})
wpilib_link_macos_gui(roborioteamnumbersetter)
target_link_libraries(roborioteamnumbersetter libglass ${LIBSSH_LIBRARIES})
target_include_directories(roborioteamnumbersetter PRIVATE ${LIBSSH_INCLUDE_DIRS})
if (WIN32)
set_target_properties(roborioteamnumbersetter PROPERTIES WIN32_EXECUTABLE YES)
elseif(APPLE)
set_target_properties(roborioteamnumbersetter PROPERTIES MACOSX_BUNDLE YES OUTPUT_NAME "roborioTeamNumberSetter")
endif()

View File

@@ -13,7 +13,7 @@ nativeUtils {
niLibVersion = "2022.2.3"
opencvVersion = "4.5.2-1"
googleTestVersion = "1.9.0-5-437e100-1"
imguiVersion = "1.85-2"
imguiVersion = "1.86-1"
wpimathVersion = "-1"
}
}

View File

@@ -80,6 +80,14 @@
<Bug pattern="UC_USELESS_VOID_METHOD" />
<Class name="edu.wpi.first.wpilibj.templates.timed.Robot" />
</Match>
<Match>
<Bug pattern="URF_UNREAD_FIELD" />
<Class name="edu.wpi.first.wpilibj.ADIS16448_IMU" />
</Match>
<Match>
<Bug pattern="URF_UNREAD_FIELD" />
<Class name="edu.wpi.first.wpilibj.ADIS16470_IMU" />
</Match>
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
</Match>

View File

@@ -0,0 +1,42 @@
diff --git a/wpiutil/src/main/native/fmtlib/include/fmt/format-inl.h b/wpiutil/src/main/native/fmtlib/include/fmt/format-inl.h
index 2c51c50ae..cc89abdd3 100644
--- a/wpiutil/src/main/native/fmtlib/include/fmt/format-inl.h
+++ b/wpiutil/src/main/native/fmtlib/include/fmt/format-inl.h
@@ -92,8 +92,7 @@ FMT_FUNC void report_error(format_func func, int error_code,
// A wrapper around fwrite that throws on error.
inline void fwrite_fully(const void* ptr, size_t size, size_t count,
FILE* stream) {
- size_t written = std::fwrite(ptr, size, count, stream);
- if (written < count) FMT_THROW(system_error(errno, "cannot write to file"));
+ std::fwrite(ptr, size, count, stream);
}
#ifndef FMT_STATIC_THOUSANDS_SEPARATOR
diff --git a/wpiutil/src/main/native/fmtlib/include/fmt/xchar.h b/wpiutil/src/main/native/fmtlib/include/fmt/xchar.h
index 55825077f..9acb893fa 100644
--- a/wpiutil/src/main/native/fmtlib/include/fmt/xchar.h
+++ b/wpiutil/src/main/native/fmtlib/include/fmt/xchar.h
@@ -207,8 +207,7 @@ inline void vprint(std::FILE* f, wstring_view fmt, wformat_args args) {
wmemory_buffer buffer;
detail::vformat_to(buffer, fmt, args);
buffer.push_back(L'\0');
- if (std::fputws(buffer.data(), f) == -1)
- FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
+ std::fputws(buffer.data(), f);
}
inline void vprint(wstring_view fmt, wformat_args args) {
diff --git a/wpiutil/src/main/native/fmtlib/src/os.cpp b/wpiutil/src/main/native/fmtlib/src/os.cpp
index 04b4dc506..4eb3e1fdd 100644
--- a/wpiutil/src/main/native/fmtlib/src/os.cpp
+++ b/wpiutil/src/main/native/fmtlib/src/os.cpp
@@ -277,8 +277,7 @@ std::size_t file::read(void* buffer, std::size_t count) {
std::size_t file::write(const void* buffer, std::size_t count) {
rwresult result = 0;
FMT_RETRY(result, FMT_POSIX_CALL(write(fd_, buffer, convert_rwcount(count))));
- if (result < 0) FMT_THROW(system_error(errno, "cannot write to file"));
- return detail::to_unsigned(result);
+ return count;
}
file file::dup(int fd) {

View File

@@ -3,11 +3,11 @@
import os
import shutil
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if
from upstream_utils import setup_upstream_repo, comment_out_invalid_includes, walk_cwd_and_copy_if, apply_patches
def main():
root, repo = setup_upstream_repo("https://github.com/fmtlib/fmt", "8.0.1")
root, repo = setup_upstream_repo("https://github.com/fmtlib/fmt", "8.1.1")
wpiutil = os.path.join(root, "wpiutil")
# Delete old install
@@ -31,6 +31,9 @@ def main():
comment_out_invalid_includes(
f, [os.path.join(wpiutil, "src/main/native/fmtlib/include")])
apply_patches(root,
["upstream_utils/fmt-dont-throw-on-write-failure.patch"])
if __name__ == "__main__":
main()

View File

@@ -27,5 +27,4 @@ includeOtherLibs {
^imgui
^implot
^stb
^wpi/
}

View File

@@ -15,7 +15,7 @@ set_property(TARGET wpigui PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET wpigui PROPERTY FOLDER "libraries")
wpilib_target_warnings(wpigui)
target_link_libraries(wpigui PUBLIC imgui wpiutil)
target_link_libraries(wpigui PUBLIC imgui)
target_include_directories(wpigui PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/main/native/include>

View File

@@ -62,7 +62,6 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
}
binaries.all {
nativeUtils.useRequiredLibrary(it, 'imgui_static')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio || it.targetPlatform.name == nativeUtils.wpi.platforms.raspbian || it.targetPlatform.name == nativeUtils.wpi.platforms.aarch64bionic) {
it.buildable = false
return
@@ -120,7 +119,6 @@ if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxra
binaries.all {
lib library: 'wpigui'
nativeUtils.useRequiredLibrary(it, 'imgui_static')
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
}
}
}

View File

@@ -15,7 +15,6 @@
#include <imgui_internal.h>
#include <implot.h>
#include <stb_image.h>
#include <wpi/fs.h>
#include "wpigui_internal.h"
@@ -320,7 +319,7 @@ void gui::Main() {
// Delete the save file if requested.
if (!gContext->saveSettings && gContext->resetOnExit) {
fs::remove(fs::path{gContext->iniPath});
std::remove(gContext->iniPath.c_str());
}
glfwDestroyWindow(gContext->window);

View File

@@ -75,6 +75,7 @@ model {
if (it.component.name == "${nativeName}Dev") {
lib project: ':ntcore', library: 'ntcoreJNIShared', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutilJNIShared', linkage: 'shared'
project(':hal').addHalJniDependency(it)
}

View File

@@ -14,6 +14,8 @@ import java.util.function.BooleanSupplier;
*
* <p>Commands are run synchronously from the main robot loop; no multithreading is used, unless
* specified explicitly from the command implementation.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public interface Command {
/** The initial subroutine of a command. Called once when the command is initially scheduled. */

View File

@@ -10,7 +10,11 @@ import edu.wpi.first.util.sendable.SendableRegistry;
import java.util.HashSet;
import java.util.Set;
/** A {@link Sendable} base class for {@link Command}s. */
/**
* A {@link Sendable} base class for {@link Command}s.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class CommandBase implements Sendable, Command {
protected Set<Subsystem> m_requirements = new HashSet<>();

View File

@@ -13,6 +13,8 @@ import java.util.WeakHashMap;
* A base for CommandGroups. Statically tracks commands that have been allocated to groups to ensure
* those commands are not also used independently, which can result in inconsistent command state
* and unpredictable execution.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class CommandGroupBase extends CommandBase {
private static final Set<Command> m_groupedCommands =

View File

@@ -33,6 +33,8 @@ import java.util.function.Consumer;
* synchronously from the main loop. Subsystems should be registered with the scheduler using {@link
* CommandScheduler#registerSubsystem(Subsystem...)} in order for their {@link Subsystem#periodic()}
* methods to be called and for their default commands to be scheduled.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public final class CommandScheduler implements NTSendable, AutoCloseable {
/** The Singleton Instance. */

View File

@@ -8,6 +8,8 @@ import edu.wpi.first.wpilibj.Timer;
/**
* Class that holds scheduling state for a command. Used internally by the {@link CommandScheduler}.
*
* <p>This class is provided by the NewCommands VendorDep
*/
class CommandState {
// The time since this command was initialized.

View File

@@ -21,6 +21,8 @@ import java.util.function.BooleanSupplier;
* scheduled individually.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ConditionalCommand extends CommandBase {
private final Command m_onTrue;

View File

@@ -14,6 +14,8 @@ import java.util.function.Consumer;
* the constructor. Useful for inline definitions of complex commands - note, however, that if a
* command is beyond a certain complexity it is usually better practice to write a proper class for
* it than to inline it.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class FunctionalCommand extends CommandBase {
protected final Runnable m_onInit;

View File

@@ -10,6 +10,8 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
* A Command that runs instantly; it will initialize, execute once, and end on the same iteration of
* the scheduler. Users can either pass in a Runnable and a set of requirements, or else subclass
* this command if desired.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class InstantCommand extends CommandBase {
private final Runnable m_toRun;

View File

@@ -35,6 +35,8 @@ import java.util.function.Supplier;
*
* <p>The robot angle controller does not follow the angle given by the trajectory but rather goes
* to the angle given in the final state of the trajectory.
*
* <p>This class is provided by the NewCommands VendorDep
*/
@SuppressWarnings("MemberName")
public class MecanumControllerCommand extends CommandBase {
@@ -359,7 +361,7 @@ public class MecanumControllerCommand extends CommandBase {
m_controller.calculate(m_pose.get(), desiredState, m_desiredRotation.get());
var targetWheelSpeeds = m_kinematics.toWheelSpeeds(targetChassisSpeeds);
targetWheelSpeeds.normalize(m_maxWheelVelocityMetersPerSecond);
targetWheelSpeeds.desaturate(m_maxWheelVelocityMetersPerSecond);
var frontLeftSpeedSetpoint = targetWheelSpeeds.frontLeftMetersPerSecond;
var rearLeftSpeedSetpoint = targetWheelSpeeds.rearLeftMetersPerSecond;

View File

@@ -14,6 +14,8 @@ import edu.wpi.first.wpilibj.Notifier;
* <p>WARNING: Do not use this class unless you are confident in your ability to make the executed
* code thread-safe. If you do not know what "thread-safe" means, that is a good sign that you
* should not use this class.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class NotifierCommand extends CommandBase {
protected final Notifier m_notifier;

View File

@@ -15,6 +15,8 @@ import java.util.function.DoubleSupplier;
* A command that controls an output with a {@link PIDController}. Runs forever by default - to add
* exit conditions and/or other behavior, subclass this class. The controller calculation and output
* are performed synchronously in the command's execute() method.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class PIDCommand extends CommandBase {
protected final PIDController m_controller;

View File

@@ -11,6 +11,8 @@ import edu.wpi.first.math.controller.PIDController;
/**
* A subsystem that uses a {@link PIDController} to control an output. The controller is run
* synchronously from the subsystem's periodic() method.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class PIDSubsystem extends SubsystemBase {
protected final PIDController m_controller;

View File

@@ -12,6 +12,8 @@ import java.util.Map;
* A CommandGroup that runs a set of commands in parallel, ending when the last command ends.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ParallelCommandGroup extends CommandGroupBase {
// maps commands in this group to whether they are still running

View File

@@ -13,6 +13,8 @@ import java.util.Map;
* "deadline") ends, interrupting all other commands that are still running at that point.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ParallelDeadlineGroup extends CommandGroupBase {
// maps commands in this group to whether they are still running

View File

@@ -13,6 +13,8 @@ import java.util.Set;
* and interrupting all the others.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ParallelRaceGroup extends CommandGroupBase {
private final Set<Command> m_commands = new HashSet<>();

View File

@@ -14,6 +14,8 @@ import static edu.wpi.first.wpilibj2.command.CommandGroupBase.requireUngrouped;
* cannot be added to any other groups, or scheduled individually.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class PerpetualCommand extends CommandBase {
protected final Command m_command;

View File

@@ -4,7 +4,11 @@
package edu.wpi.first.wpilibj2.command;
/** A command that prints a string when initialized. */
/**
* A command that prints a string when initialized.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class PrintCommand extends InstantCommand {
/**
* Creates a new a PrintCommand.

View File

@@ -17,6 +17,8 @@ import java.util.function.Supplier;
* A command that controls an output with a {@link ProfiledPIDController}. Runs forever by default -
* to add exit conditions and/or other behavior, subclass this class. The controller calculation and
* output are performed synchronously in the command's execute() method.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ProfiledPIDCommand extends CommandBase {
protected final ProfiledPIDController m_controller;

View File

@@ -13,6 +13,8 @@ import edu.wpi.first.math.trajectory.TrapezoidProfile;
/**
* A subsystem that uses a {@link ProfiledPIDController} to control an output. The controller is run
* synchronously from the subsystem's periodic() method.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class ProfiledPIDSubsystem extends SubsystemBase {
protected final ProfiledPIDController m_controller;

View File

@@ -10,6 +10,8 @@ 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.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ProxyScheduleCommand extends CommandBase {
private final Set<Command> m_toSchedule;

View File

@@ -29,6 +29,8 @@ import java.util.function.Supplier;
* <p>Advanced teams seeking more flexibility (for example, those who wish to use the onboard PID
* functionality of a "smart" motor controller) may use the secondary constructor that omits the PID
* and feedforward functionality, returning only the raw wheel speeds from the RAMSETE controller.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class RamseteCommand extends CommandBase {
private final Timer m_timer = new Timer();

View File

@@ -12,6 +12,8 @@ import java.util.function.BooleanSupplier;
* A command that runs a Runnable continuously. Has no end condition as-is; either subclass it or
* use {@link Command#withTimeout(double)} or {@link Command#withInterrupt(BooleanSupplier)} to give
* it one. If you only wish to execute a Runnable once, use {@link InstantCommand}.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class RunCommand extends CommandBase {
protected final Runnable m_toRun;

View File

@@ -10,6 +10,8 @@ import java.util.Set;
* Schedules the given commands when this command is initialized. Useful for forking off from
* CommandGroups. Note that if run from a CommandGroup, the group will not know about the status of
* the scheduled commands, and will treat this command as finishing instantly.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class ScheduleCommand extends CommandBase {
private final Set<Command> m_toSchedule;

View File

@@ -23,6 +23,8 @@ import java.util.function.Supplier;
* scheduled individually.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class SelectCommand extends CommandBase {
private final Map<Object, Command> m_commands;

View File

@@ -11,6 +11,8 @@ import java.util.List;
* A CommandGroups that runs a list of commands in sequence.
*
* <p>As a rule, CommandGroups require the union of the requirements of their component commands.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class SequentialCommandGroup extends CommandGroupBase {
private final List<Command> m_commands = new ArrayList<>();

View File

@@ -11,6 +11,8 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
* Useful for running and then stopping a motor, or extending and then retracting a solenoid. Has no
* end condition as-is; either subclass it or use {@link Command#withTimeout(double)} or {@link
* Command#withInterrupt(java.util.function.BooleanSupplier)} to give it one.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class StartEndCommand extends CommandBase {
protected final Runnable m_onInit;

View File

@@ -18,6 +18,8 @@ package edu.wpi.first.wpilibj2.command;
* Subsystem#periodic()} method to be called. It is recommended that this method be called from the
* constructor of users' Subsystem implementations. The {@link SubsystemBase} class offers a simple
* base for user implementations that handles this.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public interface Subsystem {
/**

View File

@@ -11,6 +11,8 @@ import edu.wpi.first.util.sendable.SendableRegistry;
/**
* A base for subsystems that handles registration in the constructor, and provides a more intuitive
* method for setting the default command.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class SubsystemBase implements Subsystem, Sendable {
/** Constructor. */

View File

@@ -28,6 +28,8 @@ import java.util.function.Supplier;
*
* <p>The robot angle controller does not follow the angle given by the trajectory but rather goes
* to the angle given in the final state of the trajectory.
*
* <p>This class is provided by the NewCommands VendorDep
*/
@SuppressWarnings("MemberName")
public class SwerveControllerCommand extends CommandBase {

View File

@@ -13,6 +13,8 @@ import java.util.function.Consumer;
/**
* A command that runs a {@link TrapezoidProfile}. Useful for smoothly controlling mechanism motion.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class TrapezoidProfileCommand extends CommandBase {
private final TrapezoidProfile m_profile;

View File

@@ -11,6 +11,8 @@ import edu.wpi.first.math.trajectory.TrapezoidProfile;
/**
* A subsystem that generates and runs trapezoidal motion profiles automatically. The user specifies
* how to use the current state of the motion profile by overriding the `useState` method.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public abstract class TrapezoidProfileSubsystem extends SubsystemBase {
private final double m_period;

View File

@@ -10,6 +10,8 @@ import edu.wpi.first.wpilibj.Timer;
/**
* A command that does nothing but takes a specified amount of time to finish. Useful for
* CommandGroups. Can also be subclassed to make a command with an internal timer.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class WaitCommand extends CommandBase {
protected Timer m_timer = new Timer();

View File

@@ -12,6 +12,8 @@ import java.util.function.BooleanSupplier;
/**
* A command that does nothing but ends after a specified match time or condition. Useful for
* CommandGroups.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class WaitUntilCommand extends CommandBase {
private final BooleanSupplier m_condition;

View File

@@ -17,6 +17,8 @@ import java.util.function.BooleanSupplier;
* <p>This class represents a subclass of Trigger that is specifically aimed at buttons on an
* operator interface as a common use case of the more generalized Trigger objects. This is a simple
* wrapper around Trigger with the method names renamed to fit the Button object use.
*
* <p>This class is provided by the OldCommands VendorDep
*/
public class Button extends Trigger {
/**

View File

@@ -7,6 +7,8 @@ package edu.wpi.first.wpilibj2.command.button;
/**
* 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.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class InternalButton extends Button {
private boolean m_pressed;

View File

@@ -8,7 +8,11 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
import edu.wpi.first.wpilibj.GenericHID;
/** A {@link Button} that gets its state from a {@link GenericHID}. */
/**
* A {@link Button} that gets its state from a {@link GenericHID}.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class JoystickButton extends Button {
private final GenericHID m_joystick;
private final int m_buttonNumber;

View File

@@ -8,7 +8,11 @@ import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
import edu.wpi.first.networktables.NetworkTableInstance;
/** A {@link Button} that uses a {@link NetworkTable} boolean field. */
/**
* A {@link Button} that uses a {@link NetworkTable} boolean field.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class NetworkButton extends Button {
private final NetworkTableEntry m_entry;

View File

@@ -8,7 +8,11 @@ import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
import edu.wpi.first.wpilibj.GenericHID;
/** A {@link Button} that gets its state from a POV on a {@link GenericHID}. */
/**
* A {@link Button} that gets its state from a POV on a {@link GenericHID}.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class POVButton extends Button {
private final GenericHID m_joystick;
private final int m_angle;

View File

@@ -6,7 +6,7 @@ package edu.wpi.first.wpilibj2.command.button;
import static edu.wpi.first.wpilibj.util.ErrorMessages.requireNonNullParam;
import edu.wpi.first.wpilibj.Debouncer;
import edu.wpi.first.math.filter.Debouncer;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.InstantCommand;
@@ -23,8 +23,10 @@ import java.util.function.BooleanSupplier;
* (for instance, if they want to react to the user holding a button while the robot is reading a
* certain sensor input). For this, they only have to write the {@link Trigger#get()} method to get
* the full functionality of the Trigger class.
*
* <p>This class is provided by the NewCommands VendorDep
*/
public class Trigger {
public class Trigger implements BooleanSupplier {
private final BooleanSupplier m_isActive;
/**
@@ -49,9 +51,25 @@ public class Trigger {
*
* <p>This method will be called repeatedly a command is linked to the Trigger.
*
* <p>Functionally identical to {@link Trigger#getAsBoolean()}.
*
* @return whether or not the trigger condition is active.
*/
public boolean get() {
return this.getAsBoolean();
}
/**
* Returns whether or not the trigger is active.
*
* <p>This method will be called repeatedly a command is linked to the Trigger.
*
* <p>Functionally identical to {@link Trigger#get()}.
*
* @return whether or not the trigger condition is active.
*/
@Override
public boolean getAsBoolean() {
return m_isActive.getAsBoolean();
}
@@ -365,13 +383,25 @@ public class Trigger {
* Creates a new debounced trigger from this trigger - it will become active when this trigger has
* been active for longer than the specified period.
*
* @param seconds the debounce period
* @return the debounced trigger
* @param seconds The debounce period.
* @return The debounced trigger (rising edges debounced only)
*/
public Trigger debounce(double seconds) {
return debounce(seconds, Debouncer.DebounceType.kRising);
}
/**
* Creates a new debounced trigger from this trigger - it will become active when this trigger has
* been active for longer than the specified period.
*
* @param seconds The debounce period.
* @param type The debounce type.
* @return The debounced trigger.
*/
public Trigger debounce(double seconds, Debouncer.DebounceType type) {
return new Trigger(
new BooleanSupplier() {
Debouncer m_debouncer = new Debouncer(seconds);
Debouncer m_debouncer = new Debouncer(seconds, type);
@Override
public boolean getAsBoolean() {

View File

@@ -278,7 +278,7 @@ void MecanumControllerCommand::Execute() {
m_controller.Calculate(m_pose(), m_desiredState, m_desiredRotation());
auto targetWheelSpeeds = m_kinematics.ToWheelSpeeds(targetChassisSpeeds);
targetWheelSpeeds.Normalize(m_maxWheelVelocity);
targetWheelSpeeds.Desaturate(m_maxWheelVelocity);
auto frontLeftSpeedSetpoint = targetWheelSpeeds.frontLeft;
auto rearLeftSpeedSetpoint = targetWheelSpeeds.rearLeft;

View File

@@ -4,7 +4,7 @@
#include "frc2/command/button/Trigger.h"
#include <frc/Debouncer.h>
#include <frc/filter/Debouncer.h>
#include "frc2/command/InstantCommand.h"
@@ -139,8 +139,10 @@ Trigger Trigger::CancelWhenActive(Command* command) {
return *this;
}
Trigger Trigger::Debounce(units::second_t debounceTime) {
return Trigger([debouncer = frc::Debouncer(debounceTime), *this]() mutable {
return debouncer.Calculate(m_isActive());
});
Trigger Trigger::Debounce(units::second_t debounceTime,
frc::Debouncer::DebounceType type) {
return Trigger(
[debouncer = frc::Debouncer(debounceTime, type), *this]() mutable {
return debouncer.Calculate(m_isActive());
});
}

View File

@@ -42,6 +42,8 @@ class ProxyScheduleCommand;
* <p>Note: ALWAYS create a subclass by extending CommandHelper<Base, Subclass>,
* or decorators will not function!
*
* This class is provided by the NewCommands VendorDep
*
* @see CommandScheduler
* @see CommandHelper
*/

View File

@@ -18,6 +18,8 @@
namespace frc2 {
/**
* A Sendable base class for Commands.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandBase : public Command,
public wpi::Sendable,

View File

@@ -18,6 +18,8 @@ namespace frc2 {
* A base for CommandGroups. Statically tracks commands that have been
* allocated to groups to ensure those commands are not also used independently,
* which can result in inconsistent command state and unpredictable execution.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandGroupBase : public CommandBase {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
*
* <p>Note: ALWAYS create a subclass by extending CommandHelper<Base, Subclass>,
* or decorators will not function!
*
* This class is provided by the NewCommands VendorDep
*/
template <typename Base, typename CRTP,
typename = std::enable_if_t<std::is_base_of_v<Command, Base>>>

View File

@@ -26,6 +26,8 @@ class Subsystem;
* commands synchronously from the main loop. Subsystems should be registered
* with the scheduler using RegisterSubsystem() in order for their Periodic()
* methods to be called and for their default commands to be scheduled.
*
* This class is provided by the NewCommands VendorDep
*/
class CommandScheduler final : public nt::NTSendable,
public wpi::SendableHelper<CommandScheduler> {

View File

@@ -10,6 +10,8 @@ namespace frc2 {
/**
* Class that holds scheduling state for a command. Used internally by the
* CommandScheduler
*
* This class is provided by the NewCommands VendorDep
*/
class CommandState final {
public:

View File

@@ -29,6 +29,8 @@ namespace frc2 {
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*
* @see ScheduleCommand
*/
class ConditionalCommand

View File

@@ -19,6 +19,8 @@ namespace frc2 {
* complex commands - note, however, that if a command is beyond a certain
* complexity it is usually better practice to write a proper class for it than
* to inline it.
*
* This class is provided by the NewCommands VendorDep
*/
class FunctionalCommand : public CommandHelper<CommandBase, FunctionalCommand> {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* A Command that runs instantly; it will initialize, execute once, and end on
* the same iteration of the scheduler. Users can either pass in a Runnable and
* a set of requirements, or else subclass this command if desired.
*
* This class is provided by the NewCommands VendorDep
*/
class InstantCommand : public CommandHelper<CommandBase, InstantCommand> {
public:

View File

@@ -47,6 +47,8 @@ namespace frc2 {
* <p>The robot angle controller does not follow the angle given by
* the trajectory but rather goes to the angle given in the final state of the
* trajectory.
*
* This class is provided by the NewCommands VendorDep
*/
class MecanumControllerCommand
: public CommandHelper<CommandBase, MecanumControllerCommand> {

View File

@@ -24,6 +24,8 @@ namespace frc2 {
* <p>WARNING: Do not use this class unless you are confident in your ability to
* make the executed code thread-safe. If you do not know what "thread-safe"
* means, that is a good sign that you should not use this class.
*
* This class is provided by the NewCommands VendorDep
*/
class NotifierCommand : public CommandHelper<CommandBase, NotifierCommand> {
public:

View File

@@ -20,6 +20,8 @@ namespace frc2 {
* The controller calculation and output are performed synchronously in the
* command's execute() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see PIDController
*/
class PIDCommand : public CommandHelper<CommandBase, PIDCommand> {

View File

@@ -13,6 +13,8 @@ namespace frc2 {
* A subsystem that uses a PIDController to control an output. The controller
* is run synchronously from the subsystem's periodic() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see PIDController
*/
class PIDSubsystem : public SubsystemBase {

View File

@@ -23,6 +23,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelCommandGroup
: public CommandHelper<CommandGroupBase, ParallelCommandGroup> {

View File

@@ -24,6 +24,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelDeadlineGroup
: public CommandHelper<CommandGroupBase, ParallelDeadlineGroup> {

View File

@@ -23,6 +23,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class ParallelRaceGroup
: public CommandHelper<CommandGroupBase, ParallelRaceGroup> {

View File

@@ -26,6 +26,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class PerpetualCommand : public CommandHelper<CommandBase, PerpetualCommand> {
public:

View File

@@ -12,6 +12,8 @@
namespace frc2 {
/**
* A command that prints a string when initialized.
*
* This class is provided by the NewCommands VendorDep
*/
class PrintCommand : public CommandHelper<InstantCommand, PrintCommand> {
public:

View File

@@ -22,6 +22,8 @@ namespace frc2 {
* class. The controller calculation and output are performed synchronously in
* the command's execute() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see ProfiledPIDController<Distance>
*/
template <class Distance>
@@ -95,7 +97,7 @@ class ProfiledPIDCommand
std::initializer_list<Subsystem*> requirements)
: ProfiledPIDCommand(
controller, measurementSource,
[&goalSource]() {
[goalSource = std::move(goalSource)]() {
return State{goalSource(), Velocity_t{0}};
},
useOutput, requirements) {}
@@ -117,7 +119,7 @@ class ProfiledPIDCommand
wpi::span<Subsystem* const> requirements = {})
: ProfiledPIDCommand(
controller, measurementSource,
[&goalSource]() {
[goalSource = std::move(goalSource)]() {
return State{goalSource(), Velocity_t{0}};
},
useOutput, requirements) {}

View File

@@ -14,6 +14,8 @@ namespace frc2 {
* A subsystem that uses a ProfiledPIDController to control an output. The
* controller is run synchronously from the subsystem's periodic() method.
*
* This class is provided by the NewCommands VendorDep
*
* @see ProfiledPIDController
*/
template <class Distance>

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* 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.
*
* This class is provided by the NewCommands VendorDep
*/
class ProxyScheduleCommand
: public CommandHelper<CommandBase, ProxyScheduleCommand> {

View File

@@ -37,6 +37,8 @@ namespace frc2 {
* secondary constructor that omits the PID and feedforward functionality,
* returning only the raw wheel speeds from the RAMSETE controller.
*
* This class is provided by the NewCommands VendorDep
*
* @see RamseteController
* @see Trajectory
*/

View File

@@ -18,6 +18,8 @@ namespace frc2 {
* either subclass it or use Command.WithTimeout() or
* Command.WithInterrupt() to give it one. If you only wish
* to execute a Runnable once, use InstantCommand.
*
* This class is provided by the NewCommands VendorDep
*/
class RunCommand : public CommandHelper<CommandBase, RunCommand> {
public:

View File

@@ -17,6 +17,8 @@ namespace frc2 {
* forking off from CommandGroups. Note that if run from a CommandGroup, the
* group will not know about the status of the scheduled commands, and will
* treat this command as finishing instantly.
*
* This class is provided by the NewCommands VendorDep
*/
class ScheduleCommand : public CommandHelper<CommandBase, ScheduleCommand> {
public:

View File

@@ -35,6 +35,8 @@ namespace frc2 {
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
template <typename Key>
class SelectCommand : public CommandHelper<CommandBase, SelectCommand<Key>> {

View File

@@ -29,6 +29,8 @@ const size_t invalid_index = std::numeric_limits<size_t>::max();
*
* <p>As a rule, CommandGroups require the union of the requirements of their
* component commands.
*
* This class is provided by the NewCommands VendorDep
*/
class SequentialCommandGroup
: public CommandHelper<CommandGroupBase, SequentialCommandGroup> {

View File

@@ -19,6 +19,8 @@ namespace frc2 {
* extending and then retracting a solenoid. Has no end condition as-is; either
* subclass it or use Command.WithTimeout() or Command.WithInterrupt() to give
* it one.
*
* This class is provided by the NewCommands VendorDep
*/
class StartEndCommand : public CommandHelper<CommandBase, StartEndCommand> {
public:

View File

@@ -29,6 +29,8 @@ class Command;
* SubsystemBase class offers a simple base for user implementations
* that handles this.
*
* This class is provided by the NewCommands VendorDep
*
* @see Command
* @see CommandScheduler
* @see SubsystemBase

View File

@@ -16,6 +16,8 @@ namespace frc2 {
/**
* A base for subsystems that handles registration in the constructor, and
* provides a more intuitive method for setting the default command.
*
* This class is provided by the NewCommands VendorDep
*/
class SubsystemBase : public Subsystem,
public wpi::Sendable,

Some files were not shown because too many files have changed in this diff Show More