Skip to content

Commit 7a33e58

Browse files
jasondamingclaude
andcommitted
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>
1 parent ea0e64b commit 7a33e58

1 file changed

Lines changed: 14 additions & 63 deletions

File tree

source/docs/software/kinematics-and-odometry/intro-and-chassis-speeds.rst

Lines changed: 14 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ Teams should use WPILib's kinematics and odometry classes for several important
2525

2626
**Self-correction**: Combined with vision systems (like AprilTag detection), odometry can be continuously updated to correct for drift and maintain accuracy throughout a match.
2727

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-
3728
### Trajectory Generation and Following
3829

3930
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
5243

5344
**Match strategy**: Plan routes that avoid defense, optimize cycle times, coordinate with alliance partners
5445

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
7347

74-
### Swerve Drive
48+
For drivetrain-specific implementation examples:
7549

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
51+
- **Swerve Drive**:
52+
- `REV MAXSwerve Template <https://github.com/REVrobotics/MAXSwerve-Java-Template>`__ - Complete swerve template from REV Robotics
53+
- `YAGSL (Yet Another Generic Swerve Library) <https://github.com/BroncBotz3481/YAGSL>`__ - Vendor-agnostic swerve library
54+
- `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
10756

10857
## Important considerations
10958

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.
11160

11261
**Sensor requirements**: All kinematics implementations require:
113-
- Encoders for measuring wheel/module speeds and positions
62+
- Encoders for measuring wheel speeds
11463
- 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.
11667

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.
11869

11970
**Coordinate system**: WPILib uses a specific coordinate system. See :doc:`/docs/software/basic-programming/coordinate-system` for details.
12071

0 commit comments

Comments
 (0)