mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Fix incomplete .styleguide (#2113)
Also clean up other .styleguides. Fixes #2111.
This commit is contained in:
committed by
Peter Johnson
parent
ffa4b907c0
commit
9a8067465c
@@ -48,21 +48,23 @@ ParallelRaceGroup Command::WithInterrupt(std::function<bool()> condition) && {
|
||||
return ParallelRaceGroup(std::move(temp));
|
||||
}
|
||||
|
||||
SequentialCommandGroup Command::BeforeStarting(std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) && {
|
||||
SequentialCommandGroup Command::BeforeStarting(
|
||||
std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) && {
|
||||
std::vector<std::unique_ptr<Command>> temp;
|
||||
temp.emplace_back(std::make_unique<InstantCommand>(
|
||||
std::move(toRun), requirements));
|
||||
temp.emplace_back(
|
||||
std::make_unique<InstantCommand>(std::move(toRun), requirements));
|
||||
temp.emplace_back(std::move(*this).TransferOwnership());
|
||||
return SequentialCommandGroup(std::move(temp));
|
||||
}
|
||||
|
||||
SequentialCommandGroup Command::AndThen(std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) && {
|
||||
SequentialCommandGroup Command::AndThen(
|
||||
std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) && {
|
||||
std::vector<std::unique_ptr<Command>> temp;
|
||||
temp.emplace_back(std::move(*this).TransferOwnership());
|
||||
temp.emplace_back(std::make_unique<InstantCommand>(
|
||||
std::move(toRun), requirements));
|
||||
temp.emplace_back(
|
||||
std::make_unique<InstantCommand>(std::move(toRun), requirements));
|
||||
return SequentialCommandGroup(std::move(temp));
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#include "frc2/command/CommandScheduler.h"
|
||||
|
||||
#include <hal/HALBase.h>
|
||||
#include <frc/RobotState.h>
|
||||
#include <frc/WPIErrors.h>
|
||||
#include <frc/smartdashboard/SendableBuilder.h>
|
||||
#include <frc/smartdashboard/SendableRegistry.h>
|
||||
#include <hal/HALBase.h>
|
||||
#include <networktables/NetworkTableEntry.h>
|
||||
#include <wpi/DenseMap.h>
|
||||
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
FunctionalCommand::FunctionalCommand(std::function<void()> onInit,
|
||||
std::function<void()> onExecute,
|
||||
std::function<void(bool)> onEnd,
|
||||
std::function<bool()> isFinished,
|
||||
std::initializer_list<Subsystem*> requirements)
|
||||
FunctionalCommand::FunctionalCommand(
|
||||
std::function<void()> onInit, std::function<void()> onExecute,
|
||||
std::function<void(bool)> onEnd, std::function<bool()> isFinished,
|
||||
std::initializer_list<Subsystem*> requirements)
|
||||
: m_onInit{std::move(onInit)},
|
||||
m_onExecute{std::move(onExecute)},
|
||||
m_onEnd{std::move(onEnd)},
|
||||
|
||||
@@ -70,18 +70,18 @@ void RamseteCommand::Execute() {
|
||||
m_controller.Calculate(m_pose(), m_trajectory.Sample(curTime)));
|
||||
|
||||
if (m_usePID) {
|
||||
auto leftFeedforward =
|
||||
m_feedforward.Calculate(targetWheelSpeeds.left,
|
||||
(targetWheelSpeeds.left - m_prevSpeeds.left) / dt);
|
||||
auto leftFeedforward = m_feedforward.Calculate(
|
||||
targetWheelSpeeds.left,
|
||||
(targetWheelSpeeds.left - m_prevSpeeds.left) / dt);
|
||||
|
||||
auto rightFeedforward =
|
||||
m_feedforward.Calculate(targetWheelSpeeds.right,
|
||||
(targetWheelSpeeds.right - m_prevSpeeds.right) / dt);
|
||||
auto rightFeedforward = m_feedforward.Calculate(
|
||||
targetWheelSpeeds.right,
|
||||
(targetWheelSpeeds.right - m_prevSpeeds.right) / dt);
|
||||
|
||||
auto leftOutput =
|
||||
volt_t(m_leftController->Calculate(
|
||||
m_speeds().left.to<double>(), targetWheelSpeeds.left.to<double>())) +
|
||||
leftFeedforward;
|
||||
auto leftOutput = volt_t(m_leftController->Calculate(
|
||||
m_speeds().left.to<double>(),
|
||||
targetWheelSpeeds.left.to<double>())) +
|
||||
leftFeedforward;
|
||||
|
||||
auto rightOutput = volt_t(m_rightController->Calculate(
|
||||
m_speeds().right.to<double>(),
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "frc2/command/WaitUntilCommand.h"
|
||||
|
||||
#include <frc2/Timer.h>
|
||||
#include "frc2/Timer.h"
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "frc2/command/button/Trigger.h"
|
||||
|
||||
#include <frc2/command/InstantCommand.h>
|
||||
#include "frc2/command/InstantCommand.h"
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
@@ -49,8 +49,9 @@ Trigger Trigger::WhileActiveContinous(Command* command, bool interruptible) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
Trigger Trigger::WhileActiveContinous(std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) {
|
||||
Trigger Trigger::WhileActiveContinous(
|
||||
std::function<void()> toRun,
|
||||
std::initializer_list<Subsystem*> requirements) {
|
||||
return WhileActiveContinous(InstantCommand(std::move(toRun), requirements));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user