Skip to content

Tools for analyzing muscle moment arms#115

Open
kbonnet001 wants to merge 5 commits into
pyomeca:mainfrom
kbonnet001:main
Open

Tools for analyzing muscle moment arms#115
kbonnet001 wants to merge 5 commits into
pyomeca:mainfrom
kbonnet001:main

Conversation

@kbonnet001
Copy link
Copy Markdown
Contributor

@kbonnet001 kbonnet001 commented Apr 27, 2026

Some tools for analyzing muscle moment arms are provided.

Given a biorbd model, and in the absence of a wrapping (contouring) object, the sign of a muscle’s moment arm may vary depending on joint configuration. This sign change should not occur in a realistic model, so we aim to retain only the portions where the sign is consistent with the expected behavior.

This new class allows automatic selection of the most accurate range of motion (ROM) for each joint, based on the user-defined true sign of each muscle moment arm. Note that the sign of each moment arm must be provided manually by the user.
A figure is available to visualize the ROM of each joint: examples/data/Sign moment arm examples_data.html
Sign_moment_arm
(The sign of the muscle moment arm)
Sign_moment_arm_true
(The incorrect parts are shown in black)
Note that, for now, ghost segments are not ignored. As a result, visualization may be difficult to interpret in such cases.

The user can also provide a trajectory q(t). The class will then return only valid motion segments, i.e., when joints are within their correct range of motion.
A figure is also provided to visualize correct and incorrect portions of the movement: examples/data/Joint_states_and_ROM_limits.html

Joint_states_and_ROM_limits

An example is available at the end of the file: examples/muscle_moment_arm_analyzer.py.
Do not hesitate to ask any questions if anything is unclear.

Some tests have been created in the file: "tests/test_muscle_moment_arm_analyzer.py"

All Submissions:

  • Have you followed the guidelines in our Contributing document [docs/contribution.md]?
  • Have you checked to ensure there aren't other open [Pull Requests] for the same update/change?
  • Have you opened/linked the issue related to your pull request?
  • Have you used the tag [WIP] for on-going changes, and removed it when the pull request was ready?
  • When ready to merge, have you sent a comment pinging @EveCharbie in it?

New Feature Submissions:

  1. Does your submission pass the tests (if not please explain why this is intended)?
  2. [~] Did you write a proper documentation (docstrings and ReadMe)
  3. Have you linted your code locally prior to submission (using the command: black . -l120")?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new examples for your core changes, as applicable?
  • Have you written new tests for your core changes, as applicable?

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