From 713834ee2bce5433f9056520191057ba1a78d31e Mon Sep 17 00:00:00 2001 From: Retype GitHub Action Date: Wed, 18 Oct 2023 00:36:28 +0000 Subject: [PATCH] Refreshes Retype-generated documentation. Process triggered by MartinoPavesi. --- 404.html | 8 ++++---- git/index.html | 8 ++++---- index.html | 8 ++++---- java/apis/index.html | 8 ++++---- java/classes/index.html | 11 ++++++----- java/functions/index.html | 10 +++++----- java/index.html | 8 ++++---- java/types/index.html | 10 +++++----- java/variables/index.html | 10 +++++----- projectstructure/index.html | 8 ++++---- projectstructure/main/deploy/index.html | 8 ++++---- projectstructure/main/index.html | 8 ++++---- .../main/java/frc/robot/commands/index.html | 8 ++++---- .../java/frc/robot/constants.java/index.html | 8 ++++---- projectstructure/main/java/frc/robot/index.html | 8 ++++---- .../main/java/frc/robot/main.java/index.html | 8 ++++---- .../main/java/frc/robot/robot.java/index.html | 8 ++++---- .../frc/robot/robotcontainer.java/index.html | 8 ++++---- .../main/java/frc/robot/subsystems/index.html | 8 ++++---- projectstructure/main/java/index.html | 8 ++++---- projectstructure/main/java/util/index.html | 8 ++++---- projectstructure/test/index.html | 8 ++++---- resources/js/config.js | 2 +- resources/js/search.json | 2 +- robotprogramming/index.html | 8 ++++---- sitemap.xml.gz | Bin 462 -> 461 bytes 26 files changed, 99 insertions(+), 98 deletions(-) diff --git a/404.html b/404.html index 590eaab..d02a0ba 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ - + @@ -28,11 +28,11 @@ - + - + - +
diff --git a/git/index.html b/git/index.html index 6d6e718..a6c39e6 100644 --- a/git/index.html +++ b/git/index.html @@ -4,7 +4,7 @@ - + @@ -28,11 +28,11 @@ - + - + - +
diff --git a/index.html b/index.html index 0c40805..4cc062a 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/java/apis/index.html b/java/apis/index.html index a37495b..1fb4e6e 100644 --- a/java/apis/index.html +++ b/java/apis/index.html @@ -4,7 +4,7 @@ - + @@ -28,11 +28,11 @@ - + - + - +
diff --git a/java/classes/index.html b/java/classes/index.html index a42f4f7..7297cba 100644 --- a/java/classes/index.html +++ b/java/classes/index.html @@ -4,7 +4,7 @@ - + @@ -31,12 +31,12 @@ - + - + - - + +
@@ -189,6 +189,7 @@

There is a lot going on here, but lets break it down.
First, lets focus on modifiers. public and private before the variables, classes, and functions are modifiers. Modifiers allow us to give or restrict access to something. In this example, the variable robotAge is private, so that means only the class itself has access to it, and nothing else can read or write it. The variable isrobotOn however, is public, meaning any piece of code can read and write to it.

One important clairification to make is that these are not technically variables, they are members, that means they act slightly differently than variables. We will touch more on it later.

+

Next, lets talk about the constructor. The constructor is run when ever a new instance is created. This is our init function, and we usally initialize our member variables here. It looks sort of like a Function, but it doesn't have a return type, and the name of the function is capitalized and is the same as the class.

