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

Fixup TOTG #3427

Merged
merged 10 commits into from May 12, 2023
Merged

Fixup TOTG #3427

merged 10 commits into from May 12, 2023

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented May 11, 2023

This fixes several issues introduced in #3412. Replaces #3426.

Apart from a lot of code redundancy introduced in #3412, this PR also fixes a severe bug introduced there:
Because the TOTG algorithm considers all group variables (including mimic joints), the lookup of velocity and acceleration limits cannot be restricted to active joint variables only. Differently sized vectors might lead to segfaults!

To be honest, I am somewhat disappointed about the poor quality of PRs and reviews from approved maintainers in the last few months. Please improve!

@rhaschke
Copy link
Contributor Author

@AndyZe, I noticed that the unit test is rather slow: it takes more than a minute to finish the single time parameterization test on my side. I have seen that your code essentially iteratively adapts the acceleration bounds based on observed torques. Looks like many iterations are required to converge. Did you analyze the behavior? How can the performance be further improved?

@AndyZe
Copy link
Contributor

AndyZe commented May 11, 2023

I didn't notice that but I'll test it when I review your code. It should be limited to 10 iterations and they should be very fast since TOTG and the fwd dynamics are all very fast.

const size_t max_iterations = 10;

@rhaschke
Copy link
Contributor Author

Looks like I tested with a DEBUG build. With a release build, the time is down to 7s, which is still some time but maybe acceptable.

@AndyZe
Copy link
Contributor

AndyZe commented May 11, 2023

@rhaschke
Copy link
Contributor Author

Indeed, reducing the amount of joint motion brings the test duration down to 3ms. Is this ready to merge?

@AndyZe
Copy link
Contributor

AndyZe commented May 12, 2023

To be honest, I am somewhat disappointed about the poor quality of PRs and reviews from approved maintainers in the last few months. Please improve!

Is this ready to merge?

lol. Reviewing now.

"<joint name=\"joint_a\"/>"
"</group>"
"</robot>";
const std::string srdf = R"(<?xml version="1.0" ?>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this R necessary? Seems strange:

R"(<?xml version="1.0" ?>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Read about raw string literals (since C++11).

@moveit moveit deleted a comment from codecov bot May 12, 2023
@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Patch coverage: 75.76% and project coverage change: +0.05 🎉

Comparison is base (4aeccc7) 61.69% compared to head (801ea9c) 61.74%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3427      +/-   ##
==========================================
+ Coverage   61.69%   61.74%   +0.05%     
==========================================
  Files         385      385              
  Lines       34095    34035      -60     
==========================================
- Hits        21033    21012      -21     
+ Misses      13062    13023      -39     
Impacted Files Coverage Δ
...del/include/moveit/robot_model/joint_model_group.h 95.70% <ø> (+2.16%) ⬆️
moveit_core/robot_model/src/joint_model_group.cpp 61.87% <ø> (-0.14%) ⬇️
...ocessing/iterative_torque_limit_parameterization.h 100.00% <ø> (ø)
...cessing/src/time_optimal_trajectory_generation.cpp 91.20% <72.42%> (+2.93%) ⬆️
...ry_processing/time_optimal_trajectory_generation.h 100.00% <100.00%> (ø)
...ng/src/iterative_torque_limit_parameterization.cpp 64.29% <100.00%> (+0.36%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AndyZe AndyZe merged commit 6b6de9e into master May 12, 2023
9 checks passed
@AndyZe AndyZe deleted the fixup-totg branch May 12, 2023 17:58
<joint name="joint_a"/>
<joint name="joint_b"/>
</group>
"</robot>)";
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like an extra quote here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well spotted. Wasn't noticed, because the extra quote goes as text in the XML and is simply ignored.

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.

None yet

3 participants