Skip to content

Waterloo Steel:Workstation Setup

jaku-jaku edited this page Mar 2, 2023 · 2 revisions

Table of Contents

[Last generated: Thu 2 Mar 2023 15:56:45 EST]


> πŸ—£οΈ In this page, you may find useful step-by-step instructions to set-up your workstation:

1. Ubuntu

[@jack.xu@uwaterloo.ca]

1.1 Install Ubuntu

1.1.1 Bootable USB

search for bootable USB

1.2 Ubuntu Initial Setup

1.2.1 Basic Tools:

1.2.1.a) Net-tools:

$ sudo apt install net-tools
# now you can check ip:
$ ifconfig

1.2.1.b) Open-SSH

$ sudo apt update
$ sudo apt install openssh-server
# allow bypass firewall
$ sudo ufw allow ssh 
# check ssh status:
$ sudo systemctl status ssh
  • to connect to this server:

    $ ssh username@ip_address
    # search for local network ip in case
    $ ip a 

1.2.1.c) NoMachine:

  • NO Machine: https://downloads.nomachine.com

    • Please check your OS version via:

      $ arch
  • See detailed setup without monitor in [Waterloo-Steel/Platform-Setup.md]

1.2.2 Optional Advanced Tools:

1.2.2.a) Zenith

$ sudo apt install curl
$ curl -sL https://raw.githubusercontent.com/wimpysworld/deb-get/main/deb-get | sudo -E bash -s install deb-get
# then install:
$ deb-get install zenith
$ deb-get update
$ deb-get upgrade

1.2.x Note:

πŸ““ Now you may access Ubuntu remotely, and setup following locally on Ubuntu or remotely

1.3 Ubuntu Workspace Setup:

1.3.1 ZSH and oh-my-zsh

  • install zsh first

    $ sudo apt install zsh
    # change to default in zsh
    $ sudo chsh -s $(which zsh)
  • Oh-my-zsh (THE hipster dev tool + coke)

    $ sudo apt install curl
    $ sudo apt install git
    $ sudo apt install vim
    $ sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
    
    # to modify themes:
    $ sudo vim ~/.zshrc
    ## Recommended themes: `ys` and `jonathan`
    $ source ~/.zshrc

    ℹ️ https://github.com/ohmyzsh/ohmyzsh

    ℹ️ Themes: https://github.com/ohmyzsh/ohmyzsh/wiki/Themes

1.3.2 TMUX: virtual terminal within terminal

πŸ““ Do not use multiple ssh clients, as they will make the system a bit heavier.

πŸ”₯ Tmux can still run in the background, even if the computer is disconnected from the internet.

⚠️ Normal ssh sessions without tmux will terminate the program if your ssh client is disconnected

1.3.2 VIM:

  1. set github editor to vim:

    $ git config --global core.editor "vim"

    or have env variable in zshrc: export GIT_EDITOR=vim

  2. Why VIM? ---> personal preference

1.3.3 SSH Keys & Github

  1. generate key

    $ ssh-keygen -t ed25519 -C "your_email@example.com"
  2. copy the public key

    $ cat ~/.ssh/id_ed25519.pub
  3. paste to github SSH keys under personal account profile

1.3.4 VSCode Remote SSH:

🎫 I often use VSCode Remote SSH to modify codebase --Jack

  1. Open VSCode, and make sure [Remote-SSH] is installed in EXTENSIONS: MARKETPLACE on left tab

  2. [CMD + P] to open command pallette , and type command "> SSH" and select [Remote SSH: Connect to Host ...]

  3. Enter host username and ip:

    $ ssh username@ip_address
  4. Now you can open folder in local VSCode editor and modify the remote files

  5. :happy:

1.4 [:star:] UWARL ROS Catkin Workspace Setup

