Skip to content

Reorganize URDF packages, fix mesh resolution, enhance gravity comp controller - #27

Closed
Yang-Ci wants to merge 2 commits into
Seeed-Projects:mainfrom
Yang-Ci:feat/urdf-package-cleanup-and-gravity-comp
Closed

Reorganize URDF packages, fix mesh resolution, enhance gravity comp controller#27
Yang-Ci wants to merge 2 commits into
Seeed-Projects:mainfrom
Yang-Ci:feat/urdf-package-cleanup-and-gravity-comp

Conversation

@Yang-Ci

@Yang-Ci Yang-Ci commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR reorganizes the URDF packages, fixes a mesh resolution bug, and enhances the gravity compensation controller with new tuning parameters.

Changes

URDF Package Reorganization

  • Removed obsolete packages urdf/00-arm-rs_asm-v3/ (old RS) and urdf/reBot-DevArm_fixend_description/ (old DM). Neither was referenced by any code outside the urdf/ directory.
  • Added urdf/DM/ with ReBot_Arm_DM.urdf featuring separated visual/collision meshes, multi-material colored visuals, and gripper finger definitions (prismatic joints with mimic coupling).
  • Added urdf/RS/ with ReBot_Arm_RS.urdf and organized mesh directories (visual/, shared/, mujoco_collision/).
  • Updated urdf_path in config/rebotarm_dm.yaml, config/rebotarm_rs.yaml, and tools/gravity_calibration/*.py to point to the new package paths.

Mesh Resolution Fix

  • _resolve_urdf() in robot_model.py returned a single package directory derived from the URDF path. This broke when a URDF mixed two mesh-path conventions: ../meshes/... (relative to URDF dir) and meshes/... (relative to package root).
  • Now returns both the URDF directory and its parent as package_dirs, so Pinocchio resolves either convention without per-URDF workarounds.
  • Applied the same fix to example/sim/visualizer.py.

Gravity Compensation Controller Enhancements

  • tau_scale: per-joint gravity torque scaling to correct model-vs-hardware mass/inertia bias.
  • transition_duration: smooth gain fade-in from stiff hold to compliant gravity-comp gains, preventing sudden stiffness loss at startup.
  • joint_direction: per-joint sign correction for motor/URDF axis mismatches.
  • hold_kp/hold_kd: stiff position hold gains; end() now maintains the current pose with stiff gains + gravity feedforward instead of simply disconnecting.
  • Added gravity_compensation config sections to both DM and RS YAML files with calibrated tau_scale values.
  • Updated example scripts (9, 10) to use the new controller parameters.

Config Tuning

  • Switched default hardware in rebotarm.yaml from DM to RS.
  • Tuned POS_VEL pos_kp for joints 4-6 in rebotarm_dm.yaml (50 -> 70/60/60).

Additional Fixes

  • MIT control example: accept either 6 arm-only values or 7 arm-plus-gripper values. A 6-value command preserves the current gripper target, while a 7-value command updates it. This behavior is driven by the configured group sizes and works identically for DM and RS.
  • FK simulation: keep the documented 6-value arm input while padding the remaining URDF gripper/finger coordinates to zero internally, so the command no longer incorrectly requires 8 values.
  • Interaction cleanup: support inline comments, reject malformed numeric input safely, and ensure MIT control exits through disconnect on Ctrl+C or EOF.

…ontroller

URDF package reorganization:
- Remove obsolete packages urdf/00-arm-rs_asm-v3/ (old RS) and
  urdf/reBot-DevArm_fixend_description/ (old DM). Neither was referenced
  by any code outside the urdf/ directory.
- Add urdf/DM/ with ReBot_Arm_DM.urdf featuring separated visual/collision
  meshes, multi-material colored visuals, and gripper finger definitions
  (prismatic joints with mimic coupling).
- Add urdf/RS/ with ReBot_Arm_RS.urdf and organized mesh directories
  (visual/, shared/, mujoco_collision/).
- Update urdf_path in config/rebotarm_dm.yaml and rebotarm_rs.yaml, plus
  tools/gravity_calibration/*.py references, to the new package paths.

Mesh resolution fix:
- _resolve_urdf() in robot_model.py returned a single package directory
  derived from the URDF path. This broke when a URDF mixed two mesh-path
  conventions: "../meshes/..." (relative to URDF dir) and "meshes/..."
  (relative to package root).
- Now returns both the URDF directory and its parent as package_dirs so
  Pinocchio resolves either convention without per-URDF workarounds.
- Apply the same fix to example/sim/visualizer.py.

Gravity compensation controller enhancements:
- Add tau_scale (per-joint gravity torque scaling) to correct model-vs-
  hardware mass/inertia bias.
- Add transition_duration for smooth gain fade-in from stiff hold to
  compliant gravity-comp gains, preventing sudden stiffness loss at
  startup.
- Add joint_direction (per-joint sign correction) for motor/URDF axis
  mismatches.
- Add hold_kp/hold_kd for stiff position hold; end() now maintains the
  current pose with stiff gains + gravity feedforward instead of simply
  disconnecting the robot.
- Add gravity_compensation config sections to both DM and RS YAML files
  with calibrated tau_scale values.
- Update example scripts (9, 10) to use the new controller parameters.

Config tuning:
- Switch default hardware in rebotarm.yaml from DM to RS.
- Tune POS_VEL pos_kp for joints 4-6 in rebotarm_dm.yaml (50 -> 70/60/60).
@Yang-Ci

Yang-Ci commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #28, which combines the original URDF and gravity-controller changes with the new YAML profiles and robust RobStride velocity-lock implementation.

@Yang-Ci Yang-Ci closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant