-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from daredevils2512/Worlds
Worlds
- Loading branch information
Showing
14 changed files
with
124 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2017-2018 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 "ElevatorRunToBottom.h" | ||
#include "../Robot.h" | ||
|
||
ElevatorRunToBottom::ElevatorRunToBottom(double speed = -0.7, double timeout = 3.0) { | ||
// Use Requires() here to declare subsystem dependencies | ||
// eg. Requires(Robot::chassis.get()); | ||
SetTimeout(timeout); | ||
m_speed = speed; | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
void ElevatorRunToBottom::Initialize() { | ||
|
||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
void ElevatorRunToBottom::Execute() { | ||
Robot::elevator->RunLift(m_speed); | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
bool ElevatorRunToBottom::IsFinished() { | ||
return Robot::elevator->GetBottomSwitch() || IsTimedOut(); | ||
} | ||
|
||
// Called once after isFinished returns true | ||
void ElevatorRunToBottom::End() { | ||
|
||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
void ElevatorRunToBottom::Interrupted() { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2017-2018 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 <Commands/Command.h> | ||
|
||
class ElevatorRunToBottom : public frc::Command { | ||
public: | ||
ElevatorRunToBottom(double speed, double timeout); | ||
void Initialize() override; | ||
void Execute() override; | ||
bool IsFinished() override; | ||
void End() override; | ||
void Interrupted() override; | ||
|
||
private: | ||
double m_speed = 0.0; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.