Nfrax Docs logoNfrax Docs

Infrastructure that just works. Ship products, not boilerplate.

Frameworks

  • svc-infra
  • ai-infra
  • fin-infra
  • robo-infra

Resources

  • Getting Started
  • What's New
  • Contributing

Community

  • GitHub

© 2026 nfrax. All rights reserved.

Nfrax Docs logoNfrax Docs
Start HereWhat's New
GitHub
robo-infra / API Reference

DifferentialDrive

from robo_infra.controllers import DifferentialDrive
View source
robo_infra.controllers
Extends:Controller

Controller for differential drive (two-wheel) robots. Differential drive robots use two independently controlled wheels for locomotion. By varying the relative speeds of the left and right wheels, the robot can move forward, backward, turn, or spin in place. This is the most common drive system for: - Mobile robots and rovers - Tank-drive robots - Warehouse AGVs - Educational robots Movement Methods: - forward(speed): Drive forward - reverse(speed): Drive backward - turn_left(speed): Turn left while moving - turn_right(speed): Turn right while moving - spin(speed, clockwise): Spin in place - arc(speed, radius): Follow a curved path - tank(left, right): Direct wheel control - stop(): Stop both motors - brake(): Apply braking

Example

>>> from robo_infra.controllers.differential import DifferentialDrive >>> from robo_infra.actuators.dc_motor import DCMotor >>> >>> left = DCMotor(name="left_wheel") >>> right = DCMotor(name="right_wheel") >>> rover = DifferentialDrive("my_rover", left, right) >>> rover.enable() >>> rover.forward(0.5) >>> rover.turn_left(0.3) >>> rover.stop()

Constructor
DifferentialDrive(name: str, left: DCMotor, right: DCMotor, config: DifferentialDriveConfig | None = None) -> None
ParameterTypeDefaultDescription
namerequiredstr—Controller name
leftrequiredDCMotor—Left wheel motor
rightrequiredDCMotor—Right wheel motor
configDifferentialDriveConfig |NoneNoneOptional configuration

Methods

On This Page

Constructorarcbrakedisableenableforwardreversespinstoptankturn_leftturn_right