Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Software Getting Started

Carl Hofmeister edited this page Dec 2, 2017 · 2 revisions

Here are some things to know about if you're new to programming. There are quite a few things you will need to learn, but if work on one thing at a time, it should be fairly managable.

I would recommend learning things in the following order:

  1. A programming language (Python, C++, or JavaScript)
  2. Git & Github
  3. Rover frameworks (Roveberrypy, VESC message protocol, etc)
  4. Unix command line (recomended, but not manditory)

For programming languages, we primarily use Python and C/C++ as well as JavaScript for the web user interface.

You should be able to use any operating system, though our rover runs Linux so it may be easier to get things running on Linux platforms.

If you want to do stuff in Python, here are some tutorials you can try out:

https://docs.python.org/3.5/tutorial/index.html

https://www.youtube.com/watch?v=N4mEzFDjqtA

You don't have to feel fluent in python to start programming on the rover, the best way to learn any programming language is to start on a project and learn as you go. You will need to be familliar with some termanology though.

Our embeded systems are mostly arduino based, which is basically just C++. Here are some links for Arduino/C++:

https://www.arduino.cc/en/Guide/HomePage

Development environments and text editors

As far as development environments go, you can use whatever works best for you. Two main tool sets exist: IDEs (Integrated Development Environments) and command line + text editor. IDEs are nice in that they make it easy to build and run your software, and are just one program that does everything. Using a text editor and command line is also a good choice though, as it gives you a better insight to how your program is running and interacts with your operating system. Because there are no buttons and menus to navigate through, you aren't distracted with things you haven't learned yet, and text/command line intefaces usually allow for more options and are typically more powerfull. Using a text editor + CLI allows you to use the same development environment for every programming language, essays, reports, web pages, to do lists, secret muffin recipies, etc. I personally found immersing myself in the command line to be enjoyable when learning to program, and you learn a lot about how your computer works, but it can be slow, unintuitive, frustrating etc. My sugestion is to try the CLI, and if you hate it, use an IDE as they offer many usefull features.

Do note however, that the rover will not have your favorite IDE and is command line only, so if you need to test your code directly on the rover you will need to be familiar with the command line.

Even if you go the IDE route, you may want to use a more powerfull text editor. Don't use Notepad, there are much better options:

  • Notepad++. Many people use Notpad++, as it is very straitforward to use, and has all the features I would consider a must have for programming efficiently (Auto-completion, syntax highlighting and folding, some plugins)
  • Sublime Text 2. The full version isn't free, but it is nagware, so you can still use it without paying $80. Has lots of hotkeys for quickly editing blocks of text, multiple cursors, multi pane editing, macros, and looks pretty.
  • Visual Studio Code. A promising code editor created by Microsoft. It is free and open source. A great alternative to sublime.
  • Atom. Looks pretty like Sublime Text, but is totally free. Has a built in package manager, multi pane editing, and is highly themable with css/java script. Powered by the Electron framework.
  • Neovim. Next generation of the Vim/Vi text editor. You should use Vim. It's pretty great.
  • Emacs. It's also pretty great. You can do everything in emacs. The hotkeys will kill your hands though, so you should use vim :trollface:. Or use Evil

The last two may be fun to learn as a side project, but you will likely find yourself more productive to start with the first few. IDE's such as Eclipse, Codeblocks, Visual Studio are also fine, Just make sure you don't commit hidden project files to git.

Unix CLI

While this isn't a hard requirement, I recomend that you become familiar with the command line interface(CLI). While arguably a relic from the 70's command line interfaces are still widely used in everything related to software development. CLIs can be used in low resource embeded computers, and for controlling remote servers any where in the world. I already preached about CLIs in the previous section, so just take my word for it being a usefull skill to have. If you're on Mac, the Terminal program is a native Unix CLI interface. Linux users should be at least familiar with how to get to the command line in their distribution. Windows is not a Unix based operating system, but there are quite a few work arounds. The build in command prompt is simmilar, but not the same. If you have Windows 10, probably the best solution to use is Bash on Windows, or the Windows Subsystem for Linux. Here is how to get started.

Another option that has been around for a while is Cygwin. Keep the installer around, because that is how you install more packages.

If none of those solutions work or you just don't like them, you can also run linux in a virtual machine. This eats up a lot of resources, and will usually run slowy, but it provides a full linux environment that is separate from your host computer. Virtual box is a popular virtual machine.

I would like to write a tutorial on the command line, but it will take some time to plan out and write. For now, here are some resources:

http://ryanstutorials.net/linuxtutorial/commandline.php

https://web.archive.org/web/20130926213426/http://nixsrv.com/llthw

http://www.tutorialspoint.com/unix/

Version control

You will also need to know how to use Git. Here is a page on getting started with git. Once you are comfortable with using git, go here to learn out git workflow

Rover Frameworks

The Software wiki page has links to all the documentation for each software project we are working on.