Difference between revisions of "Getting Started - Programming"

From FRC11 - Mentor Wiki
Jump to navigation Jump to search
 
(22 intermediate revisions by the same user not shown)
Line 1: Line 1:
−
=== MORT U 2018 ===
+
=== MORT U ===
−
* [[MORT U 2018]]
+
* [[MORT U 2019]]
 +
* [[MORT U Archives]]
  
 
=== The IDE ===
 
=== The IDE ===
Line 11: Line 12:
 
There are [https://www.upgrad.com/blog/intellij-idea-vs-eclipse-the-holy-war/ long standing battles] as to [https://dzone.com/articles/why-idea-better-eclipse which IDE] is [https://dzone.com/articles/i-still-prefer-eclipse-over-intellij-idea better].  However, as most of the tutorials available for FRC are given in Eclipse, everyone needs to know Eclipse.
 
There are [https://www.upgrad.com/blog/intellij-idea-vs-eclipse-the-holy-war/ long standing battles] as to [https://dzone.com/articles/why-idea-better-eclipse which IDE] is [https://dzone.com/articles/i-still-prefer-eclipse-over-intellij-idea better].  However, as most of the tutorials available for FRC are given in Eclipse, everyone needs to know Eclipse.
  
−
* [[Programming#Day_1_Installs | Installing Eclipse]] (mandatory)
+
* [[Programming#Day_1_Installs | Installing Eclipse]] (obsolete)
 +
 
 +
* [[Installing and Using Visual Studio Code | Installing Visual Studio]]
  
 
* [[Using the Eclipse IDE]]
 
* [[Using the Eclipse IDE]]
Line 20: Line 23:
 
Java is the language we use primarily to program the FRC robots.  It is a general purpose programming language that can do almost any variety of tasks.  It works hand-in-hand with WPI Lib to control the robot.
 
Java is the language we use primarily to program the FRC robots.  It is a general purpose programming language that can do almost any variety of tasks.  It works hand-in-hand with WPI Lib to control the robot.
  
−
* [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599681-installing-eclipse-c-java Getting Java]
+
* [https://wpilib.screenstepslive.com/s/currentCS/m/java/l/599681-installing-eclipse-c-java Getting Java with Eclipse]
 +
 
 +
Or manually with another IDE:
 +
 
 +
* [https://www.oracle.com/technetwork/es/java/javase/downloads/jdk8-downloads-2133151.html?printOnly=1 Get JDK 8]
 +
* [https://java.com/en/download/ Get Java]
  
 
See the [[Java]] page to learn more about how we use Java.
 
See the [[Java]] page to learn more about how we use Java.
Line 34: Line 42:
  
 
You can use LabVIEW on the Driver Station to program the onboard processor, though we usually use a laptop and download our software via an Ethernet cable.
 
You can use LabVIEW on the Driver Station to program the onboard processor, though we usually use a laptop and download our software via an Ethernet cable.
 +
 +
Default username and password for the RoboRIO is <code>admin</code> with a blank password. '''DO NOT CHANGE IT.'''
  
 
See more on the [[RoboRIO]] page.
 
See more on the [[RoboRIO]] page.
Line 44: Line 54:
 
* [https://wpilib.screenstepslive.com/s/currentCS/m/java Getting started with WPILib and Java]
 
* [https://wpilib.screenstepslive.com/s/currentCS/m/java Getting started with WPILib and Java]
 
* [http://first.wpi.edu/FRC/roborio/release/docs/java/ WPI Lib Java Reference]
 
* [http://first.wpi.edu/FRC/roborio/release/docs/java/ WPI Lib Java Reference]
−
* This link seems useless http://first.wpi.edu/FRC/index.html WPI Docs
 
  
 
=== LabVIEW and the Driver Station/Classmate ===
 
=== LabVIEW and the Driver Station/Classmate ===
Line 50: Line 59:
  
 
* [https://wpilib.screenstepslive.com/s/currentCS/m/driver_station Getting Started with the LabVIEW and the Driver Station]
 
* [https://wpilib.screenstepslive.com/s/currentCS/m/driver_station Getting Started with the LabVIEW and the Driver Station]
 +
* [https://wpilib.screenstepslive.com/s/currentCS/m/smartdashboard/l/255407-getting-started-with-the-smartdashboard Smart Dashboard]  The Smart Dashboard The SmartDashboard typically runs on the Driver Station computer and will do two functions:
 +
:# View robot data that is displayed as program status as your program is running.
 +
:# View sensor data and operate actuators in Test mode for robot subsystems to verify correct operation.
  
 
=== Version Control/Configuration Management - with Git ===
 
=== Version Control/Configuration Management - with Git ===
Line 56: Line 68:
 
Mostly, we use Git to save and share our code, but also for Change Control - preventing unwanted changes from disrupting an important build.  For example, perhaps we're working on some advanced autonomous code that is not ready for Week 1, but we still want it saved in the repository and shared.  But we have to deliver a build for Week 1 that works.  That ''advanced but not yet ready code'' can go into a different development branch that won't get pulled into the main product branch.
 
Mostly, we use Git to save and share our code, but also for Change Control - preventing unwanted changes from disrupting an important build.  For example, perhaps we're working on some advanced autonomous code that is not ready for Week 1, but we still want it saved in the repository and shared.  But we have to deliver a build for Week 1 that works.  That ''advanced but not yet ready code'' can go into a different development branch that won't get pulled into the main product branch.
  
−
* [[Version Control with Git]]
+
* [[Git Basics]]
 
Not sure this is the best link, but does appear useful. [https://git-scm.com/book/en/v1/Getting-Started Getting Started with Git].  See Chapters 1 and 2.
 
Not sure this is the best link, but does appear useful. [https://git-scm.com/book/en/v1/Getting-Started Getting Started with Git].  See Chapters 1 and 2.
  
 
=== '''Day 1 Installs ''' ===
 
=== '''Day 1 Installs ''' ===
−
# [https://wpilib.screenstepslive.com/s/currentCS/m/java/c/88899 Eclipse, Java, WPILib] (Install Eclipse and the FRC Update Suite)
+
# <s>[https://wpilib.screenstepslive.com/s/currentCS/m/java/c/88899 Eclipse, Java, WPILib] (Install Eclipse and the FRC Update Suite)</s>
−
# [https://git-scm.com/downloads Git]  (Install Git for the platform you are using)
+
# [[Installing and Using IntelliJ IDEA]] <br>IntelliJ (Integrated Development Environment (IDE)) <br>Note: Eclipse is being dismissed as the ''go to'' IDE for FRC.  They want to move to MS Visual Studio Code.  We do not. However, all of the current examples FRC provides is with Eclipse, and they are expected to move them to MS VS Code.  This leaves Benny in a bind because he has to provide ALL of the examples.
 +
# [https://www.oracle.com/technetwork/es/java/javase/downloads/jdk8-downloads-2133151.html?printOnly=1 Get JDK 8]
 +
# [https://java.com/en/download/ Get Java]
 +
# [https://plugins.jetbrains.com/plugin/9405-frc WPILib/FRC Plug-in for IntelliJ] ?? (TBD)
 +
# [https://git-scm.com/downloads Git] (Source Control. Install Git for the platform you are using.)
 +
# [https://tortoisegit.org/ Tortoise Git] (GUI for Source Control) Windows only, or
 +
# [https://sourceforge.net/projects/gitextensions/ Git Extensions] (A better GUI for Source Control) Windows (Maybe Mac and Linux with [https://en.wikipedia.org/wiki/Mono_(software) Mono .NET framework emulator])
 +
 
 +
Also see:
 +
* [[2019 Programming Build Season Installs]] which has information for FRC RoboRIO updates.
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Latest revision as of 19:36, 17 October 2019

MORT U

The IDE

The Integrated Development Environment (IDE), sometimes known as the editor is the programmers way of editing and compiling their code. This is where the programmers will do most of their work.

On this project, the default IDE that everyone needs to know is the Eclipse IDE. It's pretty much the standard IDE that has a wide array of useful features for editing a number of different languages.

Another IDE that the team has enjoyed is IntelliJ IDEA, which has some appreciated features that Eclipse lacks by default, such as integrated version control. However, that can be remedied by plugins for Eclipse, such as EGit.

There are long standing battles as to which IDE is better. However, as most of the tutorials available for FRC are given in Eclipse, everyone needs to know Eclipse.

Java

Java is the language we use primarily to program the FRC robots. It is a general purpose programming language that can do almost any variety of tasks. It works hand-in-hand with WPI Lib to control the robot.

Or manually with another IDE:

See the Java page to learn more about how we use Java.

The RoboRIO

The RoboRIO is a small embedded computer designed to control all functions on the robot, providing a variety input/output (I/O) facilities.

It is the main device that allows us to interface with the FRC Field Management System (FMS, sometimes known as The Field), taking commands such as the Start Autonomous signal or the Start Teleop signal. The RoboRIO allows us to read our sensors and control our motors and pneumatics. It can also interface with auxiliary on-board computers, such as the Kangaroo, and communicates with the Driver Station via WiFi, or a laptop for programming via Ethernet.

Picture of the RoboRIO

The RoboRIO includes built-in ports for inter-integrated circuits (I2C), serial peripheral interfaces (SPI), RS232, USB, Ethernet, pulse width modulation (PWM), and relays to quickly connect the common sensors and actuators used in robotics. The controller features LEDs, buttons, an onboard accelerometer, and a custom electronics port. It has a dual-core ARM real-time Cortex‑A9 processor and customizable Xilinx FPGA.

You can use LabVIEW on the Driver Station to program the onboard processor, though we usually use a laptop and download our software via an Ethernet cable.

Default username and password for the RoboRIO is admin with a blank password. DO NOT CHANGE IT.

See more on the RoboRIO page.

WPI Lib

Java may be the main language that we use to control the robot, but it does not provide an easy to use set of interfaces to do so on its own. The good folks at Worcester Polytechnic Institute (WPI) have, over the years, developed the low level code and higher level interfaces that provides a fairly comprehensive interface to the hardware provided by the RoboRIO, with mechanisms of control that we find useful.

The WPI Robotics library (WPILib) is a set of software classes that interfaces with the hardware and software in your FRC robot’s control system. There are classes to handle sensors, motor speed controllers, the driver station, and a number of other utility functions such as timing and field management. In addition, WPILib supports many commonly used sensors that are not in the kit, such as ultrasonic rangefinders.

LabVIEW and the Driver Station/Classmate

(TBD more on the LabVIEW, Dashboard, Driver Station)

  1. View robot data that is displayed as program status as your program is running.
  2. View sensor data and operate actuators in Test mode for robot subsystems to verify correct operation.

Version Control/Configuration Management - with Git

Version Control is a subset of Configuration Management and Change Control. Some people think of version control as a fancy backup, a software repository that allows you to rollback changes that broke things. It is that, but it's much more powerful and important. Configuration Management involves controlling what goes into a build - identifying what features are wanted and ready, and controlling the releases so that only the right code goes in. You don't want to include code that doesn't fit with the product that needs to be delivered. You also need to be able to reproduce an important, working, build that occurred at a previous time.

Mostly, we use Git to save and share our code, but also for Change Control - preventing unwanted changes from disrupting an important build. For example, perhaps we're working on some advanced autonomous code that is not ready for Week 1, but we still want it saved in the repository and shared. But we have to deliver a build for Week 1 that works. That advanced but not yet ready code can go into a different development branch that won't get pulled into the main product branch.

Not sure this is the best link, but does appear useful. Getting Started with Git. See Chapters 1 and 2.

Day 1 Installs

  1. Eclipse, Java, WPILib (Install Eclipse and the FRC Update Suite)
  2. Installing and Using IntelliJ IDEA
    IntelliJ (Integrated Development Environment (IDE))
    Note: Eclipse is being dismissed as the go to IDE for FRC. They want to move to MS Visual Studio Code. We do not. However, all of the current examples FRC provides is with Eclipse, and they are expected to move them to MS VS Code. This leaves Benny in a bind because he has to provide ALL of the examples.
  3. Get JDK 8
  4. Get Java
  5. WPILib/FRC Plug-in for IntelliJ ?? (TBD)
  6. Git (Source Control. Install Git for the platform you are using.)
  7. Tortoise Git (GUI for Source Control) Windows only, or
  8. Git Extensions (A better GUI for Source Control) Windows (Maybe Mac and Linux with Mono .NET framework emulator)

Also see: