Skip to content

Arm Software Setup

Parm345 edited this page Oct 21, 2023 · 5 revisions

This wiki page should contain everything you need to start developing software for the arm and some background context on the tools we use.

Linux Setup

Dual Boot

Install Ubuntu alongside Windows or MacOS on your computer.

Virtual Machine

Run a virtual instance of Ubuntu on top of your main operating system.

Missing Sudo Permissions?

  • open the terminal and run whoami, this is your current user name and copy it because it is important
  • switch to root user with
su root # log in with the password you made for the VM
  • now add yourself to the sudors list with the following command
    • where <username> is the usename that came from whoami
echo "<username> ALL=(ALL) ALL" >> /etc/sudoers
  • exit out of root user using exit

Docker

Common Terminal Commands

cd /path # change the directory (folder) the terminal is in 
cd .. # go up one level
cd # change directory to home folder 
ls # list contents of folder 
echo "hello world" # think print("hello world")
chmod +x /path/to/file # give executable permission to a file 

GitHub Setup

Make a GitHub (this website) account if you have not. Then follow the steps in the Getting Started section of the README. If you're using the GitHub Desktop application, you can use file explorer to make the folder structure and use the application to clone the repository into the src folder instead of using the command line.

Your final folder structure before running catkin_make should look like:

rover_ws/
	src/
	    rsx-rover

Command Line

Refer to the completing a task section of the wiki on how to use git with the command line. The following is how to set up your computer for use with GitHub.

Generate SSH Key

ssh-keygen -t ed25519 -C "your_email@example.com"
  • keep the place the key will be placed to the default (just hit enter when it asks) and then setup a password
    • this password will be asked when you try to push or pull to the GitHub repo so make sure to remember it
  • the email should be the one connected to your GitHub email
  • run cat /path/to/key.pub to display your key so you can copy it and add it to your account in GitHub settings under "SSH and GPG keys" menu

For a more in depth guide.

Git Config

  • add your email and GitHub username to your GitHub configuration on your computer so that your account is connected to your commits
git config --global user.name "<GitHub username>" # for global in user setting
git config --global user.email email@example.com # email you made with your GitHub account

Git Summarized

A version control system that lets you "branch" off from the main version, add updates to your new "branch", and then merging that "branch" back into the main version. Git lets us have various developmental versions of the project and stable one. Additionally, Git makes it easy for multiple people to collaborate on a project with its built in features of pushing and pulling data from the cloud.

This explanation does not do justice to what git does and here are some resources that can go through git much better than I can:

ROS and Related Summarized

This section is to provide an overview of ROS and parts you will be interacting with frequently. The ROS wiki is the best resource to learn ROS from and I recommend reading through it if you have time. Software team has also made a slideshow going over the essentials of ROS which you might find less intimidating compared to the ROS wiki. It's easier to learn ROS by playing around with it rather then just reading about it. Try following the software team slides or official ROS tutorials once you're done reading this wiki page.

Packages and Workspaces

  • a package is basically a folder of stuff (usually programs)
    • the contents often are related to one another
    • e.g. the rsx-rover repository
  • a workspace is where packages are stored and compiled for a certain project
    • e.g. you could make a workspace for the rover and another for a personal project
    • to specify what workspace to use, run source path/to/project/devel/setup.bash
# Workspace structure 
workspace/
	src/ # packages go in here
	build/ # where the built project is stored
	devel/ # the development environment

ROS Nodes

  • a node is a executable that runs on ROS

Communication

  • ROS has 2 main methods to allow for nodes to communicate with one another: topics and services
  • Topics are more used and hence covered here, but if you don't think a topic is what you need read up on ROS services

ROS Topics

  • a topic is a place where any node can publish or read data from
  • a good analogy would be a radio frequencies, anyone can read from it and anyone can publish to it

Messages

  • a message is the data type that gets sent over a topic (or a service)
  • you might be familiar with some of the data types:
    • integers, floats, and strings
    • view the msg page on the wiki for a full list of the default data types
  • you can make custom message as well which can be useful it some situations

RViz and URDF's

  • a URDF is a model of a robot in a format that ROS can understand
    • the format is an XML file
    • here is the 2023 Arm URDF for an example
  • RViz is a visualization tool that comes with ROS that you can use to display URDF's, sensor data (e.g. camera feed), points in 3D space, and more