-
Notifications
You must be signed in to change notification settings - Fork 369
removed admittance_transforms_ struct and relevant functions as it acts just as a intermediary storage #1668
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
base: master
Are you sure you want to change the base?
removed admittance_transforms_ struct and relevant functions as it acts just as a intermediary storage #1668
Conversation
…s as just as a intermediary storage
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1668 +/- ##
==========================================
- Coverage 84.81% 84.81% -0.01%
==========================================
Files 127 127
Lines 12114 12108 -6
Branches 1036 1036
==========================================
- Hits 10275 10269 -6
Misses 1501 1501
Partials 338 338
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…s as just as a intermediary storage
…geethik/ros2_controllers into admittance_transforms_-removal
admittance_controller/include/admittance_controller/admittance_rule.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
…_rule.hpp Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
…_rule_impl.hpp Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
…_rule_impl.hpp Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mgeethik I've added some comments
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Show resolved
Hide resolved
// transform wrench_world_ into base frame | ||
// --- control/base frame to base frame (rotation only) --- | ||
success &= kinematics_->calculate_link_transform( | ||
current_joint_state.positions, parameters_.kinematics.base, tf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
current_joint_state.positions, parameters_.kinematics.base, tf); | |
current_joint_state.positions, parameters_.control.frame.id, tf); |
Shouldn't it be this?
ros2_controllers/admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Lines 167 to 169 in 945a360
success &= kinematics_->calculate_link_transform( | |
current_joint_state.positions, parameters_.control.frame.id, | |
admittance_transforms_.base_control_); |
measured_wrench, | ||
// pass rotations into sensor and CoG: | ||
rot_world_base * admittance_state_.ref_trans_base_ft.rotation(), | ||
rot_world_base * /* CoG rotation */ tf.rotation()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In place of tf.rotation
shouldn't it use parameters_.gravity_compensation.frame.id
transform?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. I will change this.
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Show resolved
Hide resolved
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
made the newly requested changes Co-authored-by: Sai Kishor Kothakota <saisastra3@gmail.com>
admittance_controller/include/admittance_controller/admittance_rule_impl.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Resolves #505
Description
After thorough investigation of the issue raised by @destogl in #505 , it was found that the
admittance_transforms_
structure introduced unnecessary duplication of frame transformation data already derivable at runtime. This PR removesadmittance_transforms_
and instead computes all necessary transforms directly within theupdate()
function, storing only the relevant ones inadmittance_state_
where needed.This change simplifies the codebase and avoids duplicated state between
admittance_state_
andadmittance_transforms_
, improving clarity, modularity, and maintainability.Changes made
get_all_transforms()
and theadmittance_transforms_
member.update()
function.Eigen::Isometry3d
) instead of storing redundant transforms.Testing
Ran the existing controller tests to verify correctness.
This is the output of the test:
Please let me know if this is fine or any changes are required