mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add templates for new commands for vscode plugin (#2016)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#include "ReplaceMeTrapezoidProfileCommand.h"
|
||||
|
||||
// NOTE: Consider using this command inline, rather than writing a subclass.
|
||||
// For more information, see:
|
||||
// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html
|
||||
ReplaceMeTrapezoidProfileCommand::ReplaceMeTrapezoidProfileCommand()
|
||||
: CommandHelper
|
||||
// The profile to execute
|
||||
(frc::TrapezoidProfile<units::meter>(
|
||||
// The maximum velocity and acceleration of the profile
|
||||
{5_mps, 5_mps_sq},
|
||||
// The goal state of the profile
|
||||
{10_m, 0_mps},
|
||||
// The initial state of the profile
|
||||
{0_m, 0_mps}),
|
||||
[](frc::TrapezoidProfile<units::meter>::State state) {
|
||||
// Use the computed intermediate trajectory state here
|
||||
}) {}
|
||||
@@ -0,0 +1,18 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* Copyright (c) 2019 FIRST. All Rights Reserved. */
|
||||
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
||||
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
||||
/* the project. */
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <frc2/command/CommandHelper.h>
|
||||
#include <frc2/command/TrapezoidProfileCommand.h>
|
||||
|
||||
class ReplaceMeTrapezoidProfileCommand
|
||||
: public frc2::CommandHelper<frc2::TrapezoidProfileCommand<units::meter>,
|
||||
ReplaceMeTrapezoidProfileCommand> {
|
||||
public:
|
||||
ReplaceMeTrapezoidProfileCommand();
|
||||
};
|
||||
Reference in New Issue
Block a user