Skip to content

Reorganize URDF packages and improve configurable gravity compensation - #28

Merged
ZhuYaoHui1998 merged 3 commits into
Seeed-Projects:mainfrom
Yang-Ci:feat/urdf-gravity-comp-profiles
Aug 31, 2026
Merged

Reorganize URDF packages and improve configurable gravity compensation#28
ZhuYaoHui1998 merged 3 commits into
Seeed-Projects:mainfrom
Yang-Ci:feat/urdf-gravity-comp-profiles

Conversation

@Yang-Ci

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

Copy link
Copy Markdown
Contributor

Summary

This PR supersedes #27 and combines the URDF/package cleanup with the latest RS gravity-compensation work.

Changes

  • Reorganize the DM and RS URDF packages and remove obsolete packages.
  • Resolve meshes against both the URDF directory and package root.
  • Enhance the reusable gravity-compensation controller with torque scaling, smooth startup, direction correction, stiff hold, and safe homing behavior.
  • Keep MIT/FK examples compatible with configured arm and gripper joint counts.
  • Add RS gravity-compensation profiles for the basic example and the end-effector velocity-lock example.
  • Load gravity-control parameters from the active hardware YAML instead of hardcoding them in examples 9 and 10.
  • Rewrite example 10 for RobStride using position-difference velocity estimation, low-pass filtering, release/re-lock hysteresis, settling time, and dt-scaled bounded integral action.

Validation

  • Python compileall for reBotArm_control_py and example
  • Profile loading and unknown-profile validation
  • Offline velocity-lock state transitions
  • Offline Pinocchio Jacobian/model dimension checks
  • Offline full MIT command callback check confirming RS get_velocities is not used
  • git diff --check

Hardware-in-the-loop validation has not been run.

…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 marked this pull request as ready for review August 31, 2026 01:16
@ZhuYaoHui1998
ZhuYaoHui1998 merged commit 1bcd81b into Seeed-Projects:main Aug 31, 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.

2 participants