Skip to content

dev-tips

Solid Software Design Principles for Robotics Developers

My journey as a robotics developer began during my Physics studies. There was a significant shift from initially writing complex and chaotic code to my current effective use of various software design patterns and practices. This change has been crucial for building scalable and reliable software for autonomous machines. Like many robotics enthusiasts, my journey didn't start with a Computer Science degree; I learned programming through hands-on experience in the field.

In this post, I aim to share the key design principles that guide me every day. These principles have enabled me to independently create advanced robotics software, making the entire development process more manageable and efficient.

Plotting live data with Plotjuggler

Containerization is crucial for a reliable CI/CD workflow, but it can be challenging when you need live data visualization, especially for things like tuning motion control.

The good news? There's a simple solution. Just send your data to Plotjuggler using a UDP socket. I've included a code example below to show you how it's done. It's straightforward yet still packs in all the features you need for real-time signal visualisation.

Need to stream data quickly? Just use the UDP_Client from the example. With just a few lines of code, you're all set.

Note

This approach of using udp packets is great when you have a single container application and no messaging layer setup. If messaging middleware is being used, like mqtt for example, it is better to use mqtt messages in order to avoid functionality duplication. Plotjuggler is capable of handling mqtt and ROS messages.

Plotjuggler