Skip to content

Add MoveTo tests & make them pass#304

Merged
v4hn merged 12 commits intomoveit:masterfrom
v4hn:pr-move-to-tests
Nov 12, 2021
Merged

Add MoveTo tests & make them pass#304
v4hn merged 12 commits intomoveit:masterfrom
v4hn:pr-move-to-tests

Conversation

@v4hn
Copy link
Copy Markdown
Contributor

@v4hn v4hn commented Oct 24, 2021

@v4hn v4hn mentioned this pull request Oct 24, 2021
2 tasks
@v4hn v4hn force-pushed the pr-move-to-tests branch from a381e38 to 458626a Compare October 25, 2021 08:58
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 25, 2021

Codecov Report

Merging #304 (3b83598) into master (d6f68f9) will increase coverage by 1.13%.
The diff coverage is 79.13%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
+ Coverage   51.85%   52.97%   +1.13%     
==========================================
  Files         101      102       +1     
  Lines        7561     7595      +34     
==========================================
+ Hits         3920     4023     +103     
+ Misses       3641     3572      -69     
Impacted Files Coverage Δ
core/include/moveit/task_constructor/stage.h 89.14% <ø> (ø)
...clude/moveit/task_constructor/stages/fixed_state.h 100.00% <ø> (ø)
...e/include/moveit/task_constructor/stages/move_to.h 100.00% <ø> (+50.00%) ⬆️
core/include/moveit/task_constructor/utils.h 100.00% <ø> (ø)
core/src/utils.cpp 68.43% <68.43%> (ø)
core/src/stages/compute_ik.cpp 79.92% <71.43%> (+2.33%) ⬆️
core/src/stages/move_relative.cpp 69.57% <75.00%> (-0.17%) ⬇️
core/src/solvers/joint_interpolation.cpp 87.76% <83.34%> (+12.00%) ⬆️
core/src/stages/move_to.cpp 79.86% <95.24%> (+46.29%) ⬆️
core/src/stages/fixed_state.cpp 100.00% <100.00%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6f68f9...3b83598. Read the comment docs.

@v4hn
Copy link
Copy Markdown
Contributor Author

v4hn commented Oct 25, 2021

Sorry for the broken tests before. This is ready for merge from my perspective.

Maintaining support for the melodic branch becomes more annoying over time and I had to create the first compatibility function to keep most of the functionality.

@rhaschke I'm unsure which approach to melodic I want to support here these days. Do you have a preference?

  • drop melodic and continue developing for moveit's noetic-devel/master branches
  • split a branch off for melodic here and simplify ifdefs in each branch
  • support melodic as much as possible through more ifdefs, but ignore unsupported features through compatibility code (pretty much what I did here)

@v4hn v4hn force-pushed the pr-move-to-tests branch from 458626a to adaed81 Compare October 25, 2021 12:39
@gautz
Copy link
Copy Markdown
Contributor

gautz commented Oct 26, 2021

I can confirm the support of subframes as IK frame is working as in my previous PR.
Now another issue: planning is failing when setting path constraints for e.g Pilz CIRC motion or OMPL constrained planning with ik_frame set as a subframe.

Is it somehow related to moveit/moveit#2250 (and #191 )?
Or should I open a new issue in MTC?

Copy link
Copy Markdown
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

Looks good. Sorry for the long delay in reviewing this. I focussed on the MoveIt release first.
Note the minor fixup commits. They should be squashed into their base commit before merging (I guess you want to keep history).

@rhaschke
Copy link
Copy Markdown
Contributor

rhaschke commented Nov 6, 2021

Sorry, I didn't test on Melodic... Please, just drop my latest commit (8408fba).

@rhaschke
Copy link
Copy Markdown
Contributor

rhaschke commented Nov 6, 2021

Hm. moveit/moveit_resources#92 broke the pick+place test. Should be fixed now.

Comment on lines 223 to 241
if (value.empty()) { // property undefined
// determine IK link from group
if (!(link = jmg->getOnlyOneEndEffectorTip())) {
if (!get_tip(ik_pose_msg.header.frame_id)) {
solution.markAsFailure("missing ik_frame");
return false;
}
ik_pose_msg.header.frame_id = link->getName();
ik_pose_msg.pose.orientation.w = 1.0;
} else {
ik_pose_msg = boost::any_cast<geometry_msgs::PoseStamped>(value);
if (!(link = robot_model->getLinkModel(ik_pose_msg.header.frame_id))) {
solution.markAsFailure("unknown link for ik_frame: " + ik_pose_msg.header.frame_id);
if (ik_pose_msg.header.frame_id.empty() && !get_tip(ik_pose_msg.header.frame_id)) {
solution.markAsFailure("frame_id of ik_frame is empty and no unique group tip was found");
return false;
} else if (!scene->knowsFrameTransform(ik_pose_msg.header.frame_id)) {
std::stringstream ss;
ss << "ik_frame specified in unknown frame '" << ik_pose_msg << "'";
solution.markAsFailure(ss.str());
return false;
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This block of code is required 1:1 for MoveRelative as well:
https://github.com/ros-planning/moveit_task_constructor/blob/7ec874572c3b35f1cdd7a71c5e6b94c749b3093b/core/src/stages/move_relative.cpp#L199-L213

We should factor that out into a function...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

please have another look. I'm happy with the code again (assuming CI is) and I addressed this too.

v4hn and others added 11 commits November 10, 2021 13:12
never unload the plugin loader before the plugins (IK plugins here).
We don't have unrelated loaders in gtest executables, so the static should be fine.
(partially disabled because broken)
I just didn't know the syntax was allowed
previous oversight
leaves us a place to put free helper functions
fallbacks and verification.
Copy link
Copy Markdown
Contributor

@rhaschke rhaschke left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup. LGTM. Note, that I didn't test myself - I assume you did that 😉


TEST_F(PandaMoveTo, stateTarget) {
move_to->setGoal([]() {
move_to->setGoal([] {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting. Haven't seen this syntax before 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Me neither, but it's nice. The downside is that for some reason [] -> Type {} is not supported syntax though and requires []() -> Type {} (which reads so much... better?)

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.

3 participants