mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-02 02:51:42 +00:00
Merge branch 'main' into 2027
This commit is contained in:
@@ -14,7 +14,7 @@ WaitUntilCommand::WaitUntilCommand(std::function<bool()> condition)
|
||||
: m_condition{std::move(condition)} {}
|
||||
|
||||
WaitUntilCommand::WaitUntilCommand(wpi::units::second_t time)
|
||||
: m_condition{[=] { return wpi::Timer::GetMatchTime() - time > 0_s; }} {}
|
||||
: m_condition{[=] { return wpi::Timer::GetMatchTime() < time; }} {}
|
||||
|
||||
bool WaitUntilCommand::IsFinished() {
|
||||
return m_condition();
|
||||
|
||||
@@ -35,7 +35,12 @@ class WaitUntilCommand : public CommandHelper<Command, WaitUntilCommand> {
|
||||
* will be judged to be legal by the referees. When in doubt, add a safety
|
||||
* factor or time the action manually.
|
||||
*
|
||||
* The match time counts down when connected to FMS or the DS is in practice
|
||||
* mode for the current mode. When the DS is not connected to FMS or in
|
||||
* practice mode, the command will not wait.
|
||||
*
|
||||
* @param time the match time after which to end, in seconds
|
||||
* @see frc::DriverStation::GetMatchTime()
|
||||
*/
|
||||
explicit WaitUntilCommand(wpi::units::second_t time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user