ROS2 (Robot Operating System)
The Robot Operating System (ROS) is a set of powerful open-source software libraries and tools that help developers build robotic applications. It provides device drivers, state-of-the-art algorithms, distributed communication, and developer tools that simplify robotics software development.
Why ROS2 on Vicharak SBCs?
ROS2 applications often require reliable compute performance, stable Linux environments, and predictable dependency handling all of which are core strengths of Vicharak boards.
Vicharak SBCs are designed to be:
Powerful enough for robotics workloads suitable for real-time ROS2 nodes
Optimized for Linux development
Hardware-friendly ideal for robotics integrations
Efficient and portable
Installation Guide
1. Set Locale
Check for UTF-8 support:
locale
Install locale packages:
sudo apt update && sudo apt install locales
Generate and configure locale:
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
Verify the settings:
locale
2. Setup Sources
You will need to add the ROS 2 apt repository to your system.
sudo apt install software-properties-common
sudo add-apt-repository universe
The ros-apt-source packages provide keys and apt source configuration for the various ROS repositories.
Installing the ros2-apt-source package will configure ROS 2 repositories for your system. Updates to repository configuration will occur automatically when new versions of this package are released to the ROS repositories.
Install curl:
sudo apt update && sudo apt install curl -y
Download and install ROS 2 apt source:
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F "tag_name" | awk -F\" '{print $4}')
curl -L -o /tmp/ros2-apt-source.deb "https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo ${UBUNTU_CODENAME:-${VERSION_CODENAME}})_all.deb"
sudo dpkg -i /tmp/ros2-apt-source.deb
3. Install ROS 2 Packages
Update your apt repository caches after setting up the repositories.
sudo apt update
ROS 2 packages are built on frequently updated Ubuntu systems. It is always recommended that you ensure your system is up to date before installing new packages.
sudo apt upgrade
Warning
Due to early updates in Ubuntu 22.04 it is important that systemd and udev-related packages are updated before installing ROS 2. The installation of ROS 2’s dependencies on a freshly installed system without upgrading can trigger the removal of critical system packages.
Please refer to ros2/ros2#1272 and Launchpad #1974196 for more information.
Installation Variants
Choose your installation variant based on your needs:
Tip
Check your Ubuntu version by running the command : cat /etc/os-release , to make your choice
Note
You have to install only one package given below, ROS-Core already comes with ROS-Base + other packages
4. Environment Setup
Sourcing the Setup Script
Note
You have to replace <distro-name> in below commands with your ROS distro version, for example for humble : source /opt/ros/humble/setup.bash , for Jazzy : source /opt/ros/jazzy/setup.bash
Set up your environment by sourcing the following file.
source /opt/ros/<distro-name>/setup.bash
Note
Replace .bash with your shell if you’re not using bash. Possible values are: setup.bash, setup.sh, setup.zsh.
Getting Started
Talker-Listener
If you installed ros-humble-desktop above you can try some examples.
Note
Replace the <distro-name> with your actual distro name. For example, for humble : sudo apt install ros-humble-demo-nodes-cpp
Install the demo-nodes packages
sudo apt install ros-<distro-name>-demo-nodes-cpp
sudo apt install ros-<distro-name>-demo-nodes-py
In one terminal, source the setup file and then run a C++ talker:
source /opt/ros/<distro-name>/setup.bash
ros2 run demo_nodes_cpp talker
In another terminal source the setup file and then run a Python listener:
source /opt/ros/<distro-name>/setup.bash
ros2 run demo_nodes_py listener
You should see the talker saying that it’s Publishing messages and the listener saying I heard those messages. This verifies both the C++ and Python APIs are working properly. Hooray you ran your first ros program! Now you can experiment and build your own projects.
Uninstall
If you need to uninstall ROS 2 or switch to a source-based install once you have already installed from binaries, run the following command:
sudo apt remove '~nros-<distro-name>-*' && sudo apt autoremove
You may also want to remove the repository:
sudo apt remove ros2-apt-source
Update package lists:
sudo apt update
Remove unused packages:
sudo apt autoremove
Upgrade remaining packages (consider upgrading for packages previously shadowed):
sudo apt upgrade