Permalink
Browse files

Initial project.

  • Loading branch information...
0 parents commit f5eec1afad0d23632287e7c1559edf6eb4c959fa @mike-n-7 mike-n-7 committed Feb 13, 2012
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?>
+
+<cproject>
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="org.eclipse.cdt.core.default.config.283967106">
+ <storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="org.eclipse.cdt.core.default.config.283967106" moduleId="org.eclipse.cdt.core.settings" name="Configuration">
+ <externalSettings/>
+ <extensions>
+ <extension id="com.windriver.ide.core.WRScannerInfoProvider" point="org.eclipse.cdt.core.ScannerInfoProvider"/>
+ <extension id="com.windriver.ide.core.WRElfParserVxWorks" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ <storageModule moduleId="org.eclipse.cdt.core.pathentry">
+ <pathentry kind="src" path=""/>
+ <pathentry kind="out" path=""/>
+ <pathentry kind="con" path="com.windriver.ide.core.WR_CONTAINER"/>
+ <pathentry kind="con" path="com.windriver.ide.core.build.model.WR_USERDEFINED_CONTAINER"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration"/>
+ <storageModule moduleId="userdefinedContainer">
+ <indexAllFiles value="false"/>
+ <initialized value="true"/>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+</cproject>
@@ -0,0 +1 @@
+PPC603gnu/
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Rambot2012</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.windriver.ide.core.wrbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>com.windriver.ide.core.wrnature</nature>
+ <nature>com.windriver.ide.core.wrcorenature</nature>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.core.ccnature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,48 @@
+# The file ".wrmakefile" is the template used by the Wind River Workbench to
+# generate the makefiles of this project. Add user-specific build targets and
+# make rules only(!) in this project's ".wrmakefile" file. These will then be
+# automatically dumped into the makefiles.
+
+WIND_HOME := $(subst \,/,$(WIND_HOME))
+WIND_BASE := $(subst \,/,$(WIND_BASE))
+WIND_USR := $(subst \,/,$(WIND_USR))
+
+all : pre_build main_all post_build
+
+_clean ::
+ @echo "make: removing targets and objects of `pwd`"
+
+%IDE_GENERATED%
+
+-include $(PRJ_ROOT_DIR)/*.makefile
+
+-include *.makefile
+
+main_all : external_build $(PROJECT_TARGETS)
+ @echo "make: built targets of `pwd`"
+
+# entry point for extending the build
+external_build ::
+ @echo ""
+
+# main entry point for pre processing prior to the build
+pre_build :: $(PRE_BUILD_STEP) generate_sources
+ @echo ""
+
+# entry point for generating sources prior to the build
+generate_sources ::
+ @echo ""
+
+# main entry point for post processing after the build
+post_build :: $(POST_BUILD_STEP) deploy_output
+ @echo ""
+
+# entry point for deploying output after the build
+deploy_output ::
+ @echo ""
+
+clean :: external_clean $(CLEAN_STEP) _clean
+
+# entry point for extending the build clean
+external_clean ::
+ @echo ""

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,27 @@
+#include "CommandBase.h"
+#include "Commands/Scheduler.h"
+
+CommandBase::CommandBase(const char *name) : Command(name) {
+}
+
+CommandBase::CommandBase() : Command() {
+}
+
+// Initialize a single static instance of all of your subsystems to NULL
+Drive * CommandBase::drive = NULL;
+Roller * CommandBase::roller = NULL;
+Conveyor * CommandBase::conveyor = NULL;
+Turret * CommandBase::turret = NULL;
+//GiantFour * CommandBase::giantFour = NULL;
+OI * CommandBase::oi = NULL;
+
+void CommandBase::init() {
+ // Create a single static instance of all of your subsystems. The following
+ // line should be repeated for each subsystem in the project.
+ drive = new Drive();
+ roller = new Roller();
+ conveyor = new Conveyor();
+ turret = new Turret();
+ //giantFour = new GiantFour();
+ oi = new OI();
+}
@@ -0,0 +1,32 @@
+#ifndef COMMAND_BASE_H
+#define COMMAND_BASE_H
+
+#include "Commands/Command.h"
+#include "Subsystems/Drive.h"
+#include "Subsystems/Conveyor.h"
+#include "Subsystems/Roller.h"
+#include "Subsystems/Turret.h"
+#include "Subsystems/GiantFour.h"
+#include "OI.h"
+
+
+/**
+ * The base for all commands. All atomic commands should subclass CommandBase.
+ * CommandBase stores creates and stores each control system. To access a
+ * subsystem elsewhere in your code in your code use CommandBase.examplesubsystem
+ */
+class CommandBase: public Command {
+public:
+ CommandBase(const char *name);
+ CommandBase();
+ static void init();
+ // Create a single static instance of all of your subsystems
+ static Drive *drive;
+ static Roller *roller;
+ static Conveyor *conveyor;
+ static Turret *turret;
+ //static GiantFour *giantFour;
+ static OI *oi;
+};
+
+#endif
@@ -0,0 +1,55 @@
+#include "WPILib.h"
+#include "Commands/Command.h"
+#include "Commands/ExampleCommand.h"
+#include "CommandBase.h"
+#include "Commands/ArcadeDrive.h"
+#include "Commands/TankDrive.h"
+
+class CommandBasedRobot : public IterativeRobot {
+private:
+ Command *autonomousCommand;
+ Command *driveCommand;
+ SendableChooser *driveStyle;
+
+ virtual void RobotInit() {
+ //NetworkTable::Initialize();
+
+ CommandBase::init();
+ driveStyle = new SendableChooser();
+ driveStyle->AddDefault("Arcade",new ArcadeDrive());
+ driveStyle->AddObject("Tank",new TankDrive());
+ SmartDashboard::GetInstance()->PutData("Drive Style Chooser", driveStyle);
+ autonomousCommand = new ExampleCommand();
+ }
+
+ virtual void AutonomousInit() {
+ autonomousCommand->Start();
+ }
+
+ virtual void AutonomousPeriodic() {
+ Scheduler::GetInstance()->Run();
+ }
+
+ virtual void TeleopInit() {
+ autonomousCommand->Cancel();
+ driveCommand = (Command*) driveStyle->GetSelected();
+ driveCommand->Start();
+ }
+
+ virtual void TeleopPeriodic() {
+ Scheduler::GetInstance()->Run();
+ //if (CommandBase::oi->GetLeftStick()->GetTrigger() || CommandBase::oi->GetRightStick()->GetTrigger()) {
+ // CommandBase::drive->SwitchGear();
+ //}
+ if (CommandBase::oi->GetGamePad()->GetDPadX()!= 0.0) {
+ CommandBase::conveyor->ConveyorStop();
+ } else if (CommandBase::oi->GetGamePad()->GetDPadY()< 0.0) {
+ CommandBase::conveyor->ConveyorUp();
+ } else if (CommandBase::oi->GetGamePad()->GetDPadY() > 0.0) {
+ CommandBase::conveyor->ConveyorDown();
+ }
+ }
+};
+
+START_ROBOT_CLASS(CommandBasedRobot);
+
@@ -0,0 +1,30 @@
+#include "ArcadeDrive.h"
+
+ArcadeDrive::ArcadeDrive() {
+ Requires(drive);
+}
+
+// Called just before this Command runs the first time
+void ArcadeDrive::Initialize() {
+
+}
+
+// Called repeatedly when this Command is scheduled to run
+void ArcadeDrive::Execute() {
+ drive->ArcadeDriveFunction(oi->GetRightStick());
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool ArcadeDrive::IsFinished() {
+ return false;
+}
+
+// Called once after isFinished returns true
+void ArcadeDrive::End() {
+
+}
+
+// Called when another command which requires one or more of the same
+// subsystems is scheduled to run
+void ArcadeDrive::Interrupted() {
+}
@@ -0,0 +1,21 @@
+#ifndef ARCADE_DRIVE_H
+#define ARCADE_DRIVE_H
+
+#include "../CommandBase.h"
+
+/**
+ *
+ *
+ * @author ExampleAuthor
+ */
+class ArcadeDrive: public CommandBase {
+public:
+ ArcadeDrive();
+ virtual void Initialize();
+ virtual void Execute();
+ virtual bool IsFinished();
+ virtual void End();
+ virtual void Interrupted();
+};
+
+#endif
@@ -0,0 +1,35 @@
+#include "DeployRamp.h"
+#include "../Configuration.h"
+
+DeployRamp::DeployRamp() {
+ //Requires(giantFour);
+}
+
+// Called just before this Command runs the first time
+void DeployRamp::Initialize() {
+ //giantFour->GetTimer()->Reset();
+ //giantFour->GetTimer()->Start();
+}
+
+// Called repeatedly when this Command is scheduled to run
+void DeployRamp::Execute() {
+ //giantFour->RampDown();
+ //if (giantFour->GetTimer()->Get() > RAMP_LOCK_WAIT_TIME) {
+ // giantFour->LockRamp();
+ //}
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool DeployRamp::IsFinished() {
+ return false;
+}
+
+// Called once after isFinished returns true
+void DeployRamp::End() {
+
+}
+
+// Called when another command which requires one or more of the same
+// subsystems is scheduled to run
+void DeployRamp::Interrupted() {
+}
@@ -0,0 +1,21 @@
+#ifndef DEPLOYRAMP_H
+#define DEPLOYRAMP_H
+
+#include "../CommandBase.h"
+
+/**
+ *
+ *
+ * @author Mike
+ */
+class DeployRamp: public CommandBase {
+public:
+ DeployRamp();
+ virtual void Initialize();
+ virtual void Execute();
+ virtual bool IsFinished();
+ virtual void End();
+ virtual void Interrupted();
+};
+
+#endif
@@ -0,0 +1,31 @@
+#include "ExampleCommand.h"
+
+ExampleCommand::ExampleCommand() {
+ // Use requires() here to declare subsystem dependencies
+ // eg. requires(chassis);
+}
+
+// Called just before this Command runs the first time
+void ExampleCommand::Initialize() {
+
+}
+
+// Called repeatedly when this Command is scheduled to run
+void ExampleCommand::Execute() {
+
+}
+
+// Make this return true when this Command no longer needs to run execute()
+bool ExampleCommand::IsFinished() {
+ return false;
+}
+
+// Called once after isFinished returns true
+void ExampleCommand::End() {
+
+}
+
+// Called when another command which requires one or more of the same
+// subsystems is scheduled to run
+void ExampleCommand::Interrupted() {
+}
@@ -0,0 +1,21 @@
+#ifndef EXAMPLE_COMMAND_H
+#define EXAMPLE_COMMAND_H
+
+#include "../CommandBase.h"
+
+/**
+ *
+ *
+ * @author ExampleAuthor
+ */
+class ExampleCommand: public CommandBase {
+public:
+ ExampleCommand();
+ virtual void Initialize();
+ virtual void Execute();
+ virtual bool IsFinished();
+ virtual void End();
+ virtual void Interrupted();
+};
+
+#endif
Oops, something went wrong.

0 comments on commit f5eec1a

Please sign in to comment.