MicroZed Chronicles: Kria Robotics Stack
The Kria K26 SOM and the Kria KV260 Vision AI Starter Kit have received interest for developing image processing and AI applications. Recently, I came across the Kria Robotics Stack (KRS) on the Xilinx GitHub Page. KRS is a subset of the Robotic Operating System (ROS 2) which enables developers to leverage the acceleration provided by programmable logic. This is an interesting area for developers of robotic solutions because the acceleration can provide a significant boost to performance without a significant increase in power and costs.
For those unfamiliar with ROS2, the first thing to explain is that, although it is called the Robotic Operating System, it’s not an operating system. It’s actually a framework of libraries and utilities that enable the creation of scalable robotic solutions that alleviate the need to always start from scratch. There are three key elements at the core of ROS:
A framework to create distributed robotic applications that communicate between sub-elements of the design (e.g., sensors, motor drive etc.). These sub-elements are called nodes.
Tools that help develop the application (e.g., simulation, 3D visualization, graphing, and plotting).
Support for third-party plug ins to add functionality for applications.
It’s the third-party plug ins that enable KRS to augment ROS 2. These provide a series of extensions to the build system and meta build tools and enable support for acceleration. Xilinx defines its extensions as having three pillars:
Extension of the ROS 2 build system (ament) to support the creation of acceleration kernels.
Extension of the ROS2 meta build system (colcon) to integrate and manage the acceleration flows into the ROS 2 CLI.
Provision of a firmware layer to provide necessary support for compilation of the kernels.
As illustrated in the diagram below, the KRS components support acceleration of navigation, manipulation, perception, and actuation stacks. As you would expect, at the heart of the KRS is Vitis with its ability to accelerate applications from processing system to programmable logic.
I was keen to explore KRS a little since having previously worked with ROS 2 on a TurtleBot Burger application and also having a Kria Visions AI Starter Kit with several of the demo applications.
To get started with the Xilinx KRS demos, we need a system which contains the following:
1. Ubuntu Linux 20.04 Focal Fossa release
2. Vitis 2020.2.2
3. ROS 2 Foxy distribution
Installing Vits requires that we first install Vitis 2020.2 as well as the update to Vitis 2020.2.2. To ensure the system was correct, I created a virtual machine configured exactly for the exploration.
With the three elements installed, we can start looking at the examples provided by Xilinx as part of the KRS installation and basic tutorials. These tutorials walk you through a ROS 2 publisher using high-level synthesis in ROS 2 in addition to offloading and accelerating a ROS 2 publisher. The concepts of topics, publisher, nodes and subscriber are critical to understanding ROS 2.
If you are not familiar with these concepts, I suggest you first try walking through a simple ROS 2. I am planning on running through the basic Foxy ROS 2 tutorials found here.
This will refresh my memory before I start looking at the KRS and working on the project I have in mind, which will be ready early next year.