Skip to content

Instantly share code, notes, and snippets.

@pvandervelde
Last active September 5, 2022 11:07
Show Gist options
  • Save pvandervelde/63d073a1da075141613a19845d1157b9 to your computer and use it in GitHub Desktop.
Save pvandervelde/63d073a1da075141613a19845d1157b9 to your computer and use it in GitHub Desktop.

Create a ROS Humble VM with Ubuntu 22.04

Create a VM with the Ubuntu 22.04 installer. Make sure to connect the VM to the LAN, so that any physical robots can connect to it.

Install XRDP

sudo apt install xrdp

Ensure that xrdp is enabled and running after a reboot

 sudo systemctl enable --now xrdp

If you are going to be connecting to the VM from a windows machine open the RDP port in the firewall

sudo ufw allow from 192.168.0.0/16 to any port 3389 proto tcp

Allow remote desktop users to handle package management. This is to prevent many, many, many authentication required dialogs from appearing. Create a file called /etc/polkit-1/localauthority/50-local.d/45-allow-package-management.pkla with the following content

[Allow Package Management all Users]
Identity=unix-user:*
Action=org.debian.apt.*;io.snapcraft.*;org.freedesktop.packagekit.*;com.ubuntu.update-notifier.*
ResultAny=no
ResultInactive=no
ResultActive=yes

Install zsh

NOTE: Picked zsh because it has better highlighting and completion, but also catkin generates zsh scripts.

Install zsh:

sudo apt-get install zsh

Make zsh default

chsh -s /bin/zsh

Install Powerline fonts

sudo apt-get install fonts-powerline

Install git

sudo apt install git

Install oh-my-zsh

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Install autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions

Install highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Update the plugins line in the .zshrc file

plugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Install VS Code

Install the MS package repository

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg

Configure apt https transport

sudo apt install apt-transport-https
sudo apt update

Install VS Code

sudo apt install code

Additional python packages

sudo apt install python3-pip

Install argument completion so that we can use it with the ROS2 command line

pip3 install argcomplete

Install ROS Humble

Install the ROS packages

Install at least the following packages:

  • ros-humble-desktop
  • ros-humble-simulation
  • ros-humble-navigation2
  • ros-humble-octomap
  • ros-humble-controller-manager
  • ros-humble-ros-environment
  • ros-humble-tf2
  • ros-humble-xacro
  • python3-rosinstall
  • python3-wstool
  • python3-rosdep

Install the build tools

sudo apt install python3-colcon-common-extensions

Source the colcon autocomplete script (in /usr/share/colcon_argcomplete/hook/colcon-argcomplete.zsh) in your .zshrc file

Install Ignition (Gazebo)

Install some of the tools

sudo apt-get update
sudo apt-get install lsb-release wget gnupg

Then install Ignition (example given for installing the 'Fortress' version)

sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install ignition-fortress
@pvandervelde
Copy link
Author

We may also need to install the ign_ros2_control package so that Gazebo can interact with ROS2 controls: https://github.com/ros-controls/gz_ros2_control

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment