[cscore, wpilibcExamples] Use double-quote includes for wpi/ (#8346)

Use ERR and WARN in cscore to avoid conflict with Windows headers.
This commit is contained in:
Peter Johnson
2025-11-08 16:58:51 -08:00
committed by GitHub
parent fc4e922206
commit 5c9c45fadb
226 changed files with 868 additions and 951 deletions

View File

@@ -41,5 +41,4 @@ includeOtherLibs {
^imgui
^support/
^tcpsockets/
^wpi/net/
}

View File

@@ -10,7 +10,6 @@
#include <vector>
#include <fmt/format.h>
#include <wpi/net/TCPConnector.h>
#include "Instance.hpp"
#include "JpegUtil.hpp"
@@ -18,6 +17,7 @@
#include "Notifier.hpp"
#include "Telemetry.hpp"
#include "c_util.hpp"
#include "wpi/net/TCPConnector.h"
#include "wpi/util/MemAlloc.hpp"
#include "wpi/util/StringExtras.hpp"
#include "wpi/util/timestamp.h"

View File

@@ -15,10 +15,9 @@
#include <thread>
#include <vector>
#include <wpi/net/HttpUtil.hpp>
#include "SourceImpl.hpp"
#include "wpi/cs/cscore_cpp.hpp"
#include "wpi/net/HttpUtil.hpp"
#include "wpi/util/StringMap.hpp"
#include "wpi/util/condition_variable.hpp"
#include "wpi/util/raw_istream.hpp"

View File

@@ -8,8 +8,6 @@
#include <memory>
#include <utility>
#include <wpi/net/EventLoopRunner.hpp>
#include "Log.hpp"
#include "NetworkListener.hpp"
#include "Notifier.hpp"
@@ -18,6 +16,7 @@
#include "Telemetry.hpp"
#include "UnlimitedHandleResource.hpp"
#include "UsbCameraListener.hpp"
#include "wpi/net/EventLoopRunner.hpp"
#include "wpi/util/Logger.hpp"
namespace wpi::cs {

View File

@@ -30,10 +30,8 @@ inline void NamedLog(wpi::util::Logger& logger, unsigned int level,
#define LOG(level, format, ...) \
WPI_LOG(m_logger, level, format __VA_OPT__(, ) __VA_ARGS__)
#undef ERROR
#define ERROR(format, ...) \
WPI_ERROR(m_logger, format __VA_OPT__(, ) __VA_ARGS__)
#define WARNING(format, ...) \
#define ERR(format, ...) WPI_ERROR(m_logger, format __VA_OPT__(, ) __VA_ARGS__)
#define WARN(format, ...) \
WPI_WARNING(m_logger, format __VA_OPT__(, ) __VA_ARGS__)
#define INFO(format, ...) WPI_INFO(m_logger, format __VA_OPT__(, ) __VA_ARGS__)

View File

@@ -9,11 +9,6 @@
#include <string>
#include <utility>
#include <wpi/net/HttpUtil.hpp>
#include <wpi/net/TCPAcceptor.h>
#include <wpi/net/raw_socket_istream.hpp>
#include <wpi/net/raw_socket_ostream.hpp>
#include "Instance.hpp"
#include "JpegUtil.hpp"
#include "Log.hpp"
@@ -21,6 +16,10 @@
#include "SourceImpl.hpp"
#include "c_util.hpp"
#include "wpi/cs/cscore_cpp.hpp"
#include "wpi/net/HttpUtil.hpp"
#include "wpi/net/TCPAcceptor.h"
#include "wpi/net/raw_socket_istream.hpp"
#include "wpi/net/raw_socket_ostream.hpp"
#include "wpi/util/SmallString.hpp"
#include "wpi/util/StringExtras.hpp"
#include "wpi/util/fmt/raw_ostream.hpp"

View File

@@ -12,11 +12,10 @@
#include <thread>
#include <vector>
#include <wpi/net/NetworkAcceptor.hpp>
#include <wpi/net/NetworkStream.hpp>
#include <wpi/net/raw_socket_ostream.hpp>
#include "SinkImpl.hpp"
#include "wpi/net/NetworkAcceptor.hpp"
#include "wpi/net/NetworkStream.hpp"
#include "wpi/net/raw_socket_ostream.hpp"
#include "wpi/util/SafeThread.hpp"
#include "wpi/util/SmallVector.hpp"
#include "wpi/util/raw_istream.hpp"

View File

@@ -8,8 +8,6 @@
#include <string>
#include <vector>
#include <wpi/net/hostname.hpp>
#include "Handle.hpp"
#include "Instance.hpp"
#include "NetworkListener.hpp"
@@ -18,6 +16,7 @@
#include "SinkImpl.hpp"
#include "SourceImpl.hpp"
#include "Telemetry.hpp"
#include "wpi/net/hostname.hpp"
#include "wpi/util/SmallString.hpp"
#include "wpi/util/json.hpp"

View File

@@ -70,15 +70,14 @@ void NetworkListener::Impl::Thread::Main() {
// Create event socket so we can be shut down
m_command_fd = ::eventfd(0, 0);
if (m_command_fd < 0) {
ERROR("NetworkListener: could not create eventfd: {}",
std::strerror(errno));
ERR("NetworkListener: could not create eventfd: {}", std::strerror(errno));
return;
}
// Create netlink socket
int sd = ::socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sd < 0) {
ERROR("NetworkListener: could not create socket: {}", std::strerror(errno));
ERR("NetworkListener: could not create socket: {}", std::strerror(errno));
::close(m_command_fd);
m_command_fd = -1;
return;
@@ -91,7 +90,7 @@ void NetworkListener::Impl::Thread::Main() {
addr.nl_groups = RTMGRP_LINK | RTMGRP_IPV4_IFADDR;
// NOLINTNEXTLINE(modernize-avoid-bind)
if (bind(sd, reinterpret_cast<struct sockaddr*>(&addr), sizeof(addr)) < 0) {
ERROR("NetworkListener: could not create socket: {}", std::strerror(errno));
ERR("NetworkListener: could not create socket: {}", std::strerror(errno));
::close(sd);
::close(m_command_fd);
m_command_fd = -1;
@@ -114,7 +113,7 @@ void NetworkListener::Impl::Thread::Main() {
int nfds = std::max(m_command_fd, sd) + 1;
if (::select(nfds, &readfds, nullptr, nullptr, &tv) < 0) {
ERROR("NetworkListener: select(): {}", std::strerror(errno));
ERR("NetworkListener: select(): {}", std::strerror(errno));
break; // XXX: is this the right thing to do here?
}
@@ -135,8 +134,7 @@ void NetworkListener::Impl::Thread::Main() {
if (errno == EWOULDBLOCK || errno == EAGAIN) {
continue;
}
ERROR("NetworkListener: could not read netlink: {}",
std::strerror(errno));
ERR("NetworkListener: could not read netlink: {}", std::strerror(errno));
break; // XXX: is this the right thing to do here?
}
if (len == 0) {

View File

@@ -6,11 +6,10 @@
#include <memory>
#include <wpi/net/EventLoopRunner.hpp>
#include <wpi/net/uv/FsEvent.hpp>
#include <wpi/net/uv/Timer.hpp>
#include "Notifier.hpp"
#include "wpi/net/EventLoopRunner.hpp"
#include "wpi/net/uv/FsEvent.hpp"
#include "wpi/net/uv/Timer.hpp"
#include "wpi/util/StringExtras.hpp"
using namespace wpi::cs;

View File

@@ -12,5 +12,4 @@ includeOtherLibs {
^fmt/
^gtest/
^opencv2/
^wpi/
}

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
/**
* An example command.

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/InstantCommand.hpp>
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/InstantCommand.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/ParallelCommandGroup.hpp>
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/ParallelCommandGroup.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,7 +4,7 @@
#include "ReplaceMeParallelDeadlineGroup.hpp"
#include <wpi/commands2/InstantCommand.hpp>
#include "wpi/commands2/InstantCommand.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/ParallelDeadlineGroup.hpp>
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/ParallelDeadlineGroup.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/ParallelRaceGroup.hpp>
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/ParallelRaceGroup.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/SequentialCommandGroup.hpp>
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/SequentialCommandGroup.hpp"
// NOTE: Consider using this command inline, rather than writing a subclass.
// For more information, see:

View File

@@ -4,7 +4,7 @@
#pragma once
#include <wpi/commands2/SubsystemBase.hpp>
#include "wpi/commands2/SubsystemBase.hpp"
class ReplaceMeSubsystem2 : public wpi::cmd::SubsystemBase {
public:

View File

@@ -6,9 +6,9 @@
#include <array>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/led/AddressableLED.hpp>
#include <wpi/hardware/led/LEDPattern.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/led/AddressableLED.hpp"
#include "wpi/hardware/led/LEDPattern.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -12,16 +12,17 @@
#include <opencv2/core/core.hpp>
#include <opencv2/core/types.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <wpi/apriltag/AprilTagDetection.hpp>
#include <wpi/apriltag/AprilTagDetector.hpp>
#include <wpi/apriltag/AprilTagPoseEstimator.hpp>
#include <wpi/cameraserver/CameraServer.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/geometry/Transform3d.hpp>
#include <wpi/nt/IntegerArrayTopic.hpp>
#include <wpi/nt/NetworkTableInstance.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/units/length.hpp>
#include "wpi/apriltag/AprilTagDetection.hpp"
#include "wpi/apriltag/AprilTagDetector.hpp"
#include "wpi/apriltag/AprilTagPoseEstimator.hpp"
#include "wpi/cameraserver/CameraServer.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/geometry/Transform3d.hpp"
#include "wpi/nt/IntegerArrayTopic.hpp"
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/length.hpp"
/**
* This is a demo program showing the detection of AprilTags.

View File

@@ -2,10 +2,10 @@
// 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.
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
/**
* This is a demo program showing the use of the DifferentialDrive class.

View File

@@ -2,10 +2,10 @@
// 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.
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
/**
* This is a demo program showing the use of the DifferentialDrive class.

View File

@@ -4,10 +4,10 @@
#include "subsystems/Arm.hpp"
#include <wpi/math/util/StateSpaceUtil.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/RobotController.hpp>
#include <wpi/util/Preferences.hpp>
#include "wpi/math/util/StateSpaceUtil.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/util/Preferences.hpp"
Arm::Arm() {
m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse);

View File

@@ -6,12 +6,12 @@
#include <numbers>
#include <wpi/units/angle.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/mass.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/units/angle.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/mass.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
/**
* The Constants header provides a convenient place for teams to hold robot-wide

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "subsystems/Arm.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a sample program to demonstrate the use of arm simulation.

View File

@@ -4,21 +4,20 @@
#pragma once
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/ArmFeedforward.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/simulation/BatterySim.hpp>
#include <wpi/simulation/EncoderSim.hpp>
#include <wpi/simulation/PWMSim.hpp>
#include <wpi/simulation/RoboRioSim.hpp>
#include <wpi/simulation/SingleJointedArmSim.hpp>
#include <wpi/smartdashboard/Mechanism2d.hpp>
#include <wpi/smartdashboard/MechanismLigament2d.hpp>
#include <wpi/smartdashboard/MechanismRoot2d.hpp>
#include <wpi/units/length.hpp>
#include "Constants.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/ArmFeedforward.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/PWMSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/simulation/SingleJointedArmSim.hpp"
#include "wpi/smartdashboard/Mechanism2d.hpp"
#include "wpi/smartdashboard/MechanismLigament2d.hpp"
#include "wpi/smartdashboard/MechanismRoot2d.hpp"
#include "wpi/units/length.hpp"
class Arm {
public:

View File

@@ -2,9 +2,9 @@
// 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.
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/power/PowerDistribution.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/power/PowerDistribution.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
/**
* This is a sample program showing how to retrieve information from the Power

View File

@@ -2,11 +2,10 @@
// 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.
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/filter/SlewRateLimiter.hpp>
#include "Drivetrain.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/filter/SlewRateLimiter.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -6,17 +6,17 @@
#include <numbers>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/kinematics/DifferentialDriveKinematics.hpp>
#include <wpi/math/kinematics/DifferentialDriveOdometry.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/units/angular_velocity.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/velocity.hpp>
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp"
#include "wpi/math/kinematics/DifferentialDriveOdometry.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/angular_velocity.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/velocity.hpp"
/**
* Represents a differential drive style drivetrain.

View File

@@ -2,11 +2,10 @@
// 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.
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/filter/SlewRateLimiter.hpp>
#include "Drivetrain.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/filter/SlewRateLimiter.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -6,33 +6,33 @@
#include <numbers>
#include <wpi/apriltag/AprilTagFieldLayout.hpp>
#include <wpi/apriltag/AprilTagFields.hpp>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/estimator/DifferentialDrivePoseEstimator.hpp>
#include <wpi/math/geometry/Pose2d.hpp>
#include <wpi/math/geometry/Pose3d.hpp>
#include <wpi/math/geometry/Quaternion.hpp>
#include <wpi/math/geometry/Transform3d.hpp>
#include <wpi/math/kinematics/DifferentialDriveKinematics.hpp>
#include <wpi/math/system/plant/LinearSystemId.hpp>
#include <wpi/math/util/ComputerVisionUtil.hpp>
#include <wpi/nt/DoubleArrayTopic.hpp>
#include <wpi/nt/NetworkTableInstance.hpp>
#include <wpi/simulation/DifferentialDrivetrainSim.hpp>
#include <wpi/simulation/EncoderSim.hpp>
#include <wpi/smartdashboard/Field2d.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/RobotController.hpp>
#include <wpi/system/Timer.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/units/angular_velocity.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/velocity.hpp>
#include "wpi/apriltag/AprilTagFieldLayout.hpp"
#include "wpi/apriltag/AprilTagFields.hpp"
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/estimator/DifferentialDrivePoseEstimator.hpp"
#include "wpi/math/geometry/Pose2d.hpp"
#include "wpi/math/geometry/Pose3d.hpp"
#include "wpi/math/geometry/Quaternion.hpp"
#include "wpi/math/geometry/Transform3d.hpp"
#include "wpi/math/kinematics/DifferentialDriveKinematics.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/math/util/ComputerVisionUtil.hpp"
#include "wpi/nt/DoubleArrayTopic.hpp"
#include "wpi/nt/NetworkTableInstance.hpp"
#include "wpi/simulation/DifferentialDrivetrainSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/smartdashboard/Field2d.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/RobotController.hpp"
#include "wpi/system/Timer.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/angular_velocity.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/velocity.hpp"
/**
* Represents a differential drive style drivetrain.

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/math/geometry/Pose2d.hpp>
#include <wpi/math/util/StateSpaceUtil.hpp>
#include "wpi/math/geometry/Pose2d.hpp"
#include "wpi/math/util/StateSpaceUtil.hpp"
/**
* This dummy class represents a global measurement sensor, such as a computer

View File

@@ -4,7 +4,7 @@
#include "Robot.hpp"
#include <wpi/driverstation/DriverStation.hpp>
#include "wpi/driverstation/DriverStation.hpp"
void Robot::RobotPeriodic() {
// pull alliance port high if on red alliance, pull low if on blue alliance

View File

@@ -6,8 +6,8 @@
#include <array>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/discrete/DigitalOutput.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/discrete/DigitalOutput.hpp"
/**
* This is a sample program demonstrating how to communicate to a light

View File

@@ -4,8 +4,8 @@
#include "Robot.hpp"
#include <wpi/commands2/CommandScheduler.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/commands2/CommandScheduler.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
Robot::Robot() {}

View File

@@ -4,7 +4,7 @@
#include "RobotContainer.hpp"
#include <wpi/commands2/Commands.hpp>
#include "wpi/commands2/Commands.hpp"
RobotContainer::RobotContainer() {
// Initialize all of your commands and subsystems here

View File

@@ -4,7 +4,7 @@
#include "subsystems/DriveSubsystem.hpp"
#include <wpi/system/RobotController.hpp>
#include "wpi/system/RobotController.hpp"
using namespace DriveConstants;

View File

@@ -6,11 +6,11 @@
#include <numbers>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/units/acceleration.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
/**
* The Constants header provides a convenient place for teams to hold robot-wide

View File

@@ -6,10 +6,9 @@
#include <optional>
#include <wpi/commands2/Command.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "RobotContainer.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/framework/TimedRobot.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,13 +4,12 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandPtr.hpp>
#include <wpi/commands2/Commands.hpp>
#include <wpi/commands2/button/CommandXboxController.hpp>
#include "Constants.hpp"
#include "subsystems/DriveSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandPtr.hpp"
#include "wpi/commands2/Commands.hpp"
#include "wpi/commands2/button/CommandXboxController.hpp"
/**
* This class is where the bulk of the robot should be declared. Since

View File

@@ -4,17 +4,16 @@
#pragma once
#include <wpi/commands2/CommandPtr.hpp>
#include <wpi/commands2/SubsystemBase.hpp>
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/trajectory/TrapezoidProfile.hpp>
#include <wpi/system/Timer.hpp>
#include <wpi/units/length.hpp>
#include "Constants.hpp"
#include "ExampleSmartMotorController.hpp"
#include "wpi/commands2/CommandPtr.hpp"
#include "wpi/commands2/SubsystemBase.hpp"
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/trajectory/TrapezoidProfile.hpp"
#include "wpi/system/Timer.hpp"
#include "wpi/units/length.hpp"
class DriveSubsystem : public wpi::cmd::SubsystemBase {
public:

View File

@@ -2,10 +2,10 @@
// 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.
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/rotation/DutyCycleEncoder.hpp>
#include <wpi/math/util/MathUtil.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/rotation/DutyCycleEncoder.hpp"
#include "wpi/math/util/MathUtil.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
constexpr double fullRange = 1.3;
constexpr double expectedZero = 0.0;

View File

@@ -2,10 +2,10 @@
// 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.
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/discrete/DigitalInput.hpp>
#include <wpi/hardware/rotation/DutyCycle.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/discrete/DigitalInput.hpp"
#include "wpi/hardware/rotation/DutyCycle.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
class Robot : public wpi::TimedRobot {
wpi::DutyCycle m_dutyCycle{0}; // Duty cycle input

View File

@@ -4,17 +4,16 @@
#include <numbers>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/trajectory/ExponentialProfile.hpp>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "ExampleSmartMotorController.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/trajectory/ExponentialProfile.hpp"
#include "wpi/units/acceleration.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,9 +4,9 @@
#include "subsystems/Elevator.hpp"
#include <wpi/math/util/StateSpaceUtil.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/RobotController.hpp>
#include "wpi/math/util/StateSpaceUtil.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/RobotController.hpp"
Elevator::Elevator() {
m_encoder.SetDistancePerPulse(Constants::kArmEncoderDistPerPulse);

View File

@@ -6,13 +6,13 @@
#include <numbers>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/mass.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/units/acceleration.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/mass.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
/**
* The Constants header provides a convenient place for teams to hold robot-wide

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "subsystems/Elevator.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a sample program to demonstrate the use of elevator simulation.

View File

@@ -4,22 +4,21 @@
#pragma once
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/ElevatorFeedforward.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/trajectory/ExponentialProfile.hpp>
#include <wpi/simulation/BatterySim.hpp>
#include <wpi/simulation/ElevatorSim.hpp>
#include <wpi/simulation/EncoderSim.hpp>
#include <wpi/simulation/PWMMotorControllerSim.hpp>
#include <wpi/simulation/RoboRioSim.hpp>
#include <wpi/smartdashboard/Mechanism2d.hpp>
#include <wpi/smartdashboard/MechanismLigament2d.hpp>
#include <wpi/smartdashboard/MechanismRoot2d.hpp>
#include <wpi/units/length.hpp>
#include "Constants.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/ElevatorFeedforward.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/trajectory/ExponentialProfile.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/PWMMotorControllerSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/smartdashboard/Mechanism2d.hpp"
#include "wpi/smartdashboard/MechanismLigament2d.hpp"
#include "wpi/smartdashboard/MechanismRoot2d.hpp"
#include "wpi/units/length.hpp"
class Elevator {
public:

View File

@@ -4,18 +4,18 @@
#include <numbers>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/ElevatorFeedforward.hpp>
#include <wpi/math/controller/ProfiledPIDController.hpp>
#include <wpi/math/trajectory/TrapezoidProfile.hpp>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/ElevatorFeedforward.hpp"
#include "wpi/math/controller/ProfiledPIDController.hpp"
#include "wpi/math/trajectory/TrapezoidProfile.hpp"
#include "wpi/units/acceleration.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,9 +4,9 @@
#include "subsystems/Elevator.hpp"
#include <wpi/math/util/StateSpaceUtil.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/RobotController.hpp>
#include "wpi/math/util/StateSpaceUtil.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/RobotController.hpp"
Elevator::Elevator() {
m_encoder.SetDistancePerPulse(Constants::kArmEncoderDistPerPulse);

View File

@@ -6,13 +6,13 @@
#include <numbers>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/mass.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/units/acceleration.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/mass.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
/**
* The Constants header provides a convenient place for teams to hold robot-wide

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "subsystems/Elevator.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a sample program to demonstrate the use of elevator simulation.

View File

@@ -4,22 +4,21 @@
#pragma once
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/ElevatorFeedforward.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/ProfiledPIDController.hpp>
#include <wpi/simulation/BatterySim.hpp>
#include <wpi/simulation/ElevatorSim.hpp>
#include <wpi/simulation/EncoderSim.hpp>
#include <wpi/simulation/PWMMotorControllerSim.hpp>
#include <wpi/simulation/RoboRioSim.hpp>
#include <wpi/smartdashboard/Mechanism2d.hpp>
#include <wpi/smartdashboard/MechanismLigament2d.hpp>
#include <wpi/smartdashboard/MechanismRoot2d.hpp>
#include <wpi/units/length.hpp>
#include "Constants.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/ElevatorFeedforward.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/ProfiledPIDController.hpp"
#include "wpi/simulation/BatterySim.hpp"
#include "wpi/simulation/ElevatorSim.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/PWMMotorControllerSim.hpp"
#include "wpi/simulation/RoboRioSim.hpp"
#include "wpi/smartdashboard/Mechanism2d.hpp"
#include "wpi/smartdashboard/MechanismLigament2d.hpp"
#include "wpi/smartdashboard/MechanismRoot2d.hpp"
#include "wpi/units/length.hpp"
class Elevator {
public:

View File

@@ -4,17 +4,16 @@
#include <numbers>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/trajectory/TrapezoidProfile.hpp>
#include <wpi/units/acceleration.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/velocity.hpp>
#include <wpi/units/voltage.hpp>
#include "ExampleSmartMotorController.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/trajectory/TrapezoidProfile.hpp"
#include "wpi/units/acceleration.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/velocity.hpp"
#include "wpi/units/voltage.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,9 +4,9 @@
#include <numbers>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
/**
* Sample program displaying the value of a quadrature encoder on the

View File

@@ -2,18 +2,18 @@
// 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.
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/event/BooleanEvent.hpp>
#include <wpi/event/EventLoop.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/units/angular_velocity.hpp>
#include <wpi/units/length.hpp>
#include <wpi/units/time.hpp>
#include <wpi/units/voltage.hpp>
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/event/BooleanEvent.hpp"
#include "wpi/event/EventLoop.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/units/angular_velocity.hpp"
#include "wpi/units/length.hpp"
#include "wpi/units/time.hpp"
#include "wpi/units/voltage.hpp"
static const auto SHOT_VELOCITY = 200_rpm;
static const auto TOLERANCE = 8_rpm;

View File

@@ -2,17 +2,17 @@
// 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.
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/BangBangController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/system/plant/LinearSystemId.hpp>
#include <wpi/simulation/EncoderSim.hpp>
#include <wpi/simulation/FlywheelSim.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/units/moment_of_inertia.hpp>
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/BangBangController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/system/plant/LinearSystemId.hpp"
#include "wpi/simulation/EncoderSim.hpp"
#include "wpi/simulation/FlywheelSim.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/units/moment_of_inertia.hpp"
/**
* This is a sample program to demonstrate the use of a

View File

@@ -2,11 +2,11 @@
// 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.
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/system/Timer.hpp>
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/system/Timer.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,11 +4,11 @@
#include <cmath>
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
/**
* This is a sample program to demonstrate how to use a gyro sensor to make a

View File

@@ -2,11 +2,11 @@
// 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.
#include <wpi/drive/MecanumDrive.hpp>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include "wpi/drive/MecanumDrive.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
/**
* This is a sample program that uses mecanum drive with a gyro sensor to

View File

@@ -15,7 +15,7 @@ that want even more control over what code runs on their robot.
#include <stdio.h>
#include <wpi/hal/HAL.h>
#include "wpi/hal/HAL.h"
enum DriverStationMode {
DisabledMode,

View File

@@ -4,10 +4,10 @@
#include "Robot.hpp"
#include <wpi/commands2/CommandScheduler.hpp>
#include <wpi/driverstation/DriverStation.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/DataLogManager.hpp>
#include "wpi/commands2/CommandScheduler.hpp"
#include "wpi/driverstation/DriverStation.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/DataLogManager.hpp"
Robot::Robot() {
// Start recording to data log

View File

@@ -4,7 +4,7 @@
#include "RobotContainer.hpp"
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "wpi/smartdashboard/SmartDashboard.hpp"
RobotContainer::RobotContainer() {
// Initialize all of your commands and subsystems here

View File

@@ -4,10 +4,9 @@
#include "commands/Autos.hpp"
#include <wpi/commands2/Commands.hpp>
#include <wpi/commands2/FunctionalCommand.hpp>
#include "Constants.hpp"
#include "wpi/commands2/Commands.hpp"
#include "wpi/commands2/FunctionalCommand.hpp"
using namespace AutoConstants;

View File

@@ -4,7 +4,7 @@
#include "subsystems/DriveSubsystem.hpp"
#include <wpi/util/sendable/SendableBuilder.hpp>
#include "wpi/util/sendable/SendableBuilder.hpp"
using namespace DriveConstants;

View File

@@ -4,7 +4,7 @@
#include "subsystems/HatchSubsystem.hpp"
#include <wpi/util/sendable/SendableBuilder.hpp>
#include "wpi/util/sendable/SendableBuilder.hpp"
using namespace HatchConstants;

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "RobotContainer.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/framework/TimedRobot.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,15 +4,14 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/Commands.hpp>
#include <wpi/commands2/button/CommandPS4Controller.hpp>
#include <wpi/smartdashboard/SendableChooser.hpp>
#include "Constants.hpp"
#include "commands/Autos.hpp"
#include "subsystems/DriveSubsystem.hpp"
#include "subsystems/HatchSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/Commands.hpp"
#include "wpi/commands2/button/CommandPS4Controller.hpp"
#include "wpi/smartdashboard/SendableChooser.hpp"
namespace ac = AutoConstants;

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/CommandPtr.hpp>
#include "subsystems/DriveSubsystem.hpp"
#include "subsystems/HatchSubsystem.hpp"
#include "wpi/commands2/CommandPtr.hpp"
/** Container for auto command factories. */
namespace autos {

View File

@@ -4,12 +4,11 @@
#pragma once
#include <wpi/commands2/SubsystemBase.hpp>
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include "Constants.hpp"
#include "wpi/commands2/SubsystemBase.hpp"
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
class DriveSubsystem : public wpi::cmd::SubsystemBase {
public:

View File

@@ -4,12 +4,11 @@
#pragma once
#include <wpi/commands2/CommandPtr.hpp>
#include <wpi/commands2/SubsystemBase.hpp>
#include <wpi/hardware/pneumatic/DoubleSolenoid.hpp>
#include <wpi/hardware/pneumatic/PneumaticsControlModule.hpp>
#include "Constants.hpp"
#include "wpi/commands2/CommandPtr.hpp"
#include "wpi/commands2/SubsystemBase.hpp"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
class HatchSubsystem : public wpi::cmd::SubsystemBase {
public:

View File

@@ -4,10 +4,10 @@
#include "Robot.hpp"
#include <wpi/commands2/CommandScheduler.hpp>
#include <wpi/driverstation/DriverStation.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/system/DataLogManager.hpp>
#include "wpi/commands2/CommandScheduler.hpp"
#include "wpi/driverstation/DriverStation.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/system/DataLogManager.hpp"
Robot::Robot() {
// Start recording to data log

View File

@@ -4,13 +4,12 @@
#include "RobotContainer.hpp"
#include <wpi/commands2/button/JoystickButton.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include "commands/DefaultDrive.hpp"
#include "commands/GrabHatch.hpp"
#include "commands/HalveDriveSpeed.hpp"
#include "commands/ReleaseHatch.hpp"
#include "wpi/commands2/button/JoystickButton.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
RobotContainer::RobotContainer() {
// Initialize all of your commands and subsystems here

View File

@@ -4,7 +4,7 @@
#include "subsystems/DriveSubsystem.hpp"
#include <wpi/util/sendable/SendableBuilder.hpp>
#include "wpi/util/sendable/SendableBuilder.hpp"
using namespace DriveConstants;

View File

@@ -4,7 +4,7 @@
#include "subsystems/HatchSubsystem.hpp"
#include <wpi/util/sendable/SendableBuilder.hpp>
#include "wpi/util/sendable/SendableBuilder.hpp"
using namespace HatchConstants;

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "RobotContainer.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/framework/TimedRobot.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -4,16 +4,15 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/smartdashboard/SendableChooser.hpp>
#include "Constants.hpp"
#include "commands/ComplexAuto.hpp"
#include "commands/DefaultDrive.hpp"
#include "commands/DriveDistance.hpp"
#include "subsystems/DriveSubsystem.hpp"
#include "subsystems/HatchSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/smartdashboard/SendableChooser.hpp"
/**
* This class is where the bulk of the robot should be declared. Since

View File

@@ -4,12 +4,11 @@
#pragma once
#include <wpi/commands2/CommandHelper.hpp>
#include <wpi/commands2/SequentialCommandGroup.hpp>
#include "Constants.hpp"
#include "commands/DriveDistance.hpp"
#include "commands/ReleaseHatch.hpp"
#include "wpi/commands2/CommandHelper.hpp"
#include "wpi/commands2/SequentialCommandGroup.hpp"
/**
* A complex auto command that drives forward, releases a hatch, and then drives

View File

@@ -6,10 +6,9 @@
#include <functional>
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "subsystems/DriveSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
/**
* A command to drive the robot with joystick input passed in through lambdas.

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "subsystems/DriveSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
class DriveDistance
: public wpi::cmd::CommandHelper<wpi::cmd::Command, DriveDistance> {

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "subsystems/HatchSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
/**
* A simple command that grabs a hatch with the HatchSubsystem. Written

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "subsystems/DriveSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
class HalveDriveSpeed
: public wpi::cmd::CommandHelper<wpi::cmd::Command, HalveDriveSpeed> {

View File

@@ -4,10 +4,9 @@
#pragma once
#include <wpi/commands2/Command.hpp>
#include <wpi/commands2/CommandHelper.hpp>
#include "subsystems/HatchSubsystem.hpp"
#include "wpi/commands2/Command.hpp"
#include "wpi/commands2/CommandHelper.hpp"
/**
* A simple command that releases a hatch with the HatchSubsystem. Written

View File

@@ -4,12 +4,11 @@
#pragma once
#include <wpi/commands2/SubsystemBase.hpp>
#include <wpi/drive/DifferentialDrive.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include "Constants.hpp"
#include "wpi/commands2/SubsystemBase.hpp"
#include "wpi/drive/DifferentialDrive.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
class DriveSubsystem : public wpi::cmd::SubsystemBase {
public:

View File

@@ -4,11 +4,10 @@
#pragma once
#include <wpi/commands2/SubsystemBase.hpp>
#include <wpi/hardware/pneumatic/DoubleSolenoid.hpp>
#include <wpi/hardware/pneumatic/PneumaticsControlModule.hpp>
#include "Constants.hpp"
#include "wpi/commands2/SubsystemBase.hpp"
#include "wpi/hardware/pneumatic/DoubleSolenoid.hpp"
#include "wpi/hardware/pneumatic/PneumaticsControlModule.hpp"
class HatchSubsystem : public wpi::cmd::SubsystemBase {
public:

View File

@@ -2,8 +2,8 @@
// 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.
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a demo program showing the use of GenericHID's rumble feature.

View File

@@ -5,8 +5,9 @@
#include <opencv2/core/core.hpp>
#include <opencv2/core/types.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <wpi/cameraserver/CameraServer.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "wpi/cameraserver/CameraServer.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a demo program showing the use of OpenCV to do vision processing. The

View File

@@ -7,8 +7,9 @@
#include <string>
#include <fmt/format.h>
#include <wpi/driverstation/DriverStation.hpp>
#include <wpi/system/Timer.hpp>
#include "wpi/driverstation/DriverStation.hpp"
#include "wpi/system/Timer.hpp"
void Robot::RobotPeriodic() {
// Creates a string to hold current robot state information, including

View File

@@ -6,8 +6,8 @@
#include <array>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/bus/I2C.hpp>
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/bus/I2C.hpp"
/**
* This is a sample program demonstrating how to communicate to a light

View File

@@ -8,8 +8,9 @@
#include <opencv2/core/core.hpp>
#include <opencv2/core/types.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <wpi/cameraserver/CameraServer.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include "wpi/cameraserver/CameraServer.hpp"
#include "wpi/framework/TimedRobot.hpp"
/**
* This is a demo program showing the use of OpenCV to do vision processing. The

View File

@@ -4,7 +4,7 @@
#include "Drivetrain.hpp"
#include <wpi/math/kinematics/ChassisSpeeds.hpp>
#include "wpi/math/kinematics/ChassisSpeeds.hpp"
wpi::math::MecanumDriveWheelSpeeds Drivetrain::GetCurrentState() const {
return {wpi::units::meters_per_second_t{m_frontLeftEncoder.GetRate()},

View File

@@ -2,11 +2,10 @@
// 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.
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/filter/SlewRateLimiter.hpp>
#include "Drivetrain.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/filter/SlewRateLimiter.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -6,15 +6,15 @@
#include <numbers>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/geometry/Translation2d.hpp>
#include <wpi/math/kinematics/MecanumDriveKinematics.hpp>
#include <wpi/math/kinematics/MecanumDriveOdometry.hpp>
#include <wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp>
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/geometry/Translation2d.hpp"
#include "wpi/math/kinematics/MecanumDriveKinematics.hpp"
#include "wpi/math/kinematics/MecanumDriveOdometry.hpp"
#include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp"
/**
* Represents a mecanum drive style drivetrain.

View File

@@ -2,10 +2,10 @@
// 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.
#include <wpi/drive/MecanumDrive.hpp>
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include "wpi/drive/MecanumDrive.hpp"
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
/**
* This is a demo program showing how to use Mecanum control with the

View File

@@ -4,9 +4,8 @@
#include "Drivetrain.hpp"
#include <wpi/system/Timer.hpp>
#include "ExampleGlobalMeasurementSensor.hpp"
#include "wpi/system/Timer.hpp"
wpi::math::MecanumDriveWheelSpeeds Drivetrain::GetCurrentState() const {
return {wpi::units::meters_per_second_t{m_frontLeftEncoder.GetRate()},

View File

@@ -2,11 +2,10 @@
// 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.
#include <wpi/driverstation/XboxController.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/math/filter/SlewRateLimiter.hpp>
#include "Drivetrain.hpp"
#include "wpi/driverstation/XboxController.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/math/filter/SlewRateLimiter.hpp"
class Robot : public wpi::TimedRobot {
public:

View File

@@ -6,16 +6,16 @@
#include <numbers>
#include <wpi/hardware/imu/OnboardIMU.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/math/controller/PIDController.hpp>
#include <wpi/math/controller/SimpleMotorFeedforward.hpp>
#include <wpi/math/estimator/MecanumDrivePoseEstimator.hpp>
#include <wpi/math/geometry/Translation2d.hpp>
#include <wpi/math/kinematics/MecanumDriveKinematics.hpp>
#include <wpi/math/kinematics/MecanumDriveOdometry.hpp>
#include <wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp>
#include "wpi/hardware/imu/OnboardIMU.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/math/controller/PIDController.hpp"
#include "wpi/math/controller/SimpleMotorFeedforward.hpp"
#include "wpi/math/estimator/MecanumDrivePoseEstimator.hpp"
#include "wpi/math/geometry/Translation2d.hpp"
#include "wpi/math/kinematics/MecanumDriveKinematics.hpp"
#include "wpi/math/kinematics/MecanumDriveOdometry.hpp"
#include "wpi/math/kinematics/MecanumDriveWheelSpeeds.hpp"
/**
* Represents a mecanum drive style drivetrain.

View File

@@ -4,8 +4,8 @@
#pragma once
#include <wpi/math/geometry/Pose2d.hpp>
#include <wpi/math/util/StateSpaceUtil.hpp>
#include "wpi/math/geometry/Pose2d.hpp"
#include "wpi/math/util/StateSpaceUtil.hpp"
/**
* This dummy class represents a global measurement sensor, such as a computer

View File

@@ -2,18 +2,18 @@
// 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.
#include <wpi/driverstation/Joystick.hpp>
#include <wpi/framework/TimedRobot.hpp>
#include <wpi/hardware/motor/PWMSparkMax.hpp>
#include <wpi/hardware/rotation/AnalogPotentiometer.hpp>
#include <wpi/hardware/rotation/Encoder.hpp>
#include <wpi/simulation/SimHooks.hpp>
#include <wpi/smartdashboard/Mechanism2d.hpp>
#include <wpi/smartdashboard/MechanismLigament2d.hpp>
#include <wpi/smartdashboard/SmartDashboard.hpp>
#include <wpi/units/angle.hpp>
#include <wpi/util/Color.hpp>
#include <wpi/util/Color8Bit.hpp>
#include "wpi/driverstation/Joystick.hpp"
#include "wpi/framework/TimedRobot.hpp"
#include "wpi/hardware/motor/PWMSparkMax.hpp"
#include "wpi/hardware/rotation/AnalogPotentiometer.hpp"
#include "wpi/hardware/rotation/Encoder.hpp"
#include "wpi/simulation/SimHooks.hpp"
#include "wpi/smartdashboard/Mechanism2d.hpp"
#include "wpi/smartdashboard/MechanismLigament2d.hpp"
#include "wpi/smartdashboard/SmartDashboard.hpp"
#include "wpi/units/angle.hpp"
#include "wpi/util/Color.hpp"
#include "wpi/util/Color8Bit.hpp"
/**
* This sample program shows how to use Mechanism2d - a visual representation of

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