forked from ftctechnh/ftc_app
-
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 #1 from CHSRobo/teamModules
Team modules
- Loading branch information
Showing
20 changed files
with
503 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// build.gradle in TeamCode | ||
// | ||
// Most of the definitions for building your module reside in a common, shared | ||
// file 'build.common.gradle'. Being factored in this way makes it easier to | ||
// integrate updates to the FTC into your code. If you really need to customize | ||
// the build definitions, you can place those customizations in this file, but | ||
// please think carefully as to whether such customizations are really necessary | ||
// before doing so. | ||
|
||
|
||
// Custom definitions may go here | ||
|
||
// Include common definitions from above. | ||
apply from: '../build.common.gradle' | ||
|
||
android { | ||
buildToolsVersion '25.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dependencies { | ||
compile project(':FtcRobotController') | ||
compile (name: 'RobotCore-release', ext: 'aar') | ||
compile (name: 'Hardware-release', ext: 'aar') | ||
compile (name: 'FtcCommon-release', ext: 'aar') | ||
compile (name:'Analytics-release', ext:'aar') | ||
compile (name:'WirelessP2p-release', ext:'aar') | ||
} |
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- Note: the actual manifest file used in your APK merges this file with contributions | ||
from the modules on which your app depends (such as FtcRobotController, etc). | ||
So it won't ultimately be as empty as it might here appear to be :-) --> | ||
|
||
<!-- The package name here determines the package for your R class and your BuildConfig class --> | ||
<manifest | ||
package="org.firstinspires.ftc.team11383" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<application/> | ||
</manifest> |
121 changes: 121 additions & 0 deletions
121
Team11383/src/main/java/org/firstinspires/ftc/team11383/readme.md
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,121 @@ | ||
## TeamCode Module | ||
|
||
Welcome! | ||
|
||
This module, TeamCode, is the place where you will write/paste the code for your team's | ||
robot controller App. This module is currently empty (a clean slate) but the | ||
process for adding OpModes is straightforward. | ||
|
||
## Creating your own OpModes | ||
|
||
The easiest way to create your own OpMode is to copy a Sample OpMode and make it your own. | ||
|
||
Sample opmodes exist in the FtcRobotController module. | ||
To locate these samples, find the FtcRobotController module in the "Project/Android" tab. | ||
|
||
Expand the following tree elements: | ||
FtcRobotController / java / org.firstinspires.ftc.robotcontroller / external / samples | ||
|
||
A range of different samples classes can be seen in this folder. | ||
The class names follow a naming convention which indicates the purpose of each class. | ||
The full description of this convention is found in the samples/sample_convention.md file. | ||
|
||
A brief synopsis of the naming convention is given here: | ||
The prefix of the name will be one of the following: | ||
|
||
* Template: This is a minimally functional OpMode used to illustrate the skeleton/structure | ||
of a particular style of OpMode. These are bare bones examples. | ||
* Sensor: This is a Sample OpMode that shows how to use a specific sensor. | ||
It is not intended as a functioning robot, it is simply showing the minimal code | ||
required to read and display the sensor values. | ||
* Hardware: This is not an actual OpMode, but a helper class that is used to describe | ||
one particular robot's hardware devices: eg: for a Pushbot. Look at any | ||
Pushbot sample to see how this can be used in an OpMode. | ||
Teams can copy one of these to create their own robot definition. | ||
* Pushbot: This is a Sample OpMode that uses the Pushbot robot structure as a base. | ||
* Concept: This is a sample OpMode that illustrates performing a specific function or concept. | ||
These may be complex, but their operation should be explained clearly in the comments, | ||
or the header should reference an external doc, guide or tutorial. | ||
* Library: This is a class, or set of classes used to implement some strategy. | ||
These will typically NOT implement a full OpMode. Instead they will be included | ||
by an OpMode to provide some stand-alone capability. | ||
|
||
Once you are familiar with the range of samples available, you can choose one to be the | ||
basis for your own robot. In all cases, the desired sample(s) needs to be copied into | ||
your team's module to be used. | ||
|
||
This is done inside Android Studio directly, using the following steps: | ||
|
||
1) Locate the desired sample class in the Project/Android tree. | ||
|
||
2) Right click on the sample class and select "Copy" | ||
|
||
3) Expand the TeamCode / java folder | ||
|
||
4) Right click on the org.firstinspires.ftc.teamcode folder and select "Paste" | ||
|
||
5) You will be prompted for a class name for the copy. | ||
Choose something meaningful based on the purpose of this class. | ||
Start with a capital letter, and remember that there may be more similar classes later. | ||
|
||
Once your copy has been created, you should prepare it for use on your robot. | ||
This is done by adjusting the OpMode's name, and enabling it to be displayed on the | ||
Driver Station's OpMode list. | ||
|
||
Each OpMode sample class begins with several lines of code like the ones shown below: | ||
|
||
``` | ||
@TeleOp(name="Template: Linear OpMode", group="Linear Opmode") | ||
@Disabled | ||
``` | ||
|
||
The name that will appear on the driver station's "opmode list" is defined by the code: | ||
``name="Template: Linear OpMode"`` | ||
You can change what appears between the quotes to better describe your opmode. | ||
The "group=" portion of the code can be used to help organize your list of OpModes. | ||
|
||
As shown, the current OpMode will NOT appear on the driver station's OpMode list because of the | ||
``@Disabled`` annotation which has been included. | ||
This line can simply be deleted , or commented out, to make the OpMode visible. | ||
|
||
|
||
|
||
## ADVANCED Multi-Team App management: Cloning the TeamCode Module | ||
|
||
In some situations, you have multiple teams in your club and you want them to all share | ||
a common code organization, with each being able to *see* the others code but each having | ||
their own team module with their own code that they maintain themselves. | ||
|
||
In this situation, you might wish to clone the TeamCode module, once for each of these teams. | ||
Each of the clones would then appear along side each other in the Android Studio module list, | ||
together with the FtcRobotController module (and the original TeamCode module). | ||
|
||
Selective Team phones can then be programmed by selecting the desired Module from the pulldown list | ||
prior to clicking to the green Run arrow. | ||
|
||
Warning: This is not for the inexperienced Software developer. | ||
You will need to be comfortable with File manipulations and managing Android Studio Modules. | ||
These changes are performed OUTSIDE of Android Studios, so close Android Studios before you do this. | ||
|
||
Also.. Make a full project backup before you start this :) | ||
|
||
To clone TeamCode, do the following: | ||
|
||
Note: Some names start with "Team" and others start with "team". This is intentional. | ||
|
||
1) Using your operating system file management tools, copy the whole "TeamCode" | ||
folder to a sibling folder with a corresponding new name, eg: "Team0417". | ||
|
||
2) In the new Team0417 folder, delete the TeamCode.iml file. | ||
|
||
3) the new Team0417 folder, rename the "src/main/java/org/firstinspires/ftc/teamcode" folder | ||
to a matching name with a lowercase 'team' eg: "team0417". | ||
|
||
4) In the new Team0417/src/main folder, edit the "AndroidManifest.xml" file, change the line that contains | ||
package="org.firstinspires.ftc.teamcode" | ||
to be | ||
package="org.firstinspires.ftc.team0417" | ||
|
||
5) Add: include ':Team0417' to the "/settings.gradle" file. | ||
|
||
6) Open up Android Studios and clean out any old files by using the menu to "Build/Clean Project"" |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
</resources> |
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,19 @@ | ||
// | ||
// build.gradle in TeamCode | ||
// | ||
// Most of the definitions for building your module reside in a common, shared | ||
// file 'build.common.gradle'. Being factored in this way makes it easier to | ||
// integrate updates to the FTC into your code. If you really need to customize | ||
// the build definitions, you can place those customizations in this file, but | ||
// please think carefully as to whether such customizations are really necessary | ||
// before doing so. | ||
|
||
|
||
// Custom definitions may go here | ||
|
||
// Include common definitions from above. | ||
apply from: '../build.common.gradle' | ||
|
||
android { | ||
buildToolsVersion '25.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dependencies { | ||
compile project(':FtcRobotController') | ||
compile (name: 'RobotCore-release', ext: 'aar') | ||
compile (name: 'Hardware-release', ext: 'aar') | ||
compile (name: 'FtcCommon-release', ext: 'aar') | ||
compile (name:'Analytics-release', ext:'aar') | ||
compile (name:'WirelessP2p-release', ext:'aar') | ||
} |
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- Note: the actual manifest file used in your APK merges this file with contributions | ||
from the modules on which your app depends (such as FtcRobotController, etc). | ||
So it won't ultimately be as empty as it might here appear to be :-) --> | ||
|
||
<!-- The package name here determines the package for your R class and your BuildConfig class --> | ||
<manifest | ||
package="org.firstinspires.ftc.team11750" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<application/> | ||
</manifest> |
121 changes: 121 additions & 0 deletions
121
Team11750/src/main/java/org/firstinspires/ftc/team11750/readme.md
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,121 @@ | ||
## TeamCode Module | ||
|
||
Welcome! | ||
|
||
This module, TeamCode, is the place where you will write/paste the code for your team's | ||
robot controller App. This module is currently empty (a clean slate) but the | ||
process for adding OpModes is straightforward. | ||
|
||
## Creating your own OpModes | ||
|
||
The easiest way to create your own OpMode is to copy a Sample OpMode and make it your own. | ||
|
||
Sample opmodes exist in the FtcRobotController module. | ||
To locate these samples, find the FtcRobotController module in the "Project/Android" tab. | ||
|
||
Expand the following tree elements: | ||
FtcRobotController / java / org.firstinspires.ftc.robotcontroller / external / samples | ||
|
||
A range of different samples classes can be seen in this folder. | ||
The class names follow a naming convention which indicates the purpose of each class. | ||
The full description of this convention is found in the samples/sample_convention.md file. | ||
|
||
A brief synopsis of the naming convention is given here: | ||
The prefix of the name will be one of the following: | ||
|
||
* Template: This is a minimally functional OpMode used to illustrate the skeleton/structure | ||
of a particular style of OpMode. These are bare bones examples. | ||
* Sensor: This is a Sample OpMode that shows how to use a specific sensor. | ||
It is not intended as a functioning robot, it is simply showing the minimal code | ||
required to read and display the sensor values. | ||
* Hardware: This is not an actual OpMode, but a helper class that is used to describe | ||
one particular robot's hardware devices: eg: for a Pushbot. Look at any | ||
Pushbot sample to see how this can be used in an OpMode. | ||
Teams can copy one of these to create their own robot definition. | ||
* Pushbot: This is a Sample OpMode that uses the Pushbot robot structure as a base. | ||
* Concept: This is a sample OpMode that illustrates performing a specific function or concept. | ||
These may be complex, but their operation should be explained clearly in the comments, | ||
or the header should reference an external doc, guide or tutorial. | ||
* Library: This is a class, or set of classes used to implement some strategy. | ||
These will typically NOT implement a full OpMode. Instead they will be included | ||
by an OpMode to provide some stand-alone capability. | ||
|
||
Once you are familiar with the range of samples available, you can choose one to be the | ||
basis for your own robot. In all cases, the desired sample(s) needs to be copied into | ||
your team's module to be used. | ||
|
||
This is done inside Android Studio directly, using the following steps: | ||
|
||
1) Locate the desired sample class in the Project/Android tree. | ||
|
||
2) Right click on the sample class and select "Copy" | ||
|
||
3) Expand the TeamCode / java folder | ||
|
||
4) Right click on the org.firstinspires.ftc.teamcode folder and select "Paste" | ||
|
||
5) You will be prompted for a class name for the copy. | ||
Choose something meaningful based on the purpose of this class. | ||
Start with a capital letter, and remember that there may be more similar classes later. | ||
|
||
Once your copy has been created, you should prepare it for use on your robot. | ||
This is done by adjusting the OpMode's name, and enabling it to be displayed on the | ||
Driver Station's OpMode list. | ||
|
||
Each OpMode sample class begins with several lines of code like the ones shown below: | ||
|
||
``` | ||
@TeleOp(name="Template: Linear OpMode", group="Linear Opmode") | ||
@Disabled | ||
``` | ||
|
||
The name that will appear on the driver station's "opmode list" is defined by the code: | ||
``name="Template: Linear OpMode"`` | ||
You can change what appears between the quotes to better describe your opmode. | ||
The "group=" portion of the code can be used to help organize your list of OpModes. | ||
|
||
As shown, the current OpMode will NOT appear on the driver station's OpMode list because of the | ||
``@Disabled`` annotation which has been included. | ||
This line can simply be deleted , or commented out, to make the OpMode visible. | ||
|
||
|
||
|
||
## ADVANCED Multi-Team App management: Cloning the TeamCode Module | ||
|
||
In some situations, you have multiple teams in your club and you want them to all share | ||
a common code organization, with each being able to *see* the others code but each having | ||
their own team module with their own code that they maintain themselves. | ||
|
||
In this situation, you might wish to clone the TeamCode module, once for each of these teams. | ||
Each of the clones would then appear along side each other in the Android Studio module list, | ||
together with the FtcRobotController module (and the original TeamCode module). | ||
|
||
Selective Team phones can then be programmed by selecting the desired Module from the pulldown list | ||
prior to clicking to the green Run arrow. | ||
|
||
Warning: This is not for the inexperienced Software developer. | ||
You will need to be comfortable with File manipulations and managing Android Studio Modules. | ||
These changes are performed OUTSIDE of Android Studios, so close Android Studios before you do this. | ||
|
||
Also.. Make a full project backup before you start this :) | ||
|
||
To clone TeamCode, do the following: | ||
|
||
Note: Some names start with "Team" and others start with "team". This is intentional. | ||
|
||
1) Using your operating system file management tools, copy the whole "TeamCode" | ||
folder to a sibling folder with a corresponding new name, eg: "Team0417". | ||
|
||
2) In the new Team0417 folder, delete the TeamCode.iml file. | ||
|
||
3) the new Team0417 folder, rename the "src/main/java/org/firstinspires/ftc/teamcode" folder | ||
to a matching name with a lowercase 'team' eg: "team0417". | ||
|
||
4) In the new Team0417/src/main folder, edit the "AndroidManifest.xml" file, change the line that contains | ||
package="org.firstinspires.ftc.teamcode" | ||
to be | ||
package="org.firstinspires.ftc.team0417" | ||
|
||
5) Add: include ':Team0417' to the "/settings.gradle" file. | ||
|
||
6) Open up Android Studios and clean out any old files by using the menu to "Build/Clean Project"" |
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,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
|
||
</resources> |
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,19 @@ | ||
// | ||
// build.gradle in TeamCode | ||
// | ||
// Most of the definitions for building your module reside in a common, shared | ||
// file 'build.common.gradle'. Being factored in this way makes it easier to | ||
// integrate updates to the FTC into your code. If you really need to customize | ||
// the build definitions, you can place those customizations in this file, but | ||
// please think carefully as to whether such customizations are really necessary | ||
// before doing so. | ||
|
||
|
||
// Custom definitions may go here | ||
|
||
// Include common definitions from above. | ||
apply from: '../build.common.gradle' | ||
|
||
android { | ||
buildToolsVersion '25.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
dependencies { | ||
compile project(':FtcRobotController') | ||
compile (name: 'RobotCore-release', ext: 'aar') | ||
compile (name: 'Hardware-release', ext: 'aar') | ||
compile (name: 'FtcCommon-release', ext: 'aar') | ||
compile (name:'Analytics-release', ext:'aar') | ||
compile (name:'WirelessP2p-release', ext:'aar') | ||
} |
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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!-- Note: the actual manifest file used in your APK merges this file with contributions | ||
from the modules on which your app depends (such as FtcRobotController, etc). | ||
So it won't ultimately be as empty as it might here appear to be :-) --> | ||
|
||
<!-- The package name here determines the package for your R class and your BuildConfig class --> | ||
<manifest | ||
package="org.firstinspires.ftc.team7153" | ||
xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<application/> | ||
</manifest> |
Oops, something went wrong.