Install Catkin Workspace + Hardware Setup + ROS in one script

  1. 🚨 Pre-req:

    1. **Make sure SSH authenticated with Github, see instruction @ **

    2. ZSH as default Shell

  2. Clone configurations:

    $ cd ~ && git clone git@github.com:UW-Advanced-Robotics-Lab/uwarl-robot_configs.git
  3. Select Configuration Branch:

    $ cd ~/uwarl-robot_configs
    # check all available branches:
    $ git branch -a
    # EX: select `universal/ros1/data-analysis/session-feb-2023`:
    $ git checkout universal/ros1/data-analysis/session-feb-2023
  4. 🌢️ **Register your PC ** in common.sh:

    $ vim ~/uwarl-robot_configs/scripts/common.sh
    1. Define Package Dependency:

      # $USER = "oem":
      SUBMODULES_FOR_JX_OEM=(
          ## SUMMIT Side:
          "multimap_server_msgs"
          "system_monitor"
          "uwarl-multimap_server"
          "uwarl-robot_localization_utils"
          # "uwarl-robotnik_base_hw"  # not needed for simulation !  # [x86_64 only]
          "uwarl-robotnik_msgs"
          "uwarl-robotnik_sensors"
          # "uwarl-summit_xl_common"
          "uwarl-summit_xl_robot"
          "waterloo_steel"
          ## WAM Side:
          "uwarl-barrett_wam_hw"      # : Enabled for local dev.  # [x86_64, aarch64/arm64]
          "uwarl-barrett_wam_msgs"
          "uwarl-realsense_ros"       # [L515 Support]
      )
    2. Define New PC and Network Parameters:

      export ROS_JX_OEM_PC_IP=10.42.0.1
      export ROS_JX_OEM_PC_HOSTNAME=10.42.0.1
      export ROS_JX_OEM_PC_DISTRO=noetic
    3. In function source_ros() , register Out-of-network as below:

          elif [[ $USER = "oem" ]] && [[ $LOCAL_PC_IP = "$ROS_JX_OEM_PC_IP" ]]; then
              ic_wrn " - NON-Robot PC User [Jack's Parallel VM] detected!"
              ic_wrn " > We have detected a registered out-of-network PC, now forcing local host for ROS_MASTER_URI !"
              ros_core_sync "LOCAL-HOSTS"
              export ROS_IP=$ROS_JX_OEM_PC_IP
              export ROS_HOSTNAME=$ROS_JX_OEM_PC_HOSTNAME
              export ROS_MASTER_URI=http://localhost:11311/
              export ROS_DISTRO=$ROS_JX_OEM_PC_DISTRO
              export DISPLAY=$DISPLAY_DEFAULT
              export PYTHONPATH_ROS=/usr/bin/python3
              export PYTHONPATH=$PYTHONPATH_ROS
  5. ::hot_pepper: Register PC Submodules Mapping in auto-config_UWARL_catkin_ws.zsh

    • add attributes as below after line 80

      [Optional]:

      • You may uncomment install_misc_utilities # misc apt
        • to install some apt packages (tree, tmux, git, zsh, vim)
      • You may uncomment install_librealsense_if_not
        • to install driver for librealsense cameras
      • You may install PCAN by adding:
        • NETDEV: install_pcan_if_not NETDEV_SUPPORT
        • NON_NETDEV: install_pcan_if_not NETDEV_SUPPORT
      • You may install Dlink Dongle for wifi dongle provided in the lab:
        • install_dlink_dongle
      • You may add install_libbarrett_if_not for wam_node hardware dependency
        elif [[ $USER = "oem" ]] && [[ $LOCAL_PC_IP = "$ROS_JX_OEM_PC_IP" ]]; then
            ic " > Loading parallels workspace submodules:"
            # install_misc_utilities # misc apt 
            # install_librealsense_if_not # for Intel Sensors
            load_submodules "${SUBMODULES_FOR_JX_OEM[@]}"
  6. Install the repo and configure hardware with auto-script:

    $ cd ~ && ./uwarl-robot_configs/scripts/auto-config_UWARL_catkin_ws.zsh

    πŸ““ this script will install automatically based on the user name (e.g. uwarl-orin) to identify the PC space

    πŸ”₯ This will install ROS Noetic for you, if you have ubuntu 20.04 focal (like Jetson) , otherwise, you have to install manually OR add a script to it as well?

  7. Reboot is Required if it is the first time installing libbarrett !!

  8. Catkin Build:

    # source robot config env & ros
    $ source ~/.zshrc
    # build:
    $ build_ws # from anywhere, which will does the job for you :P (Jack is too lazy)
    # source:
    $ source_ws # lemme know if we should auto-source after build, :wink:
  9. Commit Config settings:

    $ cd_config
    $ git status
    $ git commit -a
    # push to remote:
    $ git push

1.x Tips

1.x.1 Commonly used command:

  1. $ uname -r: OS check
  2. $ cat /prov/version_signature: identify kernel
  3. $ arp -a : Scan Local Network Devices and IPs
  4. $ tree -L 1: list hierarchy of directory in depth=1

1.x.2 Manually backup a directory of files:

  1. EX: backup home directory [cite:how-to-backup]

    sudo rsync -a --info=progress2 --exclude="lost+found" --exclude=".cache" /home/ /mnt/usbdrive/

2. Mac

[TODO]

3. Windows

[TODO]


> Back To Top <

Clone this wiki locally