It is probably worth mentioning that unless your robotics application requires machine learning or computer vision, this hardware is probably overkill. ROS 2 nodes and the underlying communication are pretty lightweight and will work just fine on almost any embedded SBC that can run Ubuntu (for example, the latest Raspberry Pi).
Raspberry Pi SBCs are great and I’ve built many robots with them. They are a great starting point for prototyping simple robots and for people beginning into robotics, but they quickly fall short for many robotic applications. I encourage you to drop by the ROS 2 Hardware Acceleration Working Group and try understanding a bit about the work we’re doing there and the value behind accelerators. That includes the possibility to create custom compute architectures for building computational graphs. There’s plenty of projects and literature to read and benchmarks we’ve been producing which may help your understanding.
Also, you seem to be missing strongly that robots are deterministic machines. Meeting time deadlines in their computations (real-time) is the most important feature however other characteristics are also of relevance while designing robotic computations including the time between the start and the completion of a task (latency), the total amount of work done in a given time (bandwidth or throughput) or that a task happens in exactly the same timeframe, each time (determinism). CPUs are widely used in robotics due to their availability however they hardly provide real-time and safety guarantees while delivering high throughput. The de facto strategy in industry  to meet timing deadlines is a laborious, empirical, and case-by-case tuning of the system. This “*CPU whack-a-mole” approach in robotics is unsustainable and hard to scale due to the lack of a hardware-supported timing-safe event driven programming interface in CPUs. Hardware acceleration (with either FPGAs, GPUs or other accelerators) presents an answer to this problem. One that allows the robotics architect to create custom computing architectures for robots that comply with real-time and bandwidth requirements, while lowering power consumption.
Sure, you probably don’t want to use this type of hardware to “Learn Robotics” , but there’re plenty of use cases in autonomous mobility (AMRs, self-driving X, construction, mining, etc), industrial manipulation and healthcare robots (e.g. surgical robots) wherein you’d be surprised of how much this fits the needs.
Not true in my experience. Accelerators can be useful across robotic applications involving the whole robotics stack, going from sensing, to perception, mapping, localization, motion control, low-level control and all the way into actuation. They can help you plan faster grasps or avoid obstacles faster. They can even help you speed up your ROS 2 coordinate system transformations (benchmarks for
The reason why you probably think this way is because there are just not enough acceleration kernels publicly available for consumption for (other than ML and CV) robotic tasks, but there will be.
Liu, S., Zhu, Y., Yu, B., Gaudiot, J. L., & Gao, G. R. (2021). The Promise of Dataflow Architectures in the Design of Processing Systems for Autonomous Machines. arXiv preprint arXiv:2109.07047. ↩︎
CPUs are widely used in robotics due to their availability however they hardly provide real-time and safety guarantees while delivering high throughput . The de facto strategy in industry to meet timing deadlines is a laborious, empirical, and case-by-case tuning of the system. This “*CPU whack-a-mole” approach in robotics is unsustainable and hard to scale due to the lack of a hardware-supported timing-safe event driven programming interface in CPUs. Hardware acceleration (with either FPGAs, GPUs or other accelerators) presents an answer to this problem. One that allows the robotics architect to create custom computing architectures for robots that comply with real-time and bandwidth requirements, while lowering power consumption.
I’m not super in-the-loop regarding the hardware working group, but might I ask how you plan to achieve real-time guarantees in this architecture? FPGA’s are great for real-time determinism, but GPU’s are typically worse for determinisim than CPUs, as they lack integration into an RTOS and you’re left to NVIDIA’s default scheduler.
Also, are you running any RTOS on the CPU? Last I checked, the Jetson platform didn’t support any RTOS, only the NVIDIA automotive version of Orin supports a QNX-based OS.
I agree and share your concerns on GPUs. Similar to CPUs, they have memory-centric Von Neumann based architectures which makes determinism and real-time much more challenging than in other compute substrates. FPGAs and MCUs generally respond much better to this, and are comparably a much easier solution to use when aiming for (hard) real-time. The
Robotic Processing Unit is mindful of this and packs together lots of compute including 16x
GPU and an
FPGA, mixing the technologies from AMD and NVIDIA. The following image illustrates this at a high level:
Besides these big building blocks for computations, each one of these two groups packs additional compute units that are meant for real-time specifically. In the case of AMD’s Kria KR260, besides the FPGA (and the possibilities there with soft-cores), you have 2-Core 32-bit Arm® Cortex-R5F real-time processor (CPU Max Freq 600MHz) wherein you can run stuff baremetal or with RTOSs (e.g. FreeRTOS or NuttX are good choices). Similarly, the Jetson AGX Orin features a Jetson Sensor Processing Engine (
SPE), which is a Arm® Cortex-R5
MCU that can also run RTOSs like FreeRTOS. Overall, you’ve got plenty of choices which are hard real-time capable in the Robotic Processing Unit provided you architect things appropriately. The challenge with these SoCs (and groups of them interconnected) is precisely there, in the architecture, and that’s what we’re tackling in the ROS 2 Hardware Acceleration Working Group and why REP-2008 is so relevant (simplifying support for various accelerators in a single, consistent, ROS-centric flow).
In case you wonder about the interconnection between groups in the Robotic Processing Unit, it’s interconnected in a common Ethernet databus which allows combining the traditional control-driven approach used in robotics with a data-driven. It also aligns great with DDS and the base assumptions of most DDS vendors. We’ve done lots of testing mainly with
Ethernet, determining Ethernet as the best choice to meet time deadlines.
PCIe is promising and great for throughput but it behaves really weird while trying to real-time capabilities.
AMD’s Kria KR260 provides support for the open source Xen hypervisor and a portfolio of RTOSs to choose for the various CPUs. I have tested this extensively and though complex to integrate, can recommend it. It provides really good results. In the case of the Jetson AGX Orin, you have RedHawk Linux open source RTOS support, but you’re right in the sense that more general RTOSs like QNX seem to be available only for the driving (premium) solutions.
This shouldn’t surprise you much though. NVIDIA’s approach to open source has always been quite controversial and called to undermine open source by some. Quoting Linus Torvalds (2012):
I’m also happy to very publicly point out that Nvidia has been one of the worst trouble spots we’ve had with hardware manufacturers, and that is really sad because then Nvidia tries to sell chips - a lot of chips - into the Android Market. Nvidia has been the single worst company we’ve ever dealt with.
Even today in their ROS packages, you’ll find plenty of static libraries in binary format, which you can’t adapt to your needs. NVIDIA continues (in my opinion) playing funny with licensing, forking ROS Apache 2.0 (or similar, commercially friendly) code and re-licensing to their needs. This is my major criticism to them these days. I complained about this in the past which triggered a license change, however the trend continues.
As is, NVIDIA is hard to work with still. It took them years to acknowledge their GEMs approach wasn’t worth much without ROS. Fortunately they did and their discourse is now all about ROS !
See https://xilinx.github.io/KRS/sphinx/build/html/docs/features/realtime_ros2.html?highlight=xen for more details on how to achieve proper real-time with AMD’s Kria solutions. ↩︎
I like the Idea, but I really wonder, and that extends also to the list of ROS Robotics Companies, is, how are you to deploy ROS2 in a product, either RPU or any other board for that purpose (especially when not x86 based). Installing ubuntu on some development board does not cut it – to me at least. There is no way around a proper embedded linux, hence buildroot or openembedded, which enables you to:
- Use an optimized, possibly PREEMPT_RT kernel
- Create a SBOM and manage licensing somewhat decent
- Create Updates that are atomic
- Are not relying on other companies supporting your hardware with prebuild binaries / packages.
- Remove stuff that is not needed
- Optimize on the platform used
- Downsize of cost optimization
LG no longer updates meta-ros, and I really wonder why it seems nobody really cares…
I agree @DasRoteSkelett, it’s hard to avoid OpenEmbedded/Yocto (or buildroot, though I’m personally more in favour of OE/Yocto) for production.
Though there’re some building products on top of Ubuntu, in my experience, when creating a product, Yocto is typically the path forward which allows you for those customizations you mention above, and many more including additional security or leveraging a hypervisor. Within this last bit, you can actually create various VMs, each with its own rootfs. You can still leverage the Ubuntu rootfs in one such VM, but building such partitions requires you to step aside from the Ubuntu experience.
We wrote about this not long ago at ROS 2 Humble with Yocto and PetaLinux.
I share the feeling , but our group cares (the same group behind ROBOTCORE® and the RPU) and is the one behind the effort bringing Yocto support for Humble (see Humble release thread, see
Humble support in Yocto (Honister)). By the way, ROBOTCORE® (product, see tech specs) offers Yocto support and Acceleration Robotics offers consulting services around Yocto as well.
Community contributions-wise, I actually updated the recipes a few weeks ago over the summer (see open PR).
I also volunteered in the past to take over maintenance of
meta-ros but never heard back from anyone. Let me reach out again to @tfoote and @Katherine_Scott to see if we address this.
You can add me to the OE/Yocto camp. Software has to be upgraded, but the common approach is to release to one specific OS (usually not even an LTS version), and get locked in to that one without any security updates. At least with Yocto you can lock in a stable version and apply updates and security patches on top, whereas rolling your own backports or the cascading dependency hell caused by updates to other linux OS that doesn’t get updated in the specific software package is a losing battle. A container can help with this, but now you have to effectively load two (or more) Operating Systems onto the same (and constrained) hardware. The issue is with the early adopters like hobbyists or academics, they want something easy to setup or has a low barrier to entry. Yocto isn’t that (it is getting better with every release), and without say publicly available and maintained images (with say ROS2) it probably won’t appeal to the former user base as they can’t get up and running easily.
Have you considered using GNU Guix as an alternative to the Yocto Project?
I would like to see Android become one of the supported embedded / robotics base platforms.
Many people disregard Android as bloated due to the usage of Java / Kotlin to implement the higher-level APIs. But it is actually possible to build Android Core without even enabling the Java runtime (ART).
At the same time, Android has a lot of features that are important for embedded / robotics use cases. Just a few examples:
- Huge development ecosystem: a large Google development team, every SoC vendor, and every phone and tablet device maker has Android development teams with system-level programming expertise. You can’t (and shouldn’t ) get a decent SoC that has no Android support from the vendor.
- Security: Android has a very detailed set of SELinux policies, secure boot, and secure transactional updates, and its whole security architecture is constantly being refined due to being a high-value target for attackers. There are also extra hardened versions of Android, like GrapheneOS.
- Stable kernel API: This is an important project from Google that makes the lives of the hardware vendors easier while allowing them to upgrade to newer base kernels that bring in new features and more safety.
- Hardware Abstraction Layer (HAL): Android provides a very nice, IPC-based HAL that can split the responsibilities between the SoC and other component vendors and the OEMs building Android systems. The same would be very useful in robotics as well: ROS sensor- and actuator nodes could be implemented against a well-defined HAL interface, that could be device-independent. Then the different hardware vendors would only have to implement that interface in their drivers. This is already done for cameras and other devices used in phones.
- Binder IPC: One of the great additions of Android was the introduction of the Binder IPC, which provides way more features compared to the usual POSIX IPC mechanisms. It should be possible to implement a fast RMW based on Binder (either directly, or as a local fast path for another network-enabled system like Zenoh).
- Android Automotive OS: Android is no longer only targeting handheld consumer devices. With the Android Automotive OS Google is already investing a lot into features that are required for robotics applications as well, like planning for long-term security.
Development Tools: I still remember when the Android source code was first released in 2008. With a single
makecommand we could build the whole userland of a completely functional smartphone. I have been involved with a lot of different proprietary and open-source embedded platforms at the time (including Maemo, OpenEmbedded, or OpenMoko). Android was way easier to work with. Later, as Android grew, things became more complex and I think that the Soong build system was not the right move, but now with the Bazel transition things are going in the right direction again. I think that Bazel would be a great alternative build system for ROS2 as well, and there is already a 3rd party project providing the necessary Bazel build rules for ROS2.
- Safety with Rust: Rust is slowly (or rather pretty quickly…) becoming the de-facto system-level programming language for safety-critical environments. The Android team is leading many of these efforts by doing the work to add Rust support to the kernel and to allow the development of services in Rust in Android itself.
- Profiling and Introspection: Performance is obviously an important concern in Android, and while we have access to eBPF and other low-level performance profiling facilities of Linux, Google also included Perfetto, a very nice system-level profiling framework. Due to its design, it is even feasible to keep it included in production builds, and simply disable it at runtime. It is capable of collecting traces of many system components all at once and analyzing them using the easy-to-use web-based UI.
Using Android in Headless Systems was initially proposed more than 10 years ago, and even Google tried to provide a solution for that with the short-lived Android Things side-project. I think Android Things ultimately failed because it was not open-sourced, so the community could not build upon the base provided by Google and extend it to new use cases.
I have been working with Android on various non-phone device projects (like set-top boxes) since the very beginning (got it running on a Sharp Zaurus even before it was open sourced. )
I think that now Android is in a much better shape to add a “robotics / IoT flavor” than before. It even already has a fully virtualized platform port called Cuttlefish, which is also used by the Automotive version.
I encourage everyone to take a look around the source.android.com website and check out the technical documentation on the different aspects of Android.
PS: Shameless plug: If you are considering Android as an option for your Robotics platform, I am available for consulting and would be happy to talk with you.
Just learning about this project. Interesting. Watched the talk. Dives certainly into some of the pain points. Will have a closer look and continue reading. My major concern though is availability/support for hardware.
Do you have any good experiences with it @peterpolidoro with production-grade hardware that you can share? If so, with which boards?
Yes, that is a great point and a valid concern. I think more work needs to be done before it is ready for production on embedded boards, but the purely functional deployment model and emphasis on reproducibility and solving the problem of dependency hell makes it a very promising option for both the embedded and non-embedded ROS ecosystem.
GNU Guix can cross-compile packages for a variety of supported targets:
It is true, though, that most of the focus does still get placed on x86_64 for desktops, laptops, servers, and HPC clusters, but there is no reason why it should not work just as well on every architecture.
GNU Guix can be used as a functional package manager on top of other GNU/Linux distributions, such as Ubuntu, either in addition to or instead of, other packaging options such as apt, pypi, go, crates, traditional ROS packages, etc.
Guix has a feature I love named guix shell, that is sort of like a combination of a generalized Python virtual environment (for any software language not just Python) and Docker. You can use it to quickly create a shell environment or a container that only has a package and its dependencies and nothing else or the packages and dependencies necessary to develop a package. It can be used like a ROS workspace or ROS Docker container, but only including the bare minimum packages and not, say, all of Ubuntu.
Guix can be used to create its own GNU/Linux distribution called GNU Guix System using a declarative operating system configuration rather than the imperative approach taken by say Ubuntu or a Dockerfile. It could be used instead of Ubuntu on desktops, servers, or clusters, or embedded boards instead of something like Yocto.
As far as I know, no ROS code has been packaged yet for Guix. It does have some disadvantages that may prevent it from ever getting adopted into the ROS ecosystem. For example, Guix packages will never work natively on Windows. Guix is developed by proponents of free open source software, although there are optional Guix channels that contain packages of non-free software.
You do make me want to learn more about Android, thank you. So are you saying you do not need Java/Kotlin for the embedded/robotics use cases? Or are you saying that while it is possible to build Android Core without it you would still use it for these cases?
So are you saying you do not need Java/Kotlin for the embedded/robotics use cases? Or are you saying that while it is possible to build Android Core without it you would still use it for these cases?
It depends on the use case. If you only want to use the low-level services of Android, like the HAL, the minimalistic Libc, or Binder, then you can get away without using the ART runtime at all.
If you want higher-level features, like using APK packages to package your ROS nodes (which could also be a good idea depending on the use case), then you will need the ART runtime and also some of the system services written in Java / Kotlin.
That said, I don’t think running Java code on robots is out of the question - I am pretty sure that Java code will in general execute faster than Python.
I guess you’re aware of the open hardware KR260 baseboard, Is that what you’ll be using?
No we do not, but that’s a nice carrier for the K26 SOM indeed! (note KR260 is an AMD’s product including the K26 SOM and their own carrier). We are using plain off-the-shelf KR260. That simplifies building your own RPU. Also, just FYI, the KR260 carrier board is also open hardware, design files are open at Kria KR260 Robotics Starter Kit and the BSP is robust enough to build on top of it.
I’d encourage folks interested to look at AMD’s design. It’s rather complete and has the PL routed to 2x Ethernet PHYs which allows you to do all sort of wicked things directly from the FPGA (including TSN).
The RiscV SOM (in RPI CM3 dimensions) Hosted in this baseboard with a Coral M2 Might work for more hobbyist-grade projects. It looks like ROS2 can run on RiscV I wonder if anyone will squeeze a P650 into the CM3 footprint.
It wouldn’t get you NPU of course although P920 might deliver that in time.
Of course it can. We worked with Microchip to enable ROS 2 Humble in an SoC that packaged together RISC-V cores and an FPGA. See ROS 2 Humble in Microchip PolarFire® SoC FPGA Icicle Kit with Yocto. The PolarFire SoC is also a pretty interesting compute baseline but we ended up picking the KR260. It’s a more robust board for robotics, with tons of I/O and possibilities.
Interesting article/ work! I’ll have a proper read.
I’m new to ROS in general, but starting to see the limitations of Ubuntu. I’m also a big open hardware fan so this thread has been a useful prompt for me to start looking at RiscV stuff.
I’ll try not to hijack your thread further. I am interested to look at what the most capable open hardware ‘RPU’ would be. It looks like P920 might be a bit of a game changer. Do you have a sense of when it will be available?
I have set up a BoF session at the ROSCon2022 to discuss #meta-ros, see Meta-ros BoF at ROSCon2022
Everyone is very welcome to join.
Just echoing ROS 2 TSC Meeting Minutes: 2022-9-15 - #2 by vmayoral, but of special relevance for the case of both the
Robotic Processing Unit and
ROBOTCORE (since they pack various accelerators):
I’m happy to report that following ROS 2 TSC feedback, REP-2008 has been significantly rewritten to capture the input provided. For those not familiar with it, REP-2008 proposes a ROS 2 Hardware Acceleration Architecture and Conventions which allow extending ROS 2 workspaces to support hardware acceleration capabilities, across various accelerators, and while abstracting away the complexity and maintaining a ROS-centric development flow. Main changes in REP-2008 include:
- removed categories and capabilities
- removed completely benchmarking, pushed into REP-2014, now on its own REP PR, as suggested.
- significant rewriting of the intro and motivation as suggested. Tried capturing things at a higher level.
- expanded on the proposed open architecture, on its pillars and further explained its value. Also rewrote the specification section, to make sure its comprehensive and quick to understand.
- re-organized kernel levels in the document, they’re introduced earlier (and hopefully with better context)
- removed all mentions to CI
You can read the latest version after the changes here with a rich text format. Input’s more than welcome. What this effectively mean for the projects discussed in here is that you can build acceleration kernels for the various accelerators packed while maintaining a ROS 2-centric development flow and as easy/simple as:
# build accelerators of package_1 for the GPU colcon build --mixin robotcore_gpu --packages-select package_1 # build accelerators of package_1 for the FPGA colcon build --mixin robotcore_fpga --packages-select package_1