Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
6bde9b0
Everyone dies alone.
jackhymowitz Apr 15, 2017
1eb97f8
If you are 17, 20% of your life is already gone.
jackhymowitz Apr 15, 2017
1f15585
Began removing WPI interactions into their own package
jackhymowitz Apr 15, 2017
034162f
The commit which will make Rafi kill me. WIP; SprocketRobot next
jackhymowitz Apr 15, 2017
d368b85
Began reimplementing FRC code in the right spot, and fiddling with th…
jackhymowitz Apr 15, 2017
26ab19c
States are now actions as well
jackhymowitz Apr 15, 2017
1a99209
I like these names better, but it doesnt matter
jackhymowitz Apr 15, 2017
f640d91
Not near done; need to work out inheritances and class/interfaces for…
May 12, 2017
052fcbc
Working on auto
May 25, 2017
d182761
Auto Betterer
Jun 9, 2017
dcde855
Auto Tweak
Jun 12, 2017
f25b3df
Time for a new feature!
Jun 12, 2017
c3c82b4
Merge remote-tracking branch 'origin/master' into 0.3
jackhymowitz Jun 24, 2017
098b143
Move Action
jackhymowitz Jun 24, 2017
09ea005
Sourcetree crashed so I lost a few commits, so this is big. It has mo…
jackhymowitz Jun 24, 2017
8e9ce6d
Bye
jackhymowitz Jun 24, 2017
0d2b087
Hi
jackhymowitz Jun 24, 2017
5f2e6fc
NO!
jackhymowitz Jun 24, 2017
abb4376
More actions
jackhymowitz Jun 24, 2017
53fd05d
SprocketRobot Renames
jackhymowitz Jun 24, 2017
ff390aa
This might just be the best class I have made yet.
jackhymowitz Jun 24, 2017
6fb9d6c
Get and Set
jackhymowitz Jun 24, 2017
20b28fd
Added api.getMyZRState(Array[12])
jackhymowitz Jun 26, 2017
b678639
I forgot what I did but here is a commit I think
jackhymowitz Jun 27, 2017
6bb7645
I don't know, I think I did something I guess. Maybe.
jackhymowitz Jun 28, 2017
78b7269
Imports!
jackhymowitz Jun 28, 2017
101f794
We dont even have to do this stupid thing anymore!
jackhymowitz Jun 28, 2017
455eb2c
Revert "We dont even have to do this stupid thing anymore!"
jackhymowitz Jun 28, 2017
b507854
Now we use it.
jackhymowitz Jun 28, 2017
181a483
And consolidating some classes to make less things on the left
jackhymowitz Jun 28, 2017
b21768d
Here is a change I am less sure about the implementation, but am very…
jackhymowitz Jun 28, 2017
9d5375a
AAAAAAAAAAAnd here is another class to make up for the one I removed.
jackhymowitz Jun 28, 2017
db02ecb
Maybe this will help?
jackhymowitz Sep 6, 2017
1f02d6a
Buttons in FRC so that we can add FTC buttons
jackhymowitz Sep 6, 2017
e2d6c05
FTC port! It 100% works, after no testing and no features even coded.
jackhymowitz Sep 6, 2017
bfb12d9
Implementing basic features: Motors, Joysticks, in the middle of butt…
jackhymowitz Sep 6, 2017
09bd643
Finished Buttons; I had to write some python code to write this. Not …
jackhymowitz Sep 6, 2017
649bd8d
At least it compiles now
jackhymowitz Sep 8, 2017
5ef4f7b
makes drivetrain builder compile with ftc
jackhymowitz Sep 9, 2017
95047a8
That wasn't too bad. Everything but DriveEncodersGyro is done. That o…
jackhymowitz Sep 9, 2017
27777fd
Added a lot of methods that no longer default to empty.
jackhymowitz Sep 9, 2017
2738a7a
Much better, and I even used the Number inputs! I wonder if they work.
jackhymowitz Sep 9, 2017
8f9fd8d
OK, now I am done.
jackhymowitz Sep 9, 2017
6fd6a4c
Making this closer to working
jackhymowitz Sep 9, 2017
f439fec
Revert some of this
jackhymowitz Sep 9, 2017
9b113d9
Java 7 compliant for Android Studio
jackhymowitz Sep 15, 2017
1526b21
UniversalMapper created; should work for symmetric drivetrains, inclu…
jackhymowitz Sep 15, 2017
f9e4c91
Power (translation and turn) now a double from -1 to 1, for consisten…
jackhymowitz Sep 15, 2017
89d979c
Implement another method of registering modes, where auto modes exten…
jackhymowitz Sep 17, 2017
c14cb74
Added @Override annotations to FTCRobot
jackhymowitz Sep 17, 2017
78a9616
Little cleanup to remove all of FRC from Sprocket
jackhymowitz Sep 21, 2017
d3b4289
Added a Test package to complement the FRC and FTC packages, to enabl…
jackhymowitz Sep 21, 2017
822f175
Added a test bot, and actually used it to fix a bug (!!!wow!!11!!)
jackhymowitz Sep 21, 2017
75ef950
Fixing some inheritance
jackhymowitz Sep 21, 2017
0d4b100
Small bugfix; a variable was being overwritten when it shouldn't have…
jackhymowitz Sep 21, 2017
8024eb3
One small infinite loop actually when it is disabled; now it should b…
jackhymowitz Sep 21, 2017
026fecc
Added run to position methods to FTCMotor
jackhymowitz Sep 21, 2017
80d0911
Fixed NPE in FTCMotor
GarrettBurroughs Sep 25, 2017
3e88e4a
Auto modes will not work the way they were coded; this idea should wo…
jackhymowitz Sep 29, 2017
042e47c
Fixed a typo with the robot mode
rafibaum Oct 4, 2017
c7cf37a
Added 'isCloseTo' methods for FTCMotor
GarrettBurroughs Oct 4, 2017
329f219
Updated DriveTrainBuilder for 0.3
rafibaum Oct 4, 2017
c7b056b
Merge branch '0.3' of https://github.com/MontclairRobotics/Sprocket i…
GarrettBurroughs Oct 4, 2017
aa0038d
Created my own generic mapper for fun!
rafibaum Oct 14, 2017
396f1d9
Added code to handle motors of different powers
rafibaum Oct 14, 2017
0c8b8fe
Motor force needed to be normalised for previous commit.
rafibaum Oct 14, 2017
b26cc9c
Added a torque correction for wheels with different offsets
rafibaum Oct 14, 2017
7c16e38
Mecanum mapper that should work
rafibaum Nov 2, 2017
3bf4c81
Added scaling
rafibaum Nov 2, 2017
8b54079
Added comments and fixed a bug with scaling
rafibaum Nov 2, 2017
171d50f
Redid input system, and simplified UniversalMapper. Right now, turnin…
jackhymowitz Nov 3, 2017
8dbf1e5
Mecanum Driving! Using Universal Drivetrain.
jackhymowitz Nov 4, 2017
ad3daf0
Added some easier init methods
jackhymowitz Nov 4, 2017
3c3c0c9
bad commit
GarrettBurroughs Nov 4, 2017
3c0e1bc
Merge pull request #46 from rafibaum/rafi-mapper
GarrettBurroughs Jan 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 0 additions & 142 deletions src/org/montclairrobotics/sprocket/SprocketRobot.java

