zGiven that most of you will access ROS through the terminal (the -X next to ssh indicates that you can try to run GUI tools, but the speed is excessively slow), here are some terminal commands and tools that will make working in the terminal a lot easier.
tmux
Tmux is a terminal multiplexer, which means that you can run multiple terminal shells in one window. Type tmux into the terminal, and it should take you a nearly identical terminal window.
Commands are
Ctrl-b + %– Split the terminal vertically into two panesCtrl-b + "– Split the terminal horizontally into two panesCtrl-b (with continued press) + arrow_key– Resize the paneCtrl-b + arrow_key– Change pane selectionCtrl-b + x– terminal the current selected paneCtrl-b + [– Read mode (ESC and move cursor to escape)
vim (or nano)
vimtutor for practice (which will take about 10 minutes), or google for basic vim commands. You only really use ~10 commands, so I think it’s worth learning vim.vimtutor multiple times.Ctrl-W + Arrow_keys and terminate each pane using Esc and typing :wq (for editor) and :q (file explorer).To redirect the terminal output to a file (so you can read the error output)
some_command >file.log 2>&1 Run a command in the background:
some_command &
Move out of current folder
cd ..
How to run a command every terminal launch
Modify ~/.bashrc (e.g. vim ~/.bashrc) and put commands at the bottom.
~/.bashrc is essentially a shell (bash) command that runs when you first open the terminal, which means that you can put setup commands in ~/.bashrc so that you would not have to type them over and over again.
In ~/.bashrc, you can put ~/catkin_ws/devel/setup.bash (which is within ROS workspace) as one of the setup files to execute at launch. Whatsetup.bash does is that it sets up the path variables for ROS, allowing commands like roscd to find where the directory with packages is.
For those who are not so familiar with the terminal language, a “shell” is the terminal – a way for the user to interact with the operating system (Linux, in this case).
ROS commands
roscd <package_name> <folder_name>
rosed <pacakge_name> <file_name> – Opens file for editing
Commands like roscd (ros + cd) and rosed (ros + ed), they are essentially shortcuts for cd and ed to edit ROS package files quickly.