There are many, many great tutorials, references and cheatsheets on the internet that you will undoubtedly need to consult as you learn to use Linux. Below, are some of the most common useful tips and tricks that may help you be productive and efficient you learn Linux for the purposes of using ROS.
- Window Navigation: You will likely end working in a number of concurrent windows
- Alt+Tab will switch between windows
- Launching Terminals: Bringing up a new a ROS system often requires a few terminal windows
- Ctrl+Alt+t will open a new terminal window
- Shift+Cntl+t will open a new tab in the terminal window (having multiple terminals in a single window can be easier to navigate)
- Command Line
- Copy and Paste
- In many GUI programs the copy and paste shortcuts are the same as Windows: Ctrl-c to copy and Ctrl-v to paste.
- For the terminal window, the shortcuts are slightly different: Shift-Ctrl-c to copy and Shift-Ctrl-v to paste. You can also copy and paste through the menu: Edit->Copy or Edit->Paste
Using SSH with Git Server
There are two options for interacting with the Git remote server (clone, push, pull, etc.): HTTPS and SSH
Setting up an SSH connection between your computer and the GitLab server takes a few minutes to setup, but allows you to clone and push without entering your GitLab password.
Here are instructions on setting this connection up with GitLab. The instructions are verbose, so here is a condensed summary for our use case...
On your computer, generate local SSH keys
This should generate both private and public keys as files in the
Echo the public key to the terminal
- Copy the public key from the terminal - text starts with
ssh-rsaand ends with the email you provided.
- On the GitLab server
- Under your user account, go to
- Create a new key and past the text you copied from the terminal
- Under your user account, go to
Done - once you GitLab has your public key you should be able to clone, push and pull using the SSH protocol.
Asking for Help / Debugging
For assignments and tutorials, the best way to document problems is to use the comments section of the particular wiki page you are using. The authors, and anyone else "watching" the page are immediately notified.
If your problem includes computer issues (errors from comments, code snippets, etc.) it is a good idea to include the commands you issued (you can use the
history command in a terminal to see what commands you have issued) and any error reports. If you are attempting to paste terminal commands, code, etc. into the comment, use the Code Block Macro feature to avoid formatting problems with the text you are placing in the comment.
- In general, reproducible errors are much easier to address than intermittent ones. If you can provide the commands that lead to the error and then the error output, that can be really helpful in determining what is wrong.
- Copy and paste in the Gnome terminal
Finding your IP and MAC Addresses
An easy way to examine the status of the network on your computer is with the
ifconfig command. The example output below highlights some of the more useful parts of the output.
If there is no IP address listed in the output, then that adapter does not have an active connection.
Setup Hosts File
Example - local lab wifi network with reserved IP addressed for robots. Tired of remembering and typing IP addresses. Add lines to the
/etc/hosts file so that we specify the correspondence between IP addresses and hostnames (as listed in Robotics Computation Lab).
For example, I could add two specific turtlebots to my hosts file so that it looks like...
Notice to two new lines at the bottom.
Now instead of...
I could equivalently use...
Setting Time/Date on Raspberry Pi - without internet
Setup Local NTP Server
Eg., on a laptop connected to local wifi. Following directions http://captainbodgit.blogspot.com/2013/10/raspberrypi-keeping-time-without.html
Backup, then edit /etc/ntp.conf
Sync form Raspberry Pi
From Raspberry Pi
Where the IP adddress is the NTP server on the local network.