<![CDATA[Blog | Matic]]>https://maticrobots.com/blog/https://maticrobots.com/blog/favicon.pngBlog | Matichttps://maticrobots.com/blog/Ghost 5.72Tue, 13 Feb 2024 02:24:28 GMT60<![CDATA[Why Rust? It's the safe choice.]]>At Matic Robots, we're building an intelligent robot with advanced hardware and software features. One of the things that helps is writing our code in Rust. There are a lot of things that influence the choice of programming language and other tools, so we'd like to

]]>
https://maticrobots.com/blog/why-rust-its-the-safe-choice/65cac1169c28b84d5445f9c9Tue, 13 Feb 2024 01:12:30 GMTAt Matic Robots, we're building an intelligent robot with advanced hardware and software features. One of the things that helps is writing our code in Rust. There are a lot of things that influence the choice of programming language and other tools, so we'd like to share a few of the reasons that Rust works for us.

Circuit boards from the Matic robot.

A Better Robot

Let's start by discussing why using Rust leads directly to better products.

We're putting all of the robot's intelligence into the robot itself, rather than running in the cloud. This means we need to deliver a lot of functionality with our limited compute resources. With Rust we get good performance and reliable concurrency without having to pay the costs of garbage collection or interpreted bytecode.

Another reason Rust works well for us is that correctness and safety checks don't require a performance tradeoff. Traditional verification tools (e.g. sanitizers) slow down the running code, and that will change the behavior of a robot that has to make real-time decisions. Rust's memory and thread-safety protections have no runtime overhead, so every build is fully protected. This makes our robots more reliable.

Our robot contains a lot of hardware: motors, actuators, pumps, sensors, cameras, microphones, plus embedded CPUs, I/O, onboard storage, and AI accelerators. Our software needs to manage all of that complexity, and every one of those parts can misbehave in interesting ways. Rust's FFI capabilities and strong error-handling semantics make this difficult task a lot easier. And every year new hardware improvements come along-- using Rust improves our development speed, so we're able to adapt to new hardware rapidly.

Finally, we want to set a good example for security and privacy. Networked consumer devices have a terrible reputation, and it's far too common for unsafe code to be exposed on the network. Using Rust for critical tasks prevents many common security bugs, and encourages robust error handling. This helps us harden our software and protect private data.

Benefits for the Team

There's another side to Rust, too: it makes developers more effective. If we can get more done in less time, with fewer mistakes, that contributes to our ability to make a better robot.

We don't spend time chasing memory safety bugs or concurrency errors, because the compiler has guard rails that push back when code tries to do something dangerous. It's easy to make changes quickly, because the compiler will prevent entire categories of errors. In other languages, this "push back" can be delayed a long time (until static analysis runs, or runtime safety checks fire, or customers report bugs). With Rust we can catch most of these bugs almost instantly.

A computer vision engineer mentioned to me recently that they haven't seen a segfault in more than a year. It took a moment to realize how shocking that would have been to me in a previous role as a C++ developer. After a few years using Rust, we've mostly forgotten what it's like to deal with crashes due to bad pointers.

There are long-term benefits, too. Rust's type-focused style and firm boundaries improve the long-term manageability of code. Refactoring can be done fearlessly, and the compiler safety checks are robust enough that the refactoring is often done the moment the code compiles.

Code written in other languages often depends on subtle invariants that may not be easy to express. Memory and thread safety mechanisms can require extreme care to maintain correctness. In a large-scale project, productivity can suffer if new team members are afraid to touch the code for fear of breaking things. Rust can convey a lot of meaning in the type system, making it easier to understand invariants and maintain code over its life cycle.

Our robot has an internal map of the home it lives in. The map has many layers, including physical (furniture and other obstacles), semantic (carpet, wood floor, etc.), and many others. In the source code, the layer type is represented as a Rust enum. An engineer who was new to Rust added a new layer containing information about the type of room (Kitchen, Living Room, etc.) that required an update to many other modules. The Rust compiler assisted by pointing out every place in our code that needed updating, from serializers ("how do we send this data over the network to a mobile app") to debugging visualizers ("how do I draw this layer on an engineer's screen?"), making it easy for the engineer to complete the rest of the changes.

It's fun to learn new things, and Rust is a good teacher! When coding in Rust, the language encourages awareness of the details: errors and fallibility; shared data and mutability; algorithms and performance. While this can be viewed as an up-front cost due to the learning curve, it's also a form of continuing education. No matter which language we use in the future, those are valuable lessons that make us better at our jobs. Open source Rust projects also set a high bar for documentation, modularity, and test coverage; consumers of Rust code are constantly exposed to these best practices, and quality expectations are contagious.

3d Rendering of a house seen from Matic's point of view.
We have an internal "visualizer" application, used by engineers to monitor and interact with the robot. The visualizer had originally been built in Python. Last summer, an undergraduate intern rewrote the visualizer in Rust. This gave it a huge performance boost, but also had another interesting result: because the new code was easier to extend, engineers were able to add more detailed visualizations that allowed us to fix several elusive bugs. Also, I should mention this was the intern's first experience with Rust.

Ship It!

Did we take a risk by using Rust? Are we spending our "innovation tokens" recklessly? In our experience, Rust is the safe choice, and it's hard to imagine using anything else. We are able to build things in less time, with less risk, and have more fun doing it. Developers can be fearlessly productive, because there is a lower risk of bugs that cost months of developer time.

