Challenges in High Performance Robotics Systems

Rishabh Garg, Tesla Optimus12:43 · Aug 2025 · 8,127 views
Thumbnail for Challenges in High Performance Robotics Systems Watch on YouTube
TL;DR
  1. 1

    Unexpected robot motion can come from communication timing and software scheduling even when the control policy is correct.

  2. 2

    Pipelining communication and policy execution reduces cycle time, but desynchronized transmit and receive threads can create jitter, stale data, and queued commands.

  3. 3

    Logging, kernel scheduling, and priority inversion can interrupt real-time control and make packet loss harder to diagnose.

Summary

Rishabh Garg explains why robot behavior cannot be blamed on the reinforcement learning policy without inspecting the software and communication pipeline. He builds a small example with sensors, a CPU, a GPU or other accelerator, actuators, and a CAN bus. With ten 100-bit messages on a 1 megabit-per-second bus, communication takes about 1 millisecond, which creates a gap in a 2 millisecond control loop. Pipelining and multithreading reduce the cycle time, but introduce timing problems of their own. A late policy output can queue two transmit messages together. A delayed receive thread can feed stale sensor data into the policy, causing the motors to skip and catch up. Garg recommends synchronization primitives or added timing padding, depending on the platform. He also covers logging pauses, packet-drop logging loops on microcontrollers, and priority inversion in the Linux kernel. The talk gives engineers concrete failure modes to check before changing a policy.

Key ideas
00:01

Robot behavior must be traced through the whole control pipeline

Garg begins with a practical debugging question: when a motor does not move or a robot behaves unexpectedly, is the policy failing or is the software system failing to deliver its data? The controller sits between sensor inputs and actuator commands, and its behavior depends on the communication path as well as the policy. He describes this as a problem he faces almost every day. The talk uses a small toy robot to make the timing effects visible, then follows messages through sensors, computation, threads, the CAN bus, and actuators.

01:20

CAN traffic can consume half of a 2 millisecond control loop

The toy system contains actuators, a CPU, a possible hybrid accelerator, sensors, and a CAN bus. Garg assumes 100 bits per message and ten messages in total, with five sent and five received. At 1 megabit per second, those messages take about 1 millisecond to transmit. That is close to the assumed 2 millisecond policy loop time, so the communication itself creates the gap seen after deployment. The simple receive, policy, and transmit loop therefore cannot maintain the ideal schedule without accounting for bus occupancy.

03:13

Pipelining reduces cycle time by overlapping communication with policy execution

Garg's first option is to accept a longer loop, such as 3 milliseconds. For a high-performance system, he instead separates transmit, receive, and policy work across threads and overlaps them. After receiving the first data, the system starts the next receive before the current policy finishes. When the next iteration begins, it transmits the previous policy result while continuing the current policy. This arrangement parallelizes receive and transmit work while keeping sensor data at the intended cadence. It improves the timing, but the later examples show that multithreading also creates synchronization problems.

06:58

Transmit desynchronization sends late commands together

A policy does not always take the same amount of time. If it runs longer than its deadline, the system misses the intended transmit time and has to queue the command. When the next iteration arrives, the queued command and the current command can go onto the bus together. An external transceiver and the candump utility can record bus messages with timestamps. In a plot, this failure appears as two messages with almost no gap followed by a gap of about 4 milliseconds. The actuator may then try to follow commands that arrive together, which produces catching-up behavior.

07:58

Receive desynchronization feeds stale data into the policy

Fixing the transmit side does not remove every source of abnormal motion. If the receive thread is delayed, the policy runs on old sensor data. The next iteration can still use an older command, while a later iteration skips over data processing and catches up. Garg connects this sequence to jitter-like motor behavior. A cycle-time plot helps diagnose it: a late message creates a roughly 4 millisecond interval, followed by an interval close to zero because the next message arrived soon after it. The plots distinguish message timing problems from policy behavior.

08:38

Synchronization primitives or timing padding can keep stages aligned

Garg recommends low-level synchronization tools such as waits, conditional variables, and semaphores for the toy system. These mechanisms coordinate the transmit, receive, and policy threads so that one stage does not run ahead of another. Some real-time operating systems and microcontrollers may not provide the same facilities available on Linux. In that case, he suggests adding padding, or extra timing cushion, so a small desynchronization does not shift the data into the wrong policy iteration. The goal is to preserve the relationship between each receive, policy execution, and transmitted result.

09:25

Logging can interrupt the control loop and create more packet loss

Logging looks harmless until it writes to storage or a slow peripheral. Garg reports seeing a robot freeze for 30 milliseconds when a control loop wrote logs to an SD card on a Raspberry Pi. His simple fix is to move logging onto another CPU. Microcontrollers have a related problem because logging through a peripheral such as UART can take milliseconds, depending on the amount of data. If the system logs every dropped packet, the log operation can cause the next packet to drop, which triggers another log. The result can be a blackout on the CAN bus.

11:09

Priority inversion can block the path that delivers robot data

Data received by a Linux user process passes through an interrupt and kernel handling before reaching the process. Garg warns that boosting robotics processes to very high priorities can block the kernel itself. The application then prevents the system component responsible for delivering its data from running. He calls this priority inversion in action and says it can make the system drop out for almost seconds at a time. The remedy is to understand each stage of the pipeline, assign priorities carefully, and check that the full system can deliver data as well as process it.

"When things go wrong on the robot, when you don't see that motor move, what's the root cause? Is the policy that is not giving the command or is it the software system?"01:06
Who should watch
  • You are debugging robot motion that looks like a bad control policy, but you have not measured message timing on the bus.
  • Your control loop uses multithreading or pipelining and you need to understand how stale, queued, or desynchronized data reaches the actuators.
  • You are building a real-time robotics system on Linux, a real-time operating system, or a microcontroller and need to account for logging and scheduling delays.