Skip to content

Commit b4844e4

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 5f25330 commit b4844e4

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
@@ -27,15 +27,6 @@ Teams should use WPILib's kinematics and odometry classes for several important
2727

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

30-
### Field-Oriented Control
31-
32-
For holonomic drivetrains (swerve and mecanum), field-oriented control dramatically improves driver experience:
33-
34-
- Driver joystick inputs remain consistent regardless of robot orientation
35-
- Pushing forward on the joystick always moves toward the opposite alliance station
36-
- Robot can face any direction while moving in any direction
37-
- Significantly reduces driver cognitive load during teleoperation
38-
3930
### Trajectory Generation and Following
4031

4132
Kinematics integrates with WPILib's trajectory generation to create smooth, dynamically-constrained paths:
@@ -54,69 +45,29 @@ Kinematics integrates with WPILib's trajectory generation to create smooth, dyna
5445

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

57-
## When to use each drivetrain type
58-
59-
### Differential Drive
60-
61-
**Best for:**
62-
- Traditional tank drive, "West Coast Drive", or skid-steer robots
63-
- 6-wheel or 8-wheel configurations with traction wheels
64-
- Teams new to advanced control systems
65-
- When pushing power and traction are priorities
66-
67-
**Characteristics:**
68-
- Cannot strafe (move sideways)
69-
- Must turn to change direction
70-
- High traction and pushing power
71-
- Simpler mechanical design
72-
- Non-holonomic (requires Ramsete controller for path following)
73-
74-
**Example code**: See the RamseteCommand example in :doc:`/docs/software/examples-tutorials/wpilib-examples`
48+
## Example Code
7549

76-
### Swerve Drive
50+
For drivetrain-specific implementation examples:
7751

78-
**Best for:**
79-
- Maximum maneuverability and control
80-
- Competitive teams with advanced programming and build experience
81-
- When field-oriented control is desired
82-
- Robots that need to move and rotate independently
83-
84-
**Characteristics:**
85-
- Holonomic (can move in any direction while facing any direction)
86-
- Highest mobility and control
87-
- Most complex mechanically and in software
88-
- Requires precise module control and calibration
89-
- Can use high-traction wheels
90-
91-
**Example code**: See the SwerveBot and SwerveControllerCommand examples in :doc:`/docs/software/examples-tutorials/wpilib-examples`
92-
93-
### Mecanum Drive
94-
95-
**Best for:**
96-
- Teams wanting holonomic drive with simpler mechanics than swerve
97-
- Robots that benefit from strafing but don't need maximum pushing power
98-
- When compactness is important
99-
100-
**Characteristics:**
101-
- Holonomic (can strafe)
102-
- Simpler than swerve mechanically
103-
- Lower pushing power due to mecanum wheel design
104-
- Wheels more prone to wear and slipping
105-
- Slower when strafing than when driving forward (due to 45° roller angle)
106-
- Requires careful weight distribution to keep all wheels on ground
107-
108-
**Example code**: See the MecanumBot and MecanumControllerCommand examples in :doc:`/docs/software/examples-tutorials/wpilib-examples`
52+
- **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
53+
- **Swerve Drive**:
54+
- `REV MAXSwerve Template <https://github.com/REVrobotics/MAXSwerve-Java-Template>`__ - Complete swerve template from REV Robotics
55+
- `YAGSL (Yet Another Generic Swerve Library) <https://github.com/BroncBotz3481/YAGSL>`__ - Vendor-agnostic swerve library
56+
- `CTRE Swerve examples <https://github.com/CrossTheRoadElec/Phoenix6-Examples/tree/main/java/SwerveWithPathPlanner>`__ - Swerve with PathPlanner integration
57+
- **Mecanum Drive**: See mecanum-specific examples in vendor documentation
10958

11059
## Important considerations
11160

112-
**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.
61+
**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.
11362

11463
**Sensor requirements**: All kinematics implementations require:
115-
- Encoders for measuring wheel/module speeds and positions
64+
- Encoders for measuring wheel speeds
11665
- Gyroscope for measuring robot angle (critical for accurate odometry)
117-
- For swerve: absolute encoders for module angles
66+
- For swerve: absolute encoders for measuring module angles
67+
68+
**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.
11869

119-
**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.
70+
**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.
12071

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

0 commit comments

Comments
 (0)