ros-2-setup
Here's how I setup ROS 2 Foxy on my machine (Ubuntu 20.04)
- Get GPG key
sudo apt update && sudo apt install curl gnupg2 lsb-release
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(source /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
- Update
sudo apt update && sudo apt upgrade
- Install
sudo apt install ros-foxy-desktop
- Setup environment
source /opt/ros/foxy/setup.bash
- add above line to end of
~/.bashrc
- Verify ROS is in environment
printenv | grep -i ROS
References: