SOLID principles: a take for roboticists
- Tommaso Pardi
- Jan 30
- 2 min read
Are SOLID principles enough for developing robotics systems? Maybe not, but it's not all lost.

Solid principles are a useful set of rules to create an architecture that's flexible, future-proof, and solid (pun intended). It promotes decoupling and interfaces that are essential for a long-lasting codebase.
Usually, we comply with these tenets by adding abstraction to our code. These powerful structures allow a real separation of concerns between entities (classes, functions or others).
The concept of abstraction goes hand in hand with another important aspect of working with robotics. We want to build a hardware abstraction layer, which masks hardware using interfaces and makes the system hardware agnostic.
So far so good, everything is rowing in the same direction.
The main issue with this approach is that abstracting is not cheap. Regardless of the added complexities in the maintainability and readability of our stack, the bigger problem is performance.
Most casting must be resolved at runtime, which is expensive. For systems with low latency that must run in the thousands of khz, delays may have dreadful consequences, e.g. motors stopping, async trajectory between joints etc.
How can we mitigate these issues while keeping solid principles in our designs?
Well, it depends. Every system has its peculiarities(beauty and crux of robotics :) ) and there is no one-fit-all solution.
However, there are a few things that are helpful to consider.
Move to templating when possible; although it has limits, they are resolved at compilation time, preserving performance.
limit abstraction closer to the hardware; instead of pure abstractions, using supervisors that generate different types helps reduce abstraction.
evaluate your application; is this really a problem for you? Making assumptions sometimes is detrimental and measuring up your software might ahead invaluable info
SOLID principles are powerful, but we need to utilise them for our purposes instead of following them blindly.
These are only a few options to tackle the problem, and I am sure other methods exist, and I'll keep looking!





Comments