Instructions to set up ROS 2 for the first time
- This document is made for ros2 humble
- Ensure that system has internet connection.
- Make a laptop Hotspot name
swiftProand set password toswift123. - On the raspberry Pi connect it to screen login using the credentials that we set during setup.
- Ensure it is connected to hotspot and get the wlan0: inet address eg.
192.168.0.15using the commandip a. - Do SSH
ssh swiftPro@IP-ADDRESSand enter passwordswift123in another system which is connected to the swiftPro hotspot. - Run the below commnads.
Set locale
locale # check for UTF-8
sudo apt update && sudo apt install locales
sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settingsSetup Sources
sudo apt install software-properties-common
sudo add-apt-repository universeNow add the ROS 2 GPG key with apt.
sudo apt update && sudo apt install curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpgThen add the repository to your sources list.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/nullInstall ROS 2 packages
sudo apt update && sudo apt upgradesudo apt install ros-humble-ros-basesudo apt install ros-dev-toolsEnvironment setup
nano ~/.bashrc- Go to end of the file and paste the below path.
source /opt/ros/humble/setup.bash- And you are set to go.
