From c3b516ee1f6e0d317e629ba95abf4ac0cd94f534 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Wed, 10 Feb 2016 14:28:16 -0500 Subject: revised everything --- .../Shooter Testing/src/Makefile | 50 ------------- Nate's Position Testing/Shooter Testing/src/auto.c | 52 -------------- Nate's Position Testing/Shooter Testing/src/init.c | 84 ---------------------- .../Shooter Testing/src/opcontrol.c | 51 ------------- 4 files changed, 237 deletions(-) delete mode 100644 Nate's Position Testing/Shooter Testing/src/Makefile delete mode 100644 Nate's Position Testing/Shooter Testing/src/auto.c delete mode 100644 Nate's Position Testing/Shooter Testing/src/init.c delete mode 100644 Nate's Position Testing/Shooter Testing/src/opcontrol.c (limited to 'Nate's Position Testing/Shooter Testing/src') diff --git a/Nate's Position Testing/Shooter Testing/src/Makefile b/Nate's Position Testing/Shooter Testing/src/Makefile deleted file mode 100644 index 865f1e7..0000000 --- a/Nate's Position Testing/Shooter Testing/src/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# Makefile for compiling PROS projects - -# Path to project root (NO trailing slash!) -ROOT=.. -# Binary output directory -BINDIR=$(ROOT)/bin - -# Nothing below here needs to be modified by typical users - -# Include common aspects of this project --include $(ROOT)/common.mk - -ASMSRC:=$(wildcard *.$(ASMEXT)) -ASMOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(ASMSRC:.$(ASMEXT)=.o)) -HEADERS:=$(wildcard *.$(HEXT)) -### Special section for Cortex projects ### -HEADERS_2:=$(wildcard ../include/*.$(HEXT)) -### End special section ### -CSRC=$(wildcard *.$(CEXT)) -COBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CSRC:.$(CEXT)=.o)) -CPPSRC:=$(wildcard *.$(CPPEXT)) -CPPOBJ:=$(patsubst %.o,$(BINDIR)/%.o,$(CPPSRC:.$(CPPEXT)=.o)) -OUT:=$(BINDIR)/$(OUTNAME) - -.PHONY: all - -# By default, compile program -all: . - -# Compiles the program if anything is changed -.: $(ASMOBJ) $(COBJ) $(CPPOBJ) - @touch . - -# Assembly source file management -$(ASMOBJ): $(BINDIR)/%.o: %.$(ASMEXT) - @echo AS $< - @$(AS) $(AFLAGS) -o $@ $< - -### Special section for Cortex projects ### - -# Object management -$(COBJ): $(BINDIR)/%.o: %.$(CEXT) $(HEADERS) $(HEADERS_2) - @echo CC $(INCLUDE) $< - @$(CC) $(INCLUDE) $(CFLAGS) -o $@ $< - -$(CPPOBJ): $(BINDIR)/%.o: %.$(CPPEXT) $(HEADERS) $(HEADERS_2) - @echo CPC $(INCLUDE) $< - @$(CPPCC) $(INCLUDE) $(CPPFLAGS) -o $@ $< - -### End special section ### diff --git a/Nate's Position Testing/Shooter Testing/src/auto.c b/Nate's Position Testing/Shooter Testing/src/auto.c deleted file mode 100644 index 9df57af..0000000 --- a/Nate's Position Testing/Shooter Testing/src/auto.c +++ /dev/null @@ -1,52 +0,0 @@ -/** @file auto.c - * @brief File for autonomous code - * - * This file should contain the user autonomous() function and any functions related to it. - * - * Copyright (c) 2011-2014, Purdue University ACM SIG BOTS. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Purdue University ACM SIG BOTS nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL PURDUE UNIVERSITY ACM SIG BOTS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Purdue Robotics OS contains FreeRTOS (http://www.freertos.org) whose source code may be - * obtained from http://sourceforge.net/projects/freertos/files/ or on request. - */ - -#include "main.h" - -/* - * Runs the user autonomous code. This function will be started in its own task with the default - * priority and stack size whenever the robot is enabled via the Field Management System or the - * VEX Competition Switch in the autonomous mode. If the robot is disabled or communications is - * lost, the autonomous task will be stopped by the kernel. Re-enabling the robot will restart - * the task, not re-start it from where it left off. - * - * Code running in the autonomous task cannot access information from the VEX Joystick. However, - * the autonomous function can be invoked from another task if a VEX Competition Switch is not - * available, and it can access joystick information if called in this way. - * - * The autonomous task may exit, unlike operatorControl() which should never exit. If it does - * so, the robot will await a switch to another mode or disable/enable cycle. - */ -void autonomous() { -} diff --git a/Nate's Position Testing/Shooter Testing/src/init.c b/Nate's Position Testing/Shooter Testing/src/init.c deleted file mode 100644 index fd9eeb4..0000000 --- a/Nate's Position Testing/Shooter Testing/src/init.c +++ /dev/null @@ -1,84 +0,0 @@ -/** @file init.c - * @brief File for initialization code - * - * This file should contain the user initialize() function and any functions related to it. - * - * Copyright (c) 2011-2014, Purdue University ACM SIG BOTS. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of Purdue University ACM SIG BOTS nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL PURDUE UNIVERSITY ACM SIG BOTS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Purdue Robotics OS contains FreeRTOS (http://www.freertos.org) whose source code may be - * obtained from http://sourceforge.net/projects/freertos/files/ or on request. - */ - -#include "main.h" -Encoder encoder1,encoder2; -/* - * Runs pre-initialization code. This function will be started in kernel mode one time while the - * VEX Cortex is starting up. As the scheduler is still paused, most API functions will fail. - * - * The purpose of this function is solely to set the default pin modes (pinMode()) and port - * states (digitalWrite()) of limit switches, push buttons, and solenoids. It can also safely - * configure a UART port (usartOpen()) but cannot set up an LCD (lcdInit()). - */ -void initializeIO() { - - - pinMode(1,INPUT); - pinMode(2,INPUT); - pinMode(3,INPUT); - pinMode(4,INPUT); - pinMode(5,INPUT); - pinMode(6,INPUT); - pinMode(7,INPUT); - pinMode(8,INPUT); - - - - -// Setup sensors. - - - - -}/* - * Runs user initialization code. This function will be started in its own task with the default - * priority and stack size once when the robot is starting up. It is possible that the VEXnet - * communication link may not be fully established at this time, so reading from the VEX - * Joystick may fail. - * - * This function should initialize most sensors (gyro, encoders, ultrasonics), LCDs, global - * variables, and IMEs. - * - * This function must exit relatively promptly, or the operatorControl() and autonomous() tasks - * will not start. An autonomous mode selection menu like the pre_auton() in other environments - * can be implemented in this task if desired. - */ -void initialize() { - lcdInit(uart2); - lcdClear(uart2); - lcdSetBacklight(uart2,1); - encoder1 = encoderInit(3,4,true); - encoder2 = encoderInit(5,6,true); -} diff --git a/Nate's Position Testing/Shooter Testing/src/opcontrol.c b/Nate's Position Testing/Shooter Testing/src/opcontrol.c deleted file mode 100644 index df21076..0000000 --- a/Nate's Position Testing/Shooter Testing/src/opcontrol.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "main.h" - -#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) -#define PI =3.14159 -/* - * Runs the user operator control code. This function will be started in its own task with the - * default priority and stack size whenever the robot is enabled via the Field Management System - * or the VEX Competition Switch in the operator control mode. If the robot is disabled or - * communications is lost, the operator control task will be stopped by the kernel. Re-enabling - * the robot will restart the task, not resume it from where it left off. - * - * If no VEX Competition Switch or Field Management system is plugged in, the VEX Cortex will - * run the operator control task. Be warned that this will also occur if the VEX Cortex is - * tethered directly to a computer via the USB A to A cable without any VEX Joystick attached. - * - * Code running in this task can take almost any action, as the VEX Joystick is available and - * the scheduler is operational. However, proper use of delay() or taskDelayUntil() is highly - * recommended to give other tasks (including system tasks such as updating LCDs) time to run. - * - * This task should never exit; it should end with some kind of infinite loop, even if empty. - * -*/ - -/* notes for Clyne: - * Other processes should not interupt the collection of data: - * rotation calculation should be and data collection should be a high priority/primary task - * Main task= manages tasks, init variables, reset functions (sensors, etc) - * Primary = sensor data collections and calculations - * Secondary = drive tasks - * - * - * - */ -static long lVel,rVel,deltaPos,deltaTime,startTheta, - heading,lDist,rDist,xPos,yPos, - track=15; -void operatorControl() { - heading=startTheta; - while (1) { - - //get time 1 the first time - heading=((lDist-rDist)/(track*2*PI))*360+startTheta;//heading in degrees. might need to be radians for cosine functions - //get time 2 - deltaPos=(lVel+rVel)/2*deltaTime; - xPos+=cos(heading)*deltaPos; - yPos+=sin(heading)*deltaPos; - //get time 1 - delay(20); - - } -} -- cgit v1.2.3