Skip to content

Commit aa92dcc

Browse files
committed
Clarify why position offset is needed in velocity control mode
Added explanation that position feedback is used for: - Joint state publishing - Odometry calculation - State estimation Recommended starting with offset=0.0 for velocity control and only adjusting if encoders show inconsistent readings between wheels.
1 parent e88679f commit aa92dcc

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

MIGRATION_GUIDE.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,17 +185,36 @@ radius = 7.54 / (10 * 2 * 3.14159) = 0.12 meters
185185

186186
### 3. Motor Position Offset
187187

188-
Each motor may have a different zero position. The offset compensates for this.
188+
**Why needed even in velocity control?**
189+
Even though you send velocity commands, the system still reads encoder positions for:
190+
- Joint state publishing (`/joint_states` includes position)
191+
- Odometry calculation (integrates position changes over time)
192+
- State estimation and monitoring
193+
194+
Each motor's encoder may have a different "zero" position when powered on. The offset ensures all encoders report consistent positions.
189195

190196
**How to find offset:**
191-
1. Home your robot to a known position (e.g., wheels aligned)
192-
2. Read encoder positions via Tinymovr Studio
193-
3. Calculate offset to make positions match expected values
197+
198+
**Option A: Set to zero and check (recommended for velocity control)**
199+
1. Set `offset` to `0.0` for all joints
200+
2. Launch the driver: `ros2 launch tinymovr_ros tinymovr_diffbot_demo.launch.py`
201+
3. Check joint positions: `ros2 topic echo /joint_states`
202+
4. If positions are reasonable (near zero or consistent), you're done!
203+
5. If one wheel shows very different position from the other, calculate offset
204+
205+
**Option B: Manual calibration**
206+
1. Physically align your robot to a known position (e.g., wheels straight)
207+
2. Read encoder positions via Tinymovr Studio or from `/joint_states`
208+
3. Set offset = current_position to "zero" the encoders at this alignment
209+
4. Relaunch and verify positions are near zero
194210

195211
**Common values:**
196-
- `0.0` - No offset needed
197-
- `3.14159265359` (π) - 180° offset
212+
- `0.0` - No offset needed (most common for velocity control)
213+
- `3.14159265359` (π) - 180° offset (wheel mounted backwards)
198214
- `-1.5708` (-π/2) - 90° counter-clockwise offset
215+
- Any value - Whatever makes your encoders read consistently
216+
217+
**Important:** For differential drive velocity control, what matters most is that **both wheels use the same reference frame**. If odometry looks good, your offsets are fine!
199218

200219
---
201220

0 commit comments

Comments
 (0)