While our experience may be specific to building consumer robots, a lot of it could apply more generally to other types of software engineering. Many projects face similar challenges with security, performance, and maintainability. We think that in the near future a lot of engineering teams will discover that they can build better products in less time using Rust, and teams using older tools should consider whether their project could benefit from an upgrade.

]]>
<![CDATA[Matic comes out of stealth with $30M in funding to launch fully autonomous indoor robots]]>https://maticrobots.com/blog/matic-comes-out-of-stealth-with-30m-in-funding/654bb8ffcdae646a5133b375Thu, 02 Nov 2023 16:36:00 GMT
0:00
/1:06

Autonomous technology is here. Robotaxis are shuttling around thousands of people every day in San Francisco. You’d think that the so-called “smart robots” in our home would be able to navigate the terrain and handle cleaning without getting shoelaces stuck in their bristles, chewing wires, and bumping into everything.

Just as autonomous vehicles need GPS and Google Street View Maps to navigate, fully autonomous indoor robots require precise understanding of their location on high-fidelity, street view-like 3D maps of the constantly changing indoor world. Simultaneous Localization and Mapping technology (SLAM) and 3D perception enable robots to expertly navigate and build consistent maps indoors, but it’s yet to be implemented precisely and robustly. Instead, indoor robots rely on 2D, blueprint-like lined drawings—a far cry from street view fidelity.

This is why iRobot’s co-founder predicted it would take until 2030 for robots to navigate our homes, and 2035 before they’re affordable. Turns out, this prediction was incorrect, as we’ve solved 3D perception and precision SLAM for indoor spaces just using 5-RGB cameras with all data processing on the edge device. Today we’re unveiling details on Matic, the first fully autonomous home cleaning robot that proactively maps and scouts floors to quietly vacuum and mop without requiring a babysitter. In fact, Matic is also the world’s first fully autonomous indoor mobile robot.

Designed with the modern homeowner in mind, it not only looks completely different from every other product on the market, it also behaves in a new way. Matic auto-toggles between mopping and vacuuming based on visual understanding of surface types and the mess at hand. With a first-of-its-kind mopping system, it can detect a stain and continue to mop until it’s completely gone. Matic also understands gestures and voice, and prioritizes cleaning just the way the user wants – just point and say “Hey Matic, clean this” and it’s on the job.

Matic is the first AI-driven indoor robot that can expertly navigate any home to clean like a human. We mimic human perception and self-learning through cameras and Neural Networks (NNs) that power image recognition, decision making, and 3D mapping. Our robot relies on 5-RGB cameras and NNs with all the processing on the edge device. This keeps privacy at the forefront, because everything is processed directly on the device and nothing leaves the four walls of a home. While this was hard to do, it was non-negotiable.

0:00
/0:13

The founders of Stripe, Square, Nest, the former CEO of GitHub, and prominent AI experts and investors back Matic

To support the general availability of our product in early 2024, we’ve raised $29.6M in funding. This includes our most recent $24M Series A, led by Nat Freidman (GitHub), Daniel Gross (Cue, Pioneer, YC), and John and Patrick Collison (Stripe). Prior to this, we’d raised $5.6M in unannounced seed funding back in 2019 led by Nest co-founder Matt Rogers and with support from John & Patrick Collison, Adam D’Angelo, Jack Dorsey, Brian Pokorny, Adam Nash, Naval Ravikant, Avichal Garg, Joe Lonsdale (8VC), Nickhil Jakatdar, Ayo Omojola, and few others.

"Autonomous technology has transformed our roads over the course of the last decade, but its potential utility in our homes has been largely ignored," said John Collison, co-founder & CEO of Stripe. "By bringing together the best hardware engineers and ML scientists in the world, Matic is unlocking new utility for autonomous technology and breaking free from the existing mold of indoor cleaning products. Matic isn't just building a gadget, we're developing some of the most advanced 3D mapping and spatial technology on the market," said Nat Friedman, prominent AI expert, investor, and ex-CEO of GitHub credited for launching GitHub Co-Pilot.

We are fortunate to attract such incredible investors not only because of the company we’re building but also because of what we’ve done in the past. I met my co-founder, Mehul Nariyawala, at Like.com, which pioneered facial recognition in images using CV in 2005 and was acquired by Google in 2010 for its visual search capabilities. From there, we founded Flutter, which focused on hand-gesture detection via webcams. Our algorithms worked on a single core of CPUs (no GPU needed) and ran on the device – meaning no cloud, no latency, and no privacy concerns. Google verified that our algorithms were more accurate and efficient than their own, leading the company to acquire us in 2013. During our time at Google, together we shipped the first deep learning-based person and motion detection for Nest cams in 2016. We helped conceptualize, develop, and ship NestCam Outdoor, NestCam IQs, and Nest Hello Doorbell resulting in $250M+ of additional revenue.

Our Mission

We’re on a mission to solve everyday problems with robotics that save our collective time and energy from the drudgery of mundane, repetitive and boring tasks. As busy fathers and husbands who love building technology that solves real-world problems, Matic was the clear solution we knew we had to build. Given this is a ubiquitous problem that everyone deals with, our technology lends itself to the ideal solution.

We’re still at the beginning of the AI-led robotics explosion and future applications of this technology are endless. We’re excited for a future where smart robots can make our lives easier and better, and we believe Matic will be the foundational company at the center of this mission.

If you’d like to try out Matic in your own home, you can reserve it here. Join our mailing list to stay up-to-date with our progress and we'll keep you posted. If you’re inspired by what we’re building and would like to connect about anything else, we can be reached at hello@maticrobots.com.

Introductory price of Matic

$1,495 (savings of $300) and includes a free one-year Matic Membership (savings of $180) giving users access to unlimited refills on consumables (bags, brush rolls, mop rolls), free repairs/maintenance, and a warranty extension (from one to two years).

Cancelable at any time pre-shipment and 30-day return window post-shipment for full refund.

]]>