Skip to content
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

Add methods for computing frame differences #93

Merged

Conversation

francesco-donofrio
Copy link
Contributor

This PR introduces a method to compute frame differences, along with a corresponding KDL implementation.

Comment on lines +127 to +128
std::vector<double> & x_a_vec, std::vector<double> & x_b_vec, double dt,
std::vector<double> & delta_x_vec);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not imbibe the size constraints?

Suggested change
std::vector<double> & x_a_vec, std::vector<double> & x_b_vec, double dt,
std::vector<double> & delta_x_vec);
std::array<double, 7> & x_a_vec, std::array<double, 7> & x_b_vec, double dt,
std::array<double, 6> & delta_x_vec);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used std::vector<double> to maintain consistency with the convert_joint_deltas_to_cartesian_deltas method, where std::vector<double> is used for the delta_x parameter.

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 10 lines in your changes missing coverage. Please review.

Project coverage is 80.00%. Comparing base (f9c7c3a) to head (ac8a8c3).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
kinematics_interface/src/kinematics_interface.cpp 47.05% 6 Missing and 3 partials ⚠️
...ics_interface_kdl/src/kinematics_interface_kdl.cpp 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #93      +/-   ##
==========================================
- Coverage   80.20%   80.00%   -0.21%     
==========================================
  Files           4        4              
  Lines         197      245      +48     
  Branches       35       52      +17     
==========================================
+ Hits          158      196      +38     
- Misses         28       34       +6     
- Partials       11       15       +4     
Flag Coverage Δ
unittests 80.00% <80.00%> (-0.21%) ⬇️

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

Files with missing lines Coverage Δ
...lude/kinematics_interface/kinematics_interface.hpp 100.00% <ø> (ø)
...terface_kdl/test/test_kinematics_interface_kdl.cpp 100.00% <100.00%> (ø)
...ics_interface_kdl/src/kinematics_interface_kdl.cpp 70.43% <94.11%> (+3.43%) ⬆️
kinematics_interface/src/kinematics_interface.cpp 65.90% <47.05%> (-11.87%) ⬇️

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in principle LGTM.
But afaik this is really breaking ABI in the controllers due to the new virtual method.
Do you need this in Jazzy? We can break Rolling, but want to avoid that on Jazzy.

We can either add version macros (with rclcpp/version.h for example) to add this only on rolling or create a new branch for jazzy.

@francesco-donofrio
Copy link
Contributor Author

@christophfroehlich I'm currently using such feature in Humble, into a custom controller.

What do you mean with breaking ABI in the controllers?

@christophfroehlich
Copy link
Contributor

Ok we can't backport this to humble. But you always can compile the rolling development version of the ros2_control stack from source on humble distro.

Disclaimer: I'm not an expert here but from what I learned:
Changing/Adding virual methods changes the vtable layout. Programs statically linking against this library break if not both are updated accordingly. This happens often if users only update the ros2_controllers but don't upgrade the dependencies: Then the system may explode unexpectedly.

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed my mind regarding ABI break, as @saikishor already said

I'm not sure about the kinematics interface, because it is plugin based and break in ABI is not a problem mostly, as it is used along with smart pointers. For instance: https://github.com/ros-controls/ros2_controllers/blob/master/admittance_controller%2Finclude%2Fadmittance_controller%2Fadmittance_rule.hpp#L191-L193

I am not allowed to push to your branch, could you please merge the master branch and hopefully the failing clang job is fixed then.

@my-rice
Copy link

my-rice commented Feb 21, 2025

I merged the master branch on behalf of my colleague @francesco-donofrio, and now the PR for unisa-acg:feature/calculate_frame_difference is up to date with ros-controls:master.

@bmagyar
Copy link
Member

bmagyar commented Feb 21, 2025

A Quick CI run and we'll know more. Thank you for following up @my-rice

Copy link
Contributor

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
We see the failing RHEL job also on the master branch, this is not related to this PR.

Copy link
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created a branch for Jazzy. This goes into Rolling and Kilted (soon!)

@bmagyar bmagyar changed the title Calculate frame difference Add methods for computing frame differences Mar 11, 2025
@bmagyar bmagyar merged commit 369264b into ros-controls:master Mar 11, 2025
20 of 21 checks passed
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.

6 participants