Skip to content

CHOMP: General fixup - #626

Merged
davetcoleman merged 28 commits into
moveit:kinetic-develfrom
bmagyar:fix_chomp_failed_plan_crash
Jan 14, 2018
Merged

davetcoleman merged 28 commits into
moveit:kinetic-develfrom
bmagyar:fix_chomp_failed_plan_crash

Conversation

@bmagyar

@bmagyar bmagyar commented Oct 10, 2017 •

Copy link
Copy Markdown
Member

Description

  • Fix & test: CHOMP crashes when the planning fails. Currently result fields are copied regardless of the planning success which leads to this behaviour.
  • Fix & test: CHOMP doesn't check for existing start & goal states
  • Fix & test: CHOMP doesn't check for joint limits in start & goal states
  • Fix & test: CHOMP only supports joint position goals, should reject Cartesian ones
  • Fix & test: CHOMP doesn't check end of trajectory within tolerances, fix done
  • Fix & test: CHOMP path is not checked for collisions

This changes a lot, I don't think we should backport it to Indigo unless directly asked for.

Checklist

  • Required: Code is auto formatted using clang-format
  • Optional: Created tests, which fail without this PR reference
  • Optional: Decide if this should be cherry-picked to other current ROS branches (Indigo, Jade, Kinetic)

@bmagyar bmagyar added the moveit day candidate This issue can likely be resolved in less than a day label Oct 10, 2017
@v4hn v4hn added the assigned someone is/should be currently working on this label Oct 10, 2017
@v4hn

v4hn commented Oct 10, 2017

Copy link
Copy Markdown
Contributor

format checking failed.
I'll wait until after WMD to merge this together with the appropriate test.

@simonschmeisser

Copy link
Copy Markdown
Contributor

Last time I looked there was no check if the final path is actually collision free ... so I guess it is very rare (only due to kinematic limits) that a plan actually fails at all. Just my 2 cents if somebody should be wondering why this didn't crash more often.

@bmagyar
bmagyar force-pushed the fix_chomp_failed_plan_crash branch from 4271112 to f2f4712 Compare October 11, 2017 15:14
@davetcoleman

Copy link
Copy Markdown
Member

lgmt but i agree a test would make a great addition to this PR

@bmagyar bmagyar self-assigned this Oct 18, 2017
@bmagyar

bmagyar commented Oct 19, 2017

Copy link
Copy Markdown
Member Author

The reason I didn't submit the test yesterday was that I was simply unable to reproduce a failure...

CHOMP at the moment seems to be perfectly fine with both collisions and not reaching goals...
This PR has suddenly became a bit broader :)

@bmagyar
bmagyar force-pushed the fix_chomp_failed_plan_crash branch from cbc2db0 to 5153df1 Compare October 24, 2017 13:55
@bmagyar bmagyar mentioned this pull request Oct 26, 2017
1 of 5 tasks
@bmagyar bmagyar changed the title WIP: CHOMP: Only copy plan details if plan was successful WIP: CHOMP: General fixup Oct 26, 2017
@bmagyar

bmagyar commented Oct 26, 2017

Copy link
Copy Markdown
Member Author

I've updated the description with what I've done so far and a few todos. Could I please get a bit of general feedback @davetcoleman @v4hn ?

@bmagyar bmagyar mentioned this pull request Nov 15, 2017
@davetcoleman

Copy link
Copy Markdown
Member

Fix & test: CHOMP only supports position goals, should reject Cartesian ones

When you say "position goals" do you mean joint position goals rather than end effector position goals? Just wanted to clarify.

@davetcoleman davetcoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for all this effort!!

<launch>

<include file="$(find moveit_planners_chomp)/test/rrbot_move_group.launch">
</include>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: can make one line:

  <include file="$(find moveit_planners_chomp)/test/rrbot_move_group.launch"/>

<depend>moveit_core</depend>
<depend>pluginlib</depend>

<build_depend>cmake_modules</build_depend>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

cmake_modules no longer needed in kinetic

@@ -0,0 +1,84 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

BSD license pls

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added

class CHOMPMoveitTest : public ::testing::Test
{
public:
moveit::planning_interface::MoveGroupInterface move_group;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

underscore post-fix var name

int ret = RUN_ALL_TESTS();
spinner.stop();
ros::shutdown();
return ret;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

these test are beautiful :)

@@ -0,0 +1,20 @@
<?xml version="1.0" ?>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i think these configuration files belong in moveit_resources

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I personally prefer to have packages carry their own resources for unit tests.

Could still move them, just say the word ;)

jointStateToArray(planning_scene->getRobotModel(), req.start_state.joint_state, req.group_name,
trajectory.getTrajectoryPoint(0));

if (req.goal_constraints[0].joint_constraints.empty())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

check that goal_constraints is non-empty before indexing


if (req.goal_constraints[0].joint_constraints.empty())
{
ROS_ERROR_STREAM("CHOMP only supports joint-space goals");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can you namespace all your ROS_ console output with a name? ROS_ERROR_STREAM_NAMED("chomp_planner",...);

return false;
}

if (not planning_scene->getRobotModel()->satisfiesPositionBounds(req.start_state.joint_state.position.data()))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

woa not! i just learned some more C++11

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 is actually older than c++11 but microsoft decided not to support it because it would break compatibility with C code were it could have been defined using macros. Besides who wants to follow standards anyway?

Theres also 'and', 'or', ... turning it into a slightly less ugly language. See http://en.cppreference.com/w/cpp/language/operator_alternative

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I find them cute in their own weird way :)

}
}

const Eigen::MatrixXd goal_state = trajectory.getTrajectoryPoint(goal_index);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why Xd instead of Affine3d like we normally use in moveit?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's what the ChompTrajectory API uses.

@bmagyar

bmagyar commented Nov 16, 2017

Copy link
Copy Markdown
Member Author

It is joint position goals, I've updated the description

@bmagyar

bmagyar commented Nov 24, 2017 •

Copy link
Copy Markdown
Member Author

I have the test for the goal tolerance violation but couldn't get CHOMP to get a suboptimal result yet. Almost there! :)

@davetcoleman could you quickly check the rest of the changes please?

Note: there are a big bunch of ROS_INFO-s within other parts of the planner, I could remove/namespace/convert those as well, let me know.

@v4hn , any reason why the folder chomp_interface? The package within is called moveit_planners_chomp. I'd prefer to rename it unless there's an opposition.

@davetcoleman davetcoleman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, but tests are still failing

ROS_DEBUG("Optimization took %f sec to create", (ros::WallTime::now() - create_time).toSec());
optimizer.optimize();
ROS_INFO("Optimization actually took %f sec to run", (ros::WallTime::now() - create_time).toSec());
ROS_DEBUG("Optimization actually took %f sec to run", (ros::WallTime::now() - create_time).toSec());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ROS_DEBUG_NAMED("chomp_planner",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll update the debug statements to named as well, good catch!

@bmagyar

bmagyar commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

The tests are ok, they were failing on clang which I fixedin the last commit (not really visible but check the bottom of the PR for latest.

@bmagyar

bmagyar commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

I've also added CHOMP to the planners released with moveit_planners

@davetcoleman

Copy link
Copy Markdown
Member

I've also added CHOMP to the planners released with moveit_planners

Lets leave that change for a separate PR once we confirm the many changes in this PR are good. There will need to be additional steps that @130s should know about

@bmagyar

bmagyar commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

👍 I'll open a new PR with that bit

@bmagyar
bmagyar force-pushed the fix_chomp_failed_plan_crash branch from 07a3d0d to 90a1c39 Compare November 27, 2017 14:28
@bmagyar

bmagyar commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

About the last test: I couldn't reproduce precision issues on the goal with successful plans. We could add creating this to the issue tracker.

@bmagyar

bmagyar commented Nov 27, 2017

Copy link
Copy Markdown
Member Author

@v4hn could we get a merge on this please? :)

@bmagyar bmagyar changed the title WIP: CHOMP: General fixup CHOMP: General fixup Nov 28, 2017
@bmagyar

bmagyar commented Nov 30, 2017

Copy link
Copy Markdown
Member Author

@simonschmeisser any comments?

@simonschmeisser

simonschmeisser commented Dec 5, 2017 •

Copy link
Copy Markdown
Contributor

@bmagyar I'm now always getting collisions (which is an improvement from a safety point of view ;) )

Update: in bool ChompOptimizer::isCurrentTrajectoryMeshToMeshCollisionFree it uses return planning_scene_->isPathValid(start_state_msg, traj); which checks for the whole robot whereas we need a check for the current group only

@bmagyar
bmagyar force-pushed the fix_chomp_failed_plan_crash branch from 90a1c39 to 8b39cc1 Compare January 11, 2018 11:21
@bmagyar

bmagyar commented Jan 11, 2018

Copy link
Copy Markdown
Member Author

@simonschmeisser , I've done the modification you asked for, now collision check is only done for the planning group at hand (which can only be a single one at a time).

I've also rebased the PR. Once the build passes I think we are good to merge!

@bmagyar

bmagyar commented Jan 11, 2018

Copy link
Copy Markdown
Member Author

@simonschmeisser , could you please switch change your review to approve as well? (As long as you approve of course :))

@simonschmeisser

simonschmeisser commented Jan 11, 2018 •

Copy link
Copy Markdown
Contributor

I did some short testing again and it looks impressive when it succeeds in planning and communicates correctly when it fails. Great job! lgtm!

@bmagyar I'm not a maintainer of MoveIt! so I cannot approve apparently, so informally: +1

@bmagyar

bmagyar commented Jan 11, 2018

Copy link
Copy Markdown
Member Author

Thanks!
Interestingly you are still listed as a reviewer on this PR.

I'll go ahead with the merge

@simonschmeisser

Copy link
Copy Markdown
Contributor

Probably somebody else should do the merge?

@bmagyar

bmagyar commented Jan 11, 2018

Copy link
Copy Markdown
Member Author

There are plenty of feature changes that are separated into individual commits with minimal cluttering. I propose a merge via merge commit to add meaningful info to the changelog

@bmagyar

bmagyar commented Jan 11, 2018

Copy link
Copy Markdown
Member Author

@simonschmeisser sure, I nominate @v4hn !

@bmagyar bmagyar assigned v4hn and unassigned bmagyar Jan 11, 2018
@davetcoleman

Copy link
Copy Markdown
Member

Since @simonschmeisser gave this a +1, I'll merge

@davetcoleman
davetcoleman merged commit 9be22e4 into moveit:kinetic-devel Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

assigned someone is/should be currently working on this moveit day candidate This issue can likely be resolved in less than a day

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants