Skip to content

Conversation

@Adityakk9031
Copy link

Description
This PR implements the necessary data exposure to support capstan friction models (e.g., Euler-Eytelwein formula) for spatial tendons. It exposes the internally computed wrap geometry (wrap length, entry point, exit point) which was previously discarded.

Fixes #3005

Changes
mjdata.h
Added new fields to mjData to store per-wrap-segment geometry:

mjtNum* wrap_length: Arc length of the wrap on the geometry surface.
mjtNum* wrap_entry: 3D position of the tendon entry tangent point.
mjtNum* wrap_exit: 3D position of the tendon exit tangent point.
mjxmacro.h
Updated MJDATA_POINTERS to include the new fields, ensuring automatic memory allocation and pointer initialization in
mj_makeData
.

engine_core_smooth.c
Modified
mj_tendon
to populate the new wrap_length, wrap_entry, and wrap_exit fields using the values computed by
mju_wrap
.

Motivation
Currently, users cannot implement physically accurate capstan friction models (T_high = T_low * exp(mu * theta)) because the wrap angle theta (or arc length) is not accessible via the API, even though it is computed internally. This change exposes that data, enabling advanced cable-driven robot simulation.

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.

friction between cable and geometry (eg capstan)

1 participant