This file was deleted.

31 changes: 31 additions & 0 deletions src/org/montclairrobotics/sprocket/actions/Action.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.montclairrobotics.sprocket.actions;

/**
* This is designed to be the main base for every "thing" or action the robot can do
* This is extended by States, and consequently Auto Modes,
* so things that can be activated by entering "auto" mode, or "test" mode
* Also, buttons should take these as their actions,
* so that you can make something happen if you press a button.
* This hopefully should make it simple to implement routines, both in autonomous and during teleop
*
*/

public interface Action {
/**
* Called once when the object is activated
*/
public void start();
/**
* Called every loop the object is active, after it is activated
*/
public void enabled();
/**
* Called once when the object is deactivated
*/
public void stop();
/**
* Called every loop when the object is deactivated
* Note: this may not be called by every implementation
*/
public void disabled();
}
45 changes: 45 additions & 0 deletions src/org/montclairrobotics/sprocket/actions/MultiAction.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package org.montclairrobotics.sprocket.actions;

/**
* One can perform multiple actions with the same trigger with this utility object
*
*/

public class MultiAction implements Action {

private Action[] actions;

public MultiAction(Action... actions)
{
this.actions=actions;
}


@Override
public void start() {
for(Action a : actions) {
a.start();
}
}

@Override
public void enabled() {
for(Action a : actions) {
a.enabled();
}
}

@Override
public void stop() {
for(Action a : actions) {
a.stop();
}
}

@Override
public void disabled() {
for(Action a : actions) {
a.disabled();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
package org.montclairrobotics.sprocket.states;
package org.montclairrobotics.sprocket.actions;

import org.montclairrobotics.sprocket.utils.Input;

public class MultiState implements State {
/**
* Can perform multiple actions at once
*
*/

public class MultiState extends MultiAction implements State {

private State[] states;
private Input<Boolean> done;

public MultiState(Input<Boolean> done, State... states) {
this.states = states;
super(states);
this.done = done;
}

public MultiState(int stateToStopAt, State... states) {
public MultiState(final int stateToStopAt, final State... states) {
super(states);
if(stateToStopAt < 0 || stateToStopAt > states.length) {
this.done = new Input<Boolean>() {
@Override
Expand All @@ -33,34 +38,11 @@ public Boolean get() {
}
};
}

this.states = states;
}

public MultiState(State... states) {
this(-1, states);
}

@Override
public void start() {
for(State s : states) {
s.start();
}
}

@Override
public void stop() {
for(State s : states) {
s.stop();
}
}

@Override
public void stateUpdate() {
for(State s : states) {
s.stateUpdate();
}
}

@Override
public boolean isDone() {
Expand Down
28 changes: 28 additions & 0 deletions src/org/montclairrobotics/sprocket/actions/Reverse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.montclairrobotics.sprocket.actions;

public class Reverse implements Action{

private Action a;

public Reverse(Action a)
{
this.a=a;
}

public void start()
{
a.stop();
}
public void enabled()
{
a.disabled();
}
public void stop()
{
a.start();
}
public void disabled()
{
a.enabled();
}
}
55 changes: 55 additions & 0 deletions src/org/montclairrobotics/sprocket/actions/SplitButton.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package org.montclairrobotics.sprocket.actions;

import org.montclairrobotics.sprocket.core.Button;
import org.montclairrobotics.sprocket.utils.Input;

public class SplitButton extends Button{

private Input<Boolean> onButton;
private Input<Boolean> offButton;

private boolean active=false;

public SplitButton()
{
super();
}
public SplitButton(Input<Boolean> onButton,Input<Boolean> offButton)
{
this.onButton=onButton;
this.offButton=offButton;
}

public Input<Boolean> getOnButton() {
return onButton;
}
public SplitButton setOnButton(Input<Boolean> onButton) {
this.onButton = onButton;
return this;
}
public Input<Boolean> getOffButton() {
return offButton;
}
public SplitButton setOffButton(Input<Boolean> offButton) {
this.offButton = offButton;
return this;
}

public void update()
{
if(onButton.get())
{
active=true;
}
else if(active&&offButton.get())
{
active=false;
}
super.update();
}
public Boolean get()
{
return active;
}

}
11 changes: 11 additions & 0 deletions src/org/montclairrobotics/sprocket/actions/State.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.montclairrobotics.sprocket.actions;

/**
* The basic unit of a State Machine, very similar to Action,
* except States also know when they are finished.
* Consequently, state machines can be made which move from state to state when each one is finished.
*
*/
public interface State extends Action{
boolean isDone();
}
Loading