Difference between revisions of "Programming"

From FRC11 - Mentor Wiki
Jump to navigation Jump to search
Line 66: Line 66:
 
|[[Advanced Topics]]
 
|[[Advanced Topics]]
 
|}
 
|}
−
 
−
 
−
* [[Linux distributions]]
 
−
:: Red Hat, Debian, (X/K/L)Ubuntu, LXLE, Mint, Zorin, ChruchBase, Arch(Bang), and 'NI Linux Real-Time' (which is a rip of Red Hat Linux with modifications to preempt kernel functions to make it more realtime).
 
−
 
−
* [[FRC controls systems]]
 
−
:: At least IFI to RoboRio.
 
−
 
−
* [[Networking on the robot]]
 
−
:: For cRio and RoboRIO.
 
−
:: Also communicating with co-processors using UDP or TCP.
 
−
:: Plus mDNS.
 
−
 
−
* [[I/O from WPIlib for debugging to Drivers Station (DS) and the DS logs.]]
 
−
 
−
[[Custom USB devices on the Driver Station or digital I/O]]
 
−
:: Also SPI, I2C devices on the RoboRio.
 
−
 
−
[[CameraServer to the Driver Station]]
 
−
:: Live video from a Logitech C920
 
−
:: USB cameras on Linux,
 
−
:: Maybe Grip and
 
−
:: The LimeLight
 
−
 
−
[[Using the Kangaroo for video coprocessing]]
 
−
 
−
[[Navigation using the Navx]]
 
−
 
−
[[Navigation using the RoboRIO sensors]]
 
−
 
−
[[Other RoboRIO sensors]]
 
−
 
−
[[Talon SRX CAN features]]
 
−
 
−
[[PID loops in the RoboRio]]
 
−
 
−
[[PID loops in the Talons]]
 
−
 
−
[[Ebook Sources]] (but for what?)  If topic specific, should be with the topic.
 
−
 
−
[[Web Design]]
 
−
:: Adaptive Templates (progressive enhancement)
 
−
:: Responsive Templates
 
−
:: Active and Passive Web Designs
 
−
 
−
=== Student Requested ===
 
−
[[Imaging Tool - Gradle]]
 
−
 
−
[[Common Methods]]
 
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Revision as of 19:09, 8 August 2018

Getting Started

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.

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.

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)

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.

Project Documentation

TBD

Additional Topics

Index of all Topics Beginner Topics Intermediate Topics Advanced Topics