Programming · TeleOp
TeleOp drive that stays controllable
Drivetrain patterns, gamepad mapping, scaling, and quick fixes for control issues.
What this is
- Practical TeleOp patterns for tank and mecanum.
- Gamepad mapping, scaling, and deadzones.
- Common TeleOp issues and rapid fixes.
When you need it
- Drivers complain about drift, jerky motion, or over-rotation.
- Switching from tank to mecanum or adding strafing.
- Need predictable control before scrimmage/league meet.
How it works
- Tank: left stick drives left motors, right stick drives right motors.
- Mecanum: combine forward/back, strafe, and turn; normalize wheel powers to keep |power| ≤ 1.
- Scaling: apply cubic or clipped scaling to make small inputs gentle, full inputs still reach 1.0.
- Deadzones: ignore tiny stick noise (e.g., 0.05–0.1) to reduce drift.
Common mistakes
- No normalization on mecanum → motors clip and feel weak/uneven.
- Zero deadzone → robot creeps when sticks aren’t perfectly centered.
- Mixing field-centric math without resetting IMU yaw.
- Forgetting to invert motors so forward is consistent.
How to test it
- On blocks, verify wheel directions match commanded strafe/turn.
- Drive in a straight line at low and high power; watch for drift.
- Strafe both directions; check that rotation is stable (adjust k if needed).
- Record telemetry: stick values, scaled outputs, motor powers; confirm symmetry.
Related problems
- Robot drifts at idle → increase deadzone; check IMU calibration if field-centric.
- Weak strafe → normalize powers; check wheel orientation and friction.
- Over-rotation on turn → reduce turn gain or apply ramping.
