from robo_infra.controllers import DifferentialDriveControllerController 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
>>> 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()