diff --git a/java/functions/index.html b/java/functions/index.html index 7dadb07..aeb1e6d 100644 --- a/java/functions/index.html +++ b/java/functions/index.html @@ -4,7 +4,7 @@ - + @@ -31,12 +31,12 @@ - + - + - - + +
diff --git a/java/index.html b/java/index.html index 3c0f981..ddb0292 100644 --- a/java/index.html +++ b/java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/java/types/index.html b/java/types/index.html index d6f52d2..6006492 100644 --- a/java/types/index.html +++ b/java/types/index.html @@ -4,7 +4,7 @@ - + @@ -31,12 +31,12 @@ - + - + - - + +
diff --git a/java/variables/index.html b/java/variables/index.html index 4aca95b..cd16fb4 100644 --- a/java/variables/index.html +++ b/java/variables/index.html @@ -4,7 +4,7 @@ - + @@ -31,12 +31,12 @@ - + - + - - + +
diff --git a/projectstructure/index.html b/projectstructure/index.html index c35f513..0351937 100644 --- a/projectstructure/index.html +++ b/projectstructure/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/deploy/index.html b/projectstructure/main/deploy/index.html index 5f979ac..051c214 100644 --- a/projectstructure/main/deploy/index.html +++ b/projectstructure/main/deploy/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/index.html b/projectstructure/main/index.html index 7edcc6d..ed9a00d 100644 --- a/projectstructure/main/index.html +++ b/projectstructure/main/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/commands/index.html b/projectstructure/main/java/frc/robot/commands/index.html index 1519bc9..fa938ac 100644 --- a/projectstructure/main/java/frc/robot/commands/index.html +++ b/projectstructure/main/java/frc/robot/commands/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/constants.java/index.html b/projectstructure/main/java/frc/robot/constants.java/index.html index 7c990f6..b7ab8d1 100644 --- a/projectstructure/main/java/frc/robot/constants.java/index.html +++ b/projectstructure/main/java/frc/robot/constants.java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/index.html b/projectstructure/main/java/frc/robot/index.html index 692ed4f..dd62b9a 100644 --- a/projectstructure/main/java/frc/robot/index.html +++ b/projectstructure/main/java/frc/robot/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/main.java/index.html b/projectstructure/main/java/frc/robot/main.java/index.html index ff904a7..327292e 100644 --- a/projectstructure/main/java/frc/robot/main.java/index.html +++ b/projectstructure/main/java/frc/robot/main.java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/robot.java/index.html b/projectstructure/main/java/frc/robot/robot.java/index.html index e2a59b2..495f54f 100644 --- a/projectstructure/main/java/frc/robot/robot.java/index.html +++ b/projectstructure/main/java/frc/robot/robot.java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/robotcontainer.java/index.html b/projectstructure/main/java/frc/robot/robotcontainer.java/index.html index ea0912b..feff73a 100644 --- a/projectstructure/main/java/frc/robot/robotcontainer.java/index.html +++ b/projectstructure/main/java/frc/robot/robotcontainer.java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/frc/robot/subsystems/index.html b/projectstructure/main/java/frc/robot/subsystems/index.html index d0efd13..275710c 100644 --- a/projectstructure/main/java/frc/robot/subsystems/index.html +++ b/projectstructure/main/java/frc/robot/subsystems/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/index.html b/projectstructure/main/java/index.html index 1766df9..d55a7ca 100644 --- a/projectstructure/main/java/index.html +++ b/projectstructure/main/java/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/main/java/util/index.html b/projectstructure/main/java/util/index.html index 8802c0e..87a9daf 100644 --- a/projectstructure/main/java/util/index.html +++ b/projectstructure/main/java/util/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/projectstructure/test/index.html b/projectstructure/test/index.html index f6543ed..b7b45ee 100644 --- a/projectstructure/test/index.html +++ b/projectstructure/test/index.html @@ -4,7 +4,7 @@ - + @@ -31,11 +31,11 @@ - + - + - +
diff --git a/resources/js/config.js b/resources/js/config.js index e59e6d3..f10755e 100644 --- a/resources/js/config.js +++ b/resources/js/config.js @@ -1 +1 @@ -var __DOCS_CONFIG__ = {"id":"lq194lIp+XV6ka2VyDF8Wh1t9s5dmMbAfnb","key":"T7XMAO+/E9lKINHkZHb0QXjGo/cMErFDFLWxXoh2NQQ.pWhdqnuNSZpXUfQAq2D47OQCDG2cPARMulfhGmxYxM38PyrqXN5Em/tUXgVqIYirP8ip+J/hMaCrNNU+q9OhkQ.8276","base":"/DreadDocs/","host":"dreadbot.github.io","version":"1.0.0","useRelativePaths":true,"documentName":"index.html","appendDocumentName":false,"trailingSlash":true,"preloadSearch":false,"cacheBustingToken":"3.5.0.749516207465","cacheBustingStrategy":"query","sidebarFilterPlaceholder":"Filter","toolbarFilterPlaceholder":"Filter","showSidebarFilter":true,"filterNotFoundMsg":"No member names found containing the query \"{query}\"","maxHistoryItems":15,"homeIcon":"","access":[{"value":"public","label":"Public"},{"value":"protected","label":"Protected"}],"toolbarLinks":[{"id":"fields","label":"Fields"},{"id":"properties","label":"Properties"},{"id":"methods","label":"Methods"},{"id":"events","label":"Events"}],"sidebar":[{"n":"/","l":"Welcome to the Dread​Docs!"},{"n":"java","l":"Java","i":[{"n":"variables","l":"Variables"},{"n":"functions","l":"Functions"},{"n":"classes","l":"Classes"},{"n":"apis","l":"AP​Is"},{"n":"types","l":"Types"}],"s":""},{"n":"projectstructure","l":"Project Structure","i":[{"n":"main","i":[{"n":"java","i":[{"n":"frc","c":false,"i":[{"n":"robot","i":[{"n":"commands","s":""},{"n":"subsystems","s":""},{"n":"constants.java","l":"Constants.​java","s":""},{"n":"main.java","l":"Main.​java","s":""},{"n":"robot.java","l":"Robot.​java","s":""},{"n":"robotcontainer.java","l":"Robot​Container.​java","s":""}],"s":""}],"s":""},{"n":"util","s":""}],"s":""},{"n":"deploy","s":""}],"s":""},{"n":"test","s":""}],"s":""},{"n":"git","l":"Git","s":""},{"n":"robotprogramming","l":"Robot Programming","s":""}],"search":{"mode":0,"minChars":2,"maxResults":20,"placeholder":"Search","hotkeys":["k"],"noResultsFoundMsg":"Sorry, no results found.","recognizeLanguages":true,"languages":[0],"preload":false},"resources":{"History_Title_Label":"History","History_ClearLink_Label":"Clear","History_NoHistory_Label":"No history items","API_AccessFilter_Label":"Access","API_ParameterSection_Label":"PARAMETERS","API_SignatureSection_Label":"SIGNATURE","API_CopyHint_Label":"Copy","API_CopyNameHint_Label":"Copy name","API_CopyLinkHint_Label":"Copy link","API_CopiedAckHint_Label":"Copied!","API_MoreOverloads_Label":"more","API_MoreDropdownItems_Label":"More","API_OptionalParameter_Label":"optional","API_DefaultParameterValue_Label":"Default value","API_InheritedFilter_Label":"Inherited","Search_Input_Placeholder":"Search","Toc_Contents_Label":"Contents","Toc_RelatedClasses_Label":"Related Classes","History_JustNowTime_Label":"just now","History_AgoTime_Label":"ago","History_YearTime_Label":"y","History_MonthTime_Label":"mo","History_DayTime_Label":"d","History_HourTime_Label":"h","History_MinuteTime_Label":"m","History_SecondTime_Label":"s"}}; +var __DOCS_CONFIG__ = {"id":"194eHk4KLBQY4CsjNu4J4QlzkTZiFcnycIH","key":"ZhYyVwi16vWX1axkHksVx77vbBoslJFHh7H75tu8HnE.hwiT1v/Vp4GAOIuLLnTpeg3XiogcJc/dVegUrdX+B1mY1lpaKv6mfjfNe947iFTlq6PcrGFEid4oNPCtxTbWqQ.8295","base":"/DreadDocs/","host":"dreadbot.github.io","version":"1.0.0","useRelativePaths":true,"documentName":"index.html","appendDocumentName":false,"trailingSlash":true,"preloadSearch":false,"cacheBustingToken":"3.5.0.750904585791","cacheBustingStrategy":"query","sidebarFilterPlaceholder":"Filter","toolbarFilterPlaceholder":"Filter","showSidebarFilter":true,"filterNotFoundMsg":"No member names found containing the query \"{query}\"","maxHistoryItems":15,"homeIcon":"","access":[{"value":"public","label":"Public"},{"value":"protected","label":"Protected"}],"toolbarLinks":[{"id":"fields","label":"Fields"},{"id":"properties","label":"Properties"},{"id":"methods","label":"Methods"},{"id":"events","label":"Events"}],"sidebar":[{"n":"/","l":"Welcome to the Dread​Docs!"},{"n":"java","l":"Java","i":[{"n":"variables","l":"Variables"},{"n":"functions","l":"Functions"},{"n":"classes","l":"Classes"},{"n":"apis","l":"AP​Is"},{"n":"types","l":"Types"}],"s":""},{"n":"projectstructure","l":"Project Structure","i":[{"n":"main","i":[{"n":"java","i":[{"n":"frc","c":false,"i":[{"n":"robot","i":[{"n":"commands","s":""},{"n":"subsystems","s":""},{"n":"constants.java","l":"Constants.​java","s":""},{"n":"main.java","l":"Main.​java","s":""},{"n":"robot.java","l":"Robot.​java","s":""},{"n":"robotcontainer.java","l":"Robot​Container.​java","s":""}],"s":""}],"s":""},{"n":"util","s":""}],"s":""},{"n":"deploy","s":""}],"s":""},{"n":"test","s":""}],"s":""},{"n":"git","l":"Git","s":""},{"n":"robotprogramming","l":"Robot Programming","s":""}],"search":{"mode":0,"minChars":2,"maxResults":20,"placeholder":"Search","hotkeys":["k"],"noResultsFoundMsg":"Sorry, no results found.","recognizeLanguages":true,"languages":[0],"preload":false},"resources":{"History_Title_Label":"History","History_ClearLink_Label":"Clear","History_NoHistory_Label":"No history items","API_AccessFilter_Label":"Access","API_ParameterSection_Label":"PARAMETERS","API_SignatureSection_Label":"SIGNATURE","API_CopyHint_Label":"Copy","API_CopyNameHint_Label":"Copy name","API_CopyLinkHint_Label":"Copy link","API_CopiedAckHint_Label":"Copied!","API_MoreOverloads_Label":"more","API_MoreDropdownItems_Label":"More","API_OptionalParameter_Label":"optional","API_DefaultParameterValue_Label":"Default value","API_InheritedFilter_Label":"Inherited","Search_Input_Placeholder":"Search","Toc_Contents_Label":"Contents","Toc_RelatedClasses_Label":"Related Classes","History_JustNowTime_Label":"just now","History_AgoTime_Label":"ago","History_YearTime_Label":"y","History_MonthTime_Label":"mo","History_DayTime_Label":"d","History_HourTime_Label":"h","History_MinuteTime_Label":"m","History_SecondTime_Label":"s"}}; diff --git a/resources/js/search.json b/resources/js/search.json index f164715..1f0293e 100644 --- a/resources/js/search.json +++ b/resources/js/search.json @@ -1 +1 @@ -[[{"i":"welcome-to-the-dreaddocs","l":"Welcome to the DreadDocs!","p":["Work in Progress!","Welcome to our Docs! Here you will find Information about WPILib, robot programming, and Java."]},{"i":"where-to-start","l":"Where to Start?","p":["Consider starting in Java, or if you know about Java and OOP, maybe start in Project Structure."]},{"l":"Getting Started","p":["If you are using a robotics computer, everything will be set up for you already!","This tutorial is focused on a Windows installation, if you need help with installation on a different OS, reach out on the Discord server","To get started, head to the WPILib Installation Guide and click the blue download button (It should be platform specific).","Once that has finished installing, right click on the .iso file and click mount.","After mounting the file, open the WPILibInstaller.exe executable.","Follow all of the prompts.","After that, WPILib should be installed"]}],[{"l":"Java"},{"i":"what-is-java","l":"What is Java?","p":["Java is a programming language that turns source code into 1s and 0s that the computer can understand. We use Java to tell our robot what to do by using variables, functions, classes, and APIs."]}],[{"l":"Variables","p":["A variable is kind of like a named box that holds something.","Here is a quick example in Java:","To create a variable, you need 4 things:","You need a type, a type tells us what that \"something\" is. In this case our type is a boolean which stores either a true or false.","You need a name, which in this case is isRobotOn, you will use this name to refrence the variable later.","You need an equals sign, this is how we tell Java that we want to assign a variable to a value.","And lastly, you need a value, which in this case is false."]},{"l":"Common Types in Robot Programming and Their Values","p":["Type","Value","int","Whole numbers (such as 1, 2, -3, etc.)","double","Numbers with a decimal (such as 1.234)","boolean","Can be true or false","More information on booleans is available at Control Flow. More information on types is available at Types. For more information of variables, consider checking out the W3 Schools Java Tutorial."]}],[{"l":"Functions","p":["A Function is a way of packaging code so that we can reuse it. A function can have inputs and outputs, so they can be quite a useful tool in Java programming.","Here is a simple example:","There is a lot going on here but we will focus on the function declaration. to declare a function, we simply need a type and a name. The type tells us what the function will return, in this case that is void, which is nothing. The name of the function is how we reference it. After the name comes the parentheses, which hold the paramters of the function, we will go into depth about parameters later. In this case there are no parameters, so it's just the parentheses. Lastly, we have the curly brackets. These tell Java where the code for the function starts and ends."]},{"l":"Parameters and Returns","p":["Sometimes, we want a function to do something based on an input, and give an output. Thats where parameters and returns come in. Here is an example of parameters and returns","To add parameters to a function, simply give the parameter a type and a name and add a comma in between each parameter. you can user parameters as a kind of local variable that only exists inside the function declaration. To return something from a function, use the return keyword. You can pass either a variable or an expression (as we have in this case). Notice how we changed the functions type to reflect what we are returning. To call any function, just write the name with a pair of parentheses in which you add any parameters the function has. For more information on types when working with functions, check out Types"]}],[{"l":"Classes","p":["Classes are one of the most important features of Java. They allow us to represent and package code in a way that is easy and convient to reuse. Lets look at an example:","There is a lot going on here, but lets break it down. First, lets focus on modifiers. public and private before the variables, classes, and functions are modifiers. Modifiers allow us to give or restrict access to something. In this example, the variable robotAge is private, so that means only the class itself has access to it, and nothing else can read or write it. The variable isrobotOn however, is public, meaning any piece of code can read and write to it.","One important clairification to make is that these are not technically variables, they are members, that means they act slightly differently than variables. We will touch more on it later."]}],[{"l":"APIs"}],[{"l":"Types"},{"i":"what-are-types","l":"What Are types?","p":["Java is a statically typed langauge. This means that we have to work with types. Types are how we tell Java what something is or returns. In variables, we looked at this example:","Here, we tell java what the data that the variable contains is. In this case, the variable isRobotOn is of type boolean.","In functions, we looked at this example:","In this example, we tell Java what this function will return, this allows us to guarantee* that we will get a return value of type int. This allows has the side effect of being able to use Code Completion on a lot more objects and variables that we would be able to otherwise.* This is true for about 99% of cases"]},{"l":"Primitives","p":["A fracional number that goes up to 15 decimal places","A fracional number that goes up to 7 decimal places (1.234, etc.)","A number from -2147483648 to 2147483647","A number from -32768 to 32767","A number from 0 to 255","A single character","A true or false value","boolean","byte","char","double","float","int","Integers (1, 2, 3, etc.)","long","Meaning","Name","short","So far, all the types we have been looking at have been primitives. A primitive is a type that Java supplies us by default. You can tell which types are primitives as primitives always start with a lowercase. Here are some primitives:"]},{"l":"Other Types","p":["So far, we have only looked at primitives, but Java has more to offer then that! We are going to look at non-primitive data types. You can tell if a type is not a primitive if it starts with an uppercase.","For example:","How do we create types? Its super simple! We simply use the class name of the class we are instantiating as the type. For more information about instantiating classes, check out classes."]}],[{"l":"Project Structure","p":["Knowing project structure is very important to being able to collaboratively program effectively. It allows us to stay organized and find things easily and efficiently. However, to someone who is new to the project and programming in general it can be very daunting to figure out where everything is and what it does. The different folders inside this section will be laid out similarly to how our code is usally organized.","This layout assumes you are in src/"]}],[{"l":"main","p":["This is where the main portion of our code is kept."]}],[{"l":"java","p":["This is where we keep all of our Java source code."]}],[{"l":"robot","p":["This is where you will find all of our core robot code."]}],[{"l":"commands","p":["This is where we keep all of our commands. This are specific actions that we can run on events. They will usally be in a subsystem specific folder."]}],[{"l":"subsystems","p":["This is where we keep all of our subsystems. You can think of a subsystem as a specific part of the robot. For example, a grabber would be considered a subsystem."]}],[{"i":"constantsjava","l":"Constants.java","p":["Here you will find all of our constant values, anything like a gear ratio, wheel circumference, or controller port will be found here."]}],[{"i":"mainjava","l":"Main.java","p":["This is the entry point to the robot code. This is the first thing that is run when the robot turns on. We rarely if ever have to edit this."]}],[{"i":"robotjava","l":"Robot.java","p":["This contains the initalization of the command based system that we use, as well as some low level robot things such as path loading and generation."]}],[{"i":"robotcontainerjava","l":"RobotContainer.java","p":["This is were we instanciate our subsystems, bind our buttons, and setup default commands. This is the file that you will come back to the most."]}],[{"l":"util","p":["This is where we keep all of our utilities, or things that we reuse season after season. You see a lot of files reference the utils folder so its good to familiarize yourself with them."]}],[{"l":"deploy","p":["Anything that needs to be deployed onto the roborio is put in this folder. The most common thing we need to deploy are paths."]}],[{"l":"test","p":["We write all of our unit tests in this folder. The rest of the path is /Java/frc/Robot"]}],[{"l":"Git"}],[{"l":"Robot Programming"}]] \ No newline at end of file +[[{"i":"welcome-to-the-dreaddocs","l":"Welcome to the DreadDocs!","p":["Work in Progress!","Welcome to our Docs! Here you will find Information about WPILib, robot programming, and Java."]},{"i":"where-to-start","l":"Where to Start?","p":["Consider starting in Java, or if you know about Java and OOP, maybe start in Project Structure."]},{"l":"Getting Started","p":["If you are using a robotics computer, everything will be set up for you already!","This tutorial is focused on a Windows installation, if you need help with installation on a different OS, reach out on the Discord server","To get started, head to the WPILib Installation Guide and click the blue download button (It should be platform specific).","Once that has finished installing, right click on the .iso file and click mount.","After mounting the file, open the WPILibInstaller.exe executable.","Follow all of the prompts.","After that, WPILib should be installed"]}],[{"l":"Java"},{"i":"what-is-java","l":"What is Java?","p":["Java is a programming language that turns source code into 1s and 0s that the computer can understand. We use Java to tell our robot what to do by using variables, functions, classes, and APIs."]}],[{"l":"Variables","p":["A variable is kind of like a named box that holds something.","Here is a quick example in Java:","To create a variable, you need 4 things:","You need a type, a type tells us what that \"something\" is. In this case our type is a boolean which stores either a true or false.","You need a name, which in this case is isRobotOn, you will use this name to refrence the variable later.","You need an equals sign, this is how we tell Java that we want to assign a variable to a value.","And lastly, you need a value, which in this case is false."]},{"l":"Common Types in Robot Programming and Their Values","p":["Type","Value","int","Whole numbers (such as 1, 2, -3, etc.)","double","Numbers with a decimal (such as 1.234)","boolean","Can be true or false","More information on booleans is available at Control Flow. More information on types is available at Types. For more information of variables, consider checking out the W3 Schools Java Tutorial."]}],[{"l":"Functions","p":["A Function is a way of packaging code so that we can reuse it. A function can have inputs and outputs, so they can be quite a useful tool in Java programming.","Here is a simple example:","There is a lot going on here but we will focus on the function declaration. to declare a function, we simply need a type and a name. The type tells us what the function will return, in this case that is void, which is nothing. The name of the function is how we reference it. After the name comes the parentheses, which hold the paramters of the function, we will go into depth about parameters later. In this case there are no parameters, so it's just the parentheses. Lastly, we have the curly brackets. These tell Java where the code for the function starts and ends."]},{"l":"Parameters and Returns","p":["Sometimes, we want a function to do something based on an input, and give an output. Thats where parameters and returns come in. Here is an example of parameters and returns","To add parameters to a function, simply give the parameter a type and a name and add a comma in between each parameter. you can user parameters as a kind of local variable that only exists inside the function declaration. To return something from a function, use the return keyword. You can pass either a variable or an expression (as we have in this case). Notice how we changed the functions type to reflect what we are returning. To call any function, just write the name with a pair of parentheses in which you add any parameters the function has. For more information on types when working with functions, check out Types"]}],[{"l":"Classes","p":["Classes are one of the most important features of Java. They allow us to represent and package code in a way that is easy and convient to reuse. Lets look at an example:","There is a lot going on here, but lets break it down. First, lets focus on modifiers. public and private before the variables, classes, and functions are modifiers. Modifiers allow us to give or restrict access to something. In this example, the variable robotAge is private, so that means only the class itself has access to it, and nothing else can read or write it. The variable isrobotOn however, is public, meaning any piece of code can read and write to it.","One important clairification to make is that these are not technically variables, they are members, that means they act slightly differently than variables. We will touch more on it later.","Next, lets talk about the constructor. The constructor is run when ever a new instance is created. This is our init function, and we usally initialize our member variables here. It looks sort of like a Function, but it doesn't have a return type, and the name of the function is capitalized and is the same as the class."]}],[{"l":"APIs"}],[{"l":"Types"},{"i":"what-are-types","l":"What Are types?","p":["Java is a statically typed langauge. This means that we have to work with types. Types are how we tell Java what something is or returns. In variables, we looked at this example:","Here, we tell java what the data that the variable contains is. In this case, the variable isRobotOn is of type boolean.","In functions, we looked at this example:","In this example, we tell Java what this function will return, this allows us to guarantee* that we will get a return value of type int. This allows has the side effect of being able to use Code Completion on a lot more objects and variables that we would be able to otherwise.* This is true for about 99% of cases"]},{"l":"Primitives","p":["A fracional number that goes up to 15 decimal places","A fracional number that goes up to 7 decimal places (1.234, etc.)","A number from -2147483648 to 2147483647","A number from -32768 to 32767","A number from 0 to 255","A single character","A true or false value","boolean","byte","char","double","float","int","Integers (1, 2, 3, etc.)","long","Meaning","Name","short","So far, all the types we have been looking at have been primitives. A primitive is a type that Java supplies us by default. You can tell which types are primitives as primitives always start with a lowercase. Here are some primitives:"]},{"l":"Other Types","p":["So far, we have only looked at primitives, but Java has more to offer then that! We are going to look at non-primitive data types. You can tell if a type is not a primitive if it starts with an uppercase.","For example:","How do we create types? Its super simple! We simply use the class name of the class we are instantiating as the type. For more information about instantiating classes, check out classes."]}],[{"l":"Project Structure","p":["Knowing project structure is very important to being able to collaboratively program effectively. It allows us to stay organized and find things easily and efficiently. However, to someone who is new to the project and programming in general it can be very daunting to figure out where everything is and what it does. The different folders inside this section will be laid out similarly to how our code is usally organized.","This layout assumes you are in src/"]}],[{"l":"main","p":["This is where the main portion of our code is kept."]}],[{"l":"java","p":["This is where we keep all of our Java source code."]}],[{"l":"robot","p":["This is where you will find all of our core robot code."]}],[{"l":"commands","p":["This is where we keep all of our commands. This are specific actions that we can run on events. They will usally be in a subsystem specific folder."]}],[{"l":"subsystems","p":["This is where we keep all of our subsystems. You can think of a subsystem as a specific part of the robot. For example, a grabber would be considered a subsystem."]}],[{"i":"constantsjava","l":"Constants.java","p":["Here you will find all of our constant values, anything like a gear ratio, wheel circumference, or controller port will be found here."]}],[{"i":"mainjava","l":"Main.java","p":["This is the entry point to the robot code. This is the first thing that is run when the robot turns on. We rarely if ever have to edit this."]}],[{"i":"robotjava","l":"Robot.java","p":["This contains the initalization of the command based system that we use, as well as some low level robot things such as path loading and generation."]}],[{"i":"robotcontainerjava","l":"RobotContainer.java","p":["This is were we instanciate our subsystems, bind our buttons, and setup default commands. This is the file that you will come back to the most."]}],[{"l":"util","p":["This is where we keep all of our utilities, or things that we reuse season after season. You see a lot of files reference the utils folder so its good to familiarize yourself with them."]}],[{"l":"deploy","p":["Anything that needs to be deployed onto the roborio is put in this folder. The most common thing we need to deploy are paths."]}],[{"l":"test","p":["We write all of our unit tests in this folder. The rest of the path is /Java/frc/Robot"]}],[{"l":"Git"}],[{"l":"Robot Programming"}]] \ No newline at end of file diff --git a/robotprogramming/index.html b/robotprogramming/index.html index 25c566f..216628e 100644 --- a/robotprogramming/index.html +++ b/robotprogramming/index.html @@ -4,7 +4,7 @@ - + @@ -28,11 +28,11 @@ - + - + - +
diff --git a/sitemap.xml.gz b/sitemap.xml.gz index eab250a4cf109fae91a5b88ce749db89dda5eefb..4c2e916c6580487804cf2e3c7985b994e1da0e0a 100644 GIT binary patch delta 447 zcmV;w0YLuF1I+`F7=KIm(;_Grv?pMf-9j25sA;O$<>&3^c4*TkG)h&~yUOWx6a8?W^t*=01K*}{t!wq6H7Gl5OM_^D} z*+As{T7cTn1jI=w;wTT_Y{rKT+Uk?#KJ9IiJkLeH8Ww{f=zn(VM*6FqDmr~2gVJkR zE*(Z|gPV3487JnQXzmnH9Am p{)n@~`8hv@5z?CWdu4eyJ=y!91m3`n_#MYut1WG-CwZ%AMqZnk1L>nw6%$5lSwHj#KVi zUbVGCN^OQDA%8qhPxg3<_5#fV$IZ5r-pFOeLpRE~@$k?vp-s8bWMg>9CfCW_l~=+$ zGUR~1<8&v>cnu>+@ zqA_|d*_E?a)+I}+$}S%oU+AG-!U3qyzEOTfO$o{xAvxmep0X=7dLL)#WPJG7rtiOO q_$g