Motors

Raccoon has two kinds of motors, and they are controlled in completely different ways.

Chassis motorsAux motors
WhatThe drivetrain wheels (front-left, front-right and so on)Everything else: arm lifts, drum collectors, conveyors, indexers
Controlled byThe kinematic model (DifferentialKinematics or MecanumKinematics), through drive_forward, turn_left, strafe_right and the other driving stepsDirectly, one motor at a time, with the motor steps
Named indrive.kinematics of robot.ymlOnly in motors.yml
flowchart TD
    subgraph "Chassis motors"
        DS["drive_forward(cm)\nturn_left(deg)\nstrafe_right(cm)"] --> KM["Kinematic model\nDifferential / Mecanum"]
        KM --> WHL["Per-wheel velocity commands"]
    end
    subgraph "Aux motors"
        MS["move_motor_to(motor, pos)\nset_motor_dps(motor, dps)\nset_motor_power(motor, pct)"] --> MW["Direct motor command"]
    end
    style DS fill:#4CAF50,color:#fff
    style MS fill:#42A5F5,color:#fff

Never command a chassis motor directly. Do not use move_motor_to, set_motor_power, set_motor_dps or the other motor steps on a drivetrain motor: you fight the drive controller and the robot drives unpredictably. In the other direction, aux motors are not part of the kinematic model, so drive_forward does not move them.

PageWhat it covers
Motor configDeclaring a motor in motors.yml
Move to Positionmove_motor_to and move_motor_relative
Other Motor StepsVelocity, power and stop steps, stop modes, patterns