2020-12-26 14:12:05 -08:00
|
|
|
// 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.
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2016-05-25 22:40:15 -07:00
|
|
|
#pragma once
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2021-05-26 17:44:18 -07:00
|
|
|
#include <string_view>
|
2016-09-05 13:55:31 -07:00
|
|
|
|
2021-05-28 22:06:59 -07:00
|
|
|
#include <units/time.h>
|
|
|
|
|
|
2018-07-20 00:03:45 -07:00
|
|
|
#include "frc/commands/TimedCommand.h"
|
2013-12-15 18:30:16 -05:00
|
|
|
|
2016-11-01 22:33:12 -07:00
|
|
|
namespace frc {
|
|
|
|
|
|
2022-01-08 11:11:34 -08:00
|
|
|
/**
|
|
|
|
|
* A WaitCommand will wait for a certain amount of time before finishing. It is
|
|
|
|
|
* useful if you want a CommandGroup to pause for a moment.
|
|
|
|
|
*
|
|
|
|
|
* This class is provided by the OldCommands VendorDep
|
|
|
|
|
*/
|
2016-11-18 17:42:40 -05:00
|
|
|
class WaitCommand : public TimedCommand {
|
2015-06-25 15:07:55 -04:00
|
|
|
public:
|
2018-05-31 20:47:15 -07:00
|
|
|
/**
|
|
|
|
|
* Creates a new WaitCommand with the given name and timeout.
|
|
|
|
|
*
|
2021-05-28 22:06:59 -07:00
|
|
|
* @param timeout the time before this command "times out"
|
2018-05-31 20:47:15 -07:00
|
|
|
*/
|
2021-05-28 22:06:59 -07:00
|
|
|
explicit WaitCommand(units::second_t timeout);
|
2018-05-31 20:47:15 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new WaitCommand with the given timeout.
|
|
|
|
|
*
|
2021-10-14 18:09:38 -07:00
|
|
|
* @param name the name of the command
|
2021-05-28 22:06:59 -07:00
|
|
|
* @param timeout the time before this command "times out"
|
2018-05-31 20:47:15 -07:00
|
|
|
*/
|
2021-05-28 22:06:59 -07:00
|
|
|
WaitCommand(std::string_view name, units::second_t timeout);
|
2018-05-31 20:47:15 -07:00
|
|
|
|
2020-12-28 00:10:13 -08:00
|
|
|
~WaitCommand() override = default;
|
2018-09-24 00:08:25 -07:00
|
|
|
|
|
|
|
|
WaitCommand(WaitCommand&&) = default;
|
|
|
|
|
WaitCommand& operator=(WaitCommand&&) = default;
|
2013-12-15 18:30:16 -05:00
|
|
|
};
|
2016-11-01 22:33:12 -07:00
|
|
|
|
|
|
|
|
} // namespace frc
|