Skip to content

refactor(jtc): improve jtc tolerances#2133

Open
thedevmystic wants to merge 7 commits intoros-controls:masterfrom
thedevmystic:jtc-tolerances
Open

refactor(jtc): improve jtc tolerances#2133
thedevmystic wants to merge 7 commits intoros-controls:masterfrom
thedevmystic:jtc-tolerances

Conversation

@thedevmystic
Copy link
Contributor

@thedevmystic thedevmystic commented Jan 29, 2026

Hello respected maintainers and reviewers!
This is Surya!

This PR addresses the following:

  • Seperate declaration from definition for better compilation speed and readability.
  • Refactor functions for better readability.
  • Add new function (create_error_trajectory_point).
  • Add extensive doxygen-style comments.
  • Add tests for new function (create_error_trajectory_point).

  1. If you have question, why I moved (or seperated) it to tolerances.cpp it is because the file was getting way too long for no reason. It would both increase compile time and future maintainance.

  2. If you have question, why I added create_error_trajectory_point it is because we can calculate the current error point and then compare it with tolerances with ease!


A note: This is a continuation of the previous PR #2048 (closed now). Instead of doing new features (new tolerances option) and refactoring in one PR. I split them into 2 PRs one doing refactoring (current) and another future PR adding feature.

This commit addresses the following:
  - Seperate declaration from definition for better compilation
    speed and readability.
  - Add new function (create_error_trajectory_point).
  - Add extensive doxygen-style comments.
  - Add tests for new function (create_error_trajectory_point).
@codecov
Copy link

codecov bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 92.70073% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.90%. Comparing base (272ac69) to head (fd82eab).

Files with missing lines Patch % Lines
...include/joint_trajectory_controller/tolerances.hpp 70.58% 6 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2133      +/-   ##
==========================================
+ Coverage   84.80%   84.90%   +0.10%     
==========================================
  Files         151      152       +1     
  Lines       14836    14890      +54     
  Branches     1286     1296      +10     
==========================================
+ Hits        12581    12642      +61     
+ Misses       1784     1779       -5     
+ Partials      471      469       -2     
Flag Coverage Δ
unittests 84.90% <92.70%> (+0.10%) ⬆️

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

Files with missing lines Coverage Δ
joint_trajectory_controller/src/tolerances.cpp 100.00% <100.00%> (ø)
...int_trajectory_controller/test/test_tolerances.cpp 100.00% <100.00%> (ø)
...include/joint_trajectory_controller/tolerances.hpp 74.00% <70.58%> (-5.80%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thedevmystic
Copy link
Contributor Author

Just dropping a comment since it's been 2 weeks with no follow ups :)

@thedevmystic
Copy link
Contributor Author

P.S.

Initially I didn't knew create_error_trajectory_point already has been implemented.


While we have compute_error_for_point in joint_trajectory_controller.hpp, that file is almost 2000 lines long.
So, we can move that logic from there to here. This function utilizes STL's std::transform and has hardened checks. And it also makes sense to put it here, as we create error point to check it with tolerances anyways.


But if we have to remove it then say it to me :)

@thedevmystic
Copy link
Contributor Author

@christophfroehlich, sorry to tag you. But it's been almost 4 weeks without any follow-up. Thank you, and willing to make changes to suit the project!

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.

1 participant