In this new series of fortnightly technical blogs, StreetDrone is going to lift the LiD(-AR) on one aspect of autonomous driving software development. Our “Hello World!” series is written by software engineer Efimia Panagiotaki, a tech-trotter with engineering experience ranging from the National Technical University of Athens to ETH Zurich to Williams Formula 1. Efimia is leading the development of StreetDrone’s autonomous driving software by leveraging Autoware, a ROS-based, open source self-driving stack. But who or what is ROS? Read on for more!
Let’s say you recently read the Rise of the Machines article on WIRED.
Even better, let’s say you were strongly hitched with Mr Robot S01 and gradually gave up disappointed – I know. We have all been there. Just go back and watch the Matrix. Again.
Regardless, if you are interested in starting a robotics project and you are familiar with a bit of programming and using a terminal, ROS might be the answer to all of your questions.
“I recently bought a StreetDrone Vehicle. It’s drive-by-wire, it has multiple cameras, a LiDAR, an Inertial Navigation System (INS) and a powerful computing unit. Now what??”
Any robotics problem like this needs a system, or a middleware, that will bridge the communication between the sensors, the actuators and the algorithms – Here is where ROS (Robots Operating System) steps in. To avoid any confusion, ROS provides a structured communications layer above the host operating systems. It doesn’t act like an OS itself but more like a middleware between the operating system and your application.
ROS is a set of software libraries, algorithms and tools that help the developer build robotic applications without having to reinvent the wheel every time. So… Why ROS?
1. Modular Design
The core design of ROS allows you to separate the functionality of a software application into independent, interchangeable modules.
Let’s take the case of the self driving car. Your vehicle is drive-by-wire, with dedicated actuators for the steering wheel and the pedals. To control these you need an interface running on the on-board PC and communicates with the vehicle’s CAN bus. Now start adding the sensors to this vehicle: cameras for detection and classification, LIDAR for localisation and mapping, ultrasonic sensors for collision avoidance. Each sensor and each process can be split into separate software modules that will all need to communicate with each other.
ROS breaks down this complexity and helps design, develop and debug robot software stacks by separating each module to a package or a node. The ROS nodes communicate with each other by sending and receiving messages, organized into specific categories called topics. The nodes publish messages on a topic or subscribe to a topic to receive the information they need.
2. Open Source Community
ROS is Open Source and has a large thriving community around it. Developers contributing to open source projects have a common drive to support and improve a solution, by sharing their work or new concepts and ideas to the project. There are ROS packages for pretty much everything. From detection and path planning to complete autonomous vehicles stacks, there is an open source package for everything.
3. ROS Tools
Rviz is a 3D visualization environment that allows you to combine your sensor’s output, robot models and the output from your algorithms into a combined view, facilitating development and debugging.Rosbag is a tool for logging and visualization of sensors data, facilitating recording and playing back of messages as well as tracking the timestamps and the recording of the messages.
4. GUI Development
Rqt is a Qt-based framework for GUI development for ROS, consisting of three metapackages: rqt, rqt_common_plugins (backend tools) and rqt_robot_plugins. Instead of building GUIs from scratch, RQT standarizes common procedures for GUI development.A few known tools built with RQT are rqt_plot for plotting, rqt_graph for system visualization and rqt_bag for rosbag replay and sensors output visualization.
Simulation is essential to most robotics applications before running for real – especially when it comes to urban autonomous vehicles. Gazebo is a simulator for rapidly testing algorithms, design robots, perform regression testing and train AI systems. It’s a robust physics engine used to accurately and efficiently simulate robots in complex indoor and outdoor environments. While Gazebo is shipped within ROS, there are many other simulators that offer an open source bridge to ROS, like Carla and LGSVL.
If you want to build your own robotics application, ROS is the tool for you. It’s easy to learn, language-agnostic, light and has a great community of developers supporting it.
To find out more or to ask us anything, get in touch with StreetDrone at firstname.lastname@example.org.