You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address review feedback on kinematics introduction
Changes based on reviewer feedback:
1. Removed "When to use each drivetrain type" section - reviewers felt
drivetrain selection should drive code choice, not vice versa, and
these characteristics aren't directly related to kinematics/odometry
2. Removed "Field-Oriented Control" section - field-oriented control
doesn't require full kinematics/odometry (just gyro), so it was
misleading to include here
3. Replaced WPILib example references with vendor examples that follow
best practices:
- CTRE Phoenix6 examples (differential and swerve with PathPlanner)
- REV MAXSwerve Template
- YAGSL (Yet Another Generic Swerve Library)
This addresses allwpilib#5098 which notes WPILib swerve examples
use quadrature encoders instead of absolute encoders
4. Added mecanum odometry accuracy considerations including:
- Wheel slipping issues
- Benefits of dead wheels for improved accuracy
- Vision-based correction recommendations
5. Applied minor wording improvements:
- Added "and field elements" to odometry drift explanation
- Changed "teleoperation" to "the Teleoperated Period" per manual glossary
- Simplified sensor requirements to remove confusing "module speeds
and positions" wording
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: source/docs/software/kinematics-and-odometry/intro-and-chassis-speeds.rst
+14-63Lines changed: 14 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,15 +25,6 @@ Teams should use WPILib's kinematics and odometry classes for several important
25
25
26
26
**Self-correction**: Combined with vision systems (like AprilTag detection), odometry can be continuously updated to correct for drift and maintain accuracy throughout a match.
27
27
28
-
### Field-Oriented Control
29
-
30
-
For holonomic drivetrains (swerve and mecanum), field-oriented control dramatically improves driver experience:
31
-
32
-
- Driver joystick inputs remain consistent regardless of robot orientation
33
-
- Pushing forward on the joystick always moves toward the opposite alliance station
34
-
- Robot can face any direction while moving in any direction
35
-
- Significantly reduces driver cognitive load during teleoperation
36
-
37
28
### Trajectory Generation and Following
38
29
39
30
Kinematics integrates with WPILib's trajectory generation to create smooth, dynamically-constrained paths:
@@ -52,69 +43,29 @@ Kinematics integrates with WPILib's trajectory generation to create smooth, dyna
52
43
53
44
**Match strategy**: Plan routes that avoid defense, optimize cycle times, coordinate with alliance partners
54
45
55
-
## When to use each drivetrain type
56
-
57
-
### Differential Drive
58
-
59
-
**Best for:**
60
-
- Traditional tank drive, "West Coast Drive", or skid-steer robots
61
-
- 6-wheel or 8-wheel configurations with traction wheels
62
-
- Teams new to advanced control systems
63
-
- When pushing power and traction are priorities
64
-
65
-
**Characteristics:**
66
-
- Cannot strafe (move sideways)
67
-
- Must turn to change direction
68
-
- High traction and pushing power
69
-
- Simpler mechanical design
70
-
- Non-holonomic (requires Ramsete controller for path following)
71
-
72
-
**Example code**: See the RamseteCommand example in :doc:`/docs/software/examples-tutorials/wpilib-examples`
46
+
## Example Code
73
47
74
-
### Swerve Drive
48
+
For drivetrain-specific implementation examples:
75
49
76
-
**Best for:**
77
-
- Maximum maneuverability and control
78
-
- Competitive teams with advanced programming and build experience
79
-
- When field-oriented control is desired
80
-
- Robots that need to move and rotate independently
81
-
82
-
**Characteristics:**
83
-
- Holonomic (can move in any direction while facing any direction)
84
-
- Highest mobility and control
85
-
- Most complex mechanically and in software
86
-
- Requires precise module control and calibration
87
-
- Can use high-traction wheels
88
-
89
-
**Example code**: See the SwerveBot and SwerveControllerCommand examples in :doc:`/docs/software/examples-tutorials/wpilib-examples`
90
-
91
-
### Mecanum Drive
92
-
93
-
**Best for:**
94
-
- Teams wanting holonomic drive with simpler mechanics than swerve
95
-
- Robots that benefit from strafing but don't need maximum pushing power
96
-
- When compactness is important
97
-
98
-
**Characteristics:**
99
-
- Holonomic (can strafe)
100
-
- Simpler than swerve mechanically
101
-
- Lower pushing power due to mecanum wheel design
102
-
- Wheels more prone to wear and slipping
103
-
- Slower when strafing than when driving forward (due to 45° roller angle)
104
-
- Requires careful weight distribution to keep all wheels on ground
105
-
106
-
**Example code**: See the MecanumBot and MecanumControllerCommand examples in :doc:`/docs/software/examples-tutorials/wpilib-examples`
50
+
- **Differential Drive**: See the `CTRE Swerve & Swerve Drivetrain examples <https://github.com/CrossTheRoadElec/Phoenix6-Examples/tree/main/java>`__ which also include differential drive path following
- `CTRE Swerve examples <https://github.com/CrossTheRoadElec/Phoenix6-Examples/tree/main/java/SwerveWithPathPlanner>`__ - Swerve with PathPlanner integration
55
+
- **Mecanum Drive**: See mecanum-specific examples in vendor documentation
107
56
108
57
## Important considerations
109
58
110
-
**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.
59
+
**Odometry drift**: Position estimates accumulate error over time, especially during physical contact with other robots and field elements. This is normal and expected. Vision-based corrections (using AprilTags) help maintain accuracy.
111
60
112
61
**Sensor requirements**: All kinematics implementations require:
113
-
- Encoders for measuring wheel/module speeds and positions
62
+
- Encoders for measuring wheel speeds
114
63
- Gyroscope for measuring robot angle (critical for accurate odometry)
115
-
- For swerve: absolute encoders for module angles
64
+
- For swerve: absolute encoders for measuring module angles
65
+
66
+
**Mecanum odometry accuracy**: Mecanum drive odometry can be less accurate than differential or swerve due to wheel slipping. The accuracy depends on movement complexity, robot speed, and weight distribution. For improved accuracy, consider using dead wheels (omni wheels that don't provide drive power but only measure movement) or combining with vision-based corrections.
116
67
117
-
**Autonomous period accuracy**: Odometry is typically very accurate during autonomous (15 seconds) because there's less robot-to-robot contact. Estimates may drift more during teleoperation.
68
+
**Autonomous period accuracy**: Odometry is typically very accurate during autonomous (15 seconds) because there's less robot-to-robot contact. Estimates may drift more during the Teleoperated Period.
118
69
119
70
**Coordinate system**: WPILib uses a specific coordinate system. See :doc:`/docs/software/basic-programming/coordinate-system` for details.
0 commit comments