Skip to content

Fix fourbarlinkage #1837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

BartlomiejK2
Copy link

Summary:

Fixed effort mapping for FourBarLinkageTransmission, related to #1746.

New equations for effort mapping meet the principles of conservation of energy.

Actuator to joint:

τ j 1 = n j 1 n a 1 τ a 1 + n a 2 τ a 2 τ j 2 = n j 2 n a 2 τ a 2

Joint to actuator:

τ a 1 = τ j 1 τ j 2 / n j 2 n j 1 n a 1 τ a 2 = τ j 2 n j 2 n a 2

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@bmagyar bmagyar added backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. backport-iron labels Nov 2, 2024
@bmagyar
Copy link
Member

bmagyar commented Nov 2, 2024

Could you provide a few further references for documentation please? Wikipedia works too

@BartlomiejK2
Copy link
Author

Unfortunately, I can not find any documentation other than original FourBarLinkageTransmission doxygen documentation, in which this class is the same as one in ros2-control transmission.

To calculate torques, I derived velocity equations for Remote second joint actuation model, and then used energy conservtion law to calculate torques. I could not derive them by itself. If needed, I can post derivation here.

Kinematic equations in original class are correct, only torques needs to be changed.

Copy link
Contributor

This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete.

@github-actions github-actions bot added the stale label Mar 31, 2025
BartlomiejK2 and others added 3 commits April 18, 2025 12:38

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@BartlomiejK2
Copy link
Author

BartlomiejK2 commented Apr 18, 2025

Hi @bmagyar and @christophfroehlich , to this day I have not found any official derivation for FourBarLinkageTransmission, only one paper that talks about special case when all reductions are equal 1 (here's link).
Below is my derivation for torques using original FourBarLinkageTransmission documentation, where equations for position and velocity are derived correctly:

θ ˙ j 1 = θ ˙ a 1 n a 1 n j 1 θ ˙ j 2 = θ ˙ a 2 n a 1 + θ ˙ a 1 n a 1 n j 1 n j 2

Using two link system (from here) I derive jacobians for joints and actuators:

Joint Jacobian:

J j = [ l 1 sin θ 1 l 2 sin ( θ 1 + θ 2 ) l 2 sin ( θ 1 + θ 2 )   l 1 cos ( θ 1 ) + l 2 cos ( θ 1 + θ 2 ) l 2 cos ( θ 1 + θ 2 ) ]

Actuator Jacobian (written using joint positions for simplicity):

J a = [ l 1 sin θ 1 n a 1 n j 1 l 2 sin ( θ 1 + θ 2 ) ( n j 2 1 ) n a 1 n j 1 n j 2 l 2 sin θ 2 n a 2 n j 2   l 1 cos θ 1 n a 1 n j 1 + l 2 cos ( θ 1 + θ 2 ) ( n j 2 1 ) n a 1 n j 1 n j 2 l 2 cos θ 2 n a 2 n j 2 ]

Using equation for calculating static torques from external forces:

τ j = J j T F e x t τ a = J a T F e x t

We get:

τ j = J j T J a T 1 τ a J j T J a T 1 = [ n a 1 n j 1 n a 2   0 n a 2 n j 2 ]

Which is exactly what I've derived in the first comment of this pull request.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@christophfroehlich christophfroehlich linked an issue Apr 26, 2025 that may be closed by this pull request

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.06%. Comparing base (af0d776) to head (254a4a8).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1837      +/-   ##
==========================================
- Coverage   89.08%   89.06%   -0.03%     
==========================================
  Files         139      139              
  Lines       16118    16118              
  Branches     1389     1389              
==========================================
- Hits        14359    14355       -4     
- Misses       1228     1231       +3     
- Partials      531      532       +1     
Flag Coverage Δ
unittests 89.06% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ission_interface/four_bar_linkage_transmission.hpp 77.65% <100.00%> (-0.24%) ⬇️
...erface/test/four_bar_linkage_transmission_test.cpp 99.39% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintainers only! Label triggers PR backport to ROS2 humble. stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Effort Mapping of FourBarLinkageTransmission
3 participants