diff_drive_controller
The diff_drive_controller is a bidirectional kinematic converter that bridges high-level navigation and wheel control.
Wheel Velocity Computation
- Receives velocity commands from Nav2 controller via
cmd_veltopic, with linear velocity \(v_x\) and angular velocity \(\omega_z\). -
Converts to individual wheel velocities using inverse kinematics:
\(w_{l} = \frac{v_x - 0.5 \omega_z d}{r}\)
\(w_{r} = \frac{v_x + 0.5 \omega_z d}{r}\)
where \(d\) - wheel separation, \(r\) - wheel radius
-
Sends computed velocities to the hardware interface (simulation).
Odometry Feedback
- Reads actual wheel positions from state interfaces (simulation) and calculates wheel velocities.
-
Calculates robot velocity using forward kinematics:
\(v_x = \frac{w_{l} + w_{r}}{2}\)
\(\omega_z = \frac{w_{r} - w_{l}}{d}\)
-
Publishes computed odometry to
/diff_drive_controller/odomtopic.
The odometry output is fused with IMU and LiDAR data by robot_localization EKF, providing filtered pose estimates back to Nav2 framework.