-
Notifications
You must be signed in to change notification settings - Fork 152
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
New grasp pose generator stage #196
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
==========================================
- Coverage 54.63% 53.86% -0.76%
==========================================
Files 102 106 +4
Lines 7852 7967 +115
==========================================
+ Hits 4289 4291 +2
- Misses 3563 3676 +113
Continue to review full report at Codecov.
|
The intent is to add a base class that can be used to implement support for GPD and Dex-Net. These grasp synthesis pipelines have a whole slew of dependencies, so the GPD/Dex-Net support would likely live in a separate packages (say, |
@rhaschke @v4hn perhaps it's helpful to see how this code can be used. See https://github.com/PickNikRobotics/deep_grasp_demo/blob/master/src/gpd_pick_place_task.cpp for an example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I mentioned a few minor things.
I see what you mean about the reformatting. If all that code does need to be reformatted to pass some new requirement, it seems that it should be done in a different PR.
e7e0d89
to
f8ccde7
Compare
It might be useful to check out the implementation and documentations for the demos. |
Looks good for me when I test this with our ur5 robot. |
I had to rebase this to get it to build on Noetic (it was a very easy rebase). Here is my branch. |
Thanks @JStech for providing the rebased branch link. Currently, there is so much other work, that I cannot catch up with all PR reviews. As this one is a larger one, it will probably take some more time... Please be patient (and continue using your own branch meanwhile). |
@JStech 's rebase link works for me, (ubuntu 18, ros melodic with moveit master branch) |
@bostoncleek think this could get merged now? |
@davetcoleman This was ready to be merged back on August 11th. It is a matter of the maintainers pressing the merge button! Looks like it does need a rebase though. I will squash and rebase today. |
It's not just merge, but also review (and possibly fixup). I'm sorry for not getting around to do it.
There is always more pressing issues and often two crying kids in the background since Corona homeoffice.
Thanks for rebasing in advance!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a very quick skim, lgtm
Any change requests will be fixed so please make a comment on what you would like. |
As I said, I did not have the time to look through this in detail, and I'm sorry for that. My biggest concern, as I can recall from discussion with @henningkayser and @lianghongzhuo was that the use-case to receive candidate poses in an any-time fashion through feedback and spawn solutions based on them continuously should be well supported, even if you did not use that approach in your project. |
Don't have the time? ... its World MoveIt Day! of course you have the time. Grow the project a little don't be afraid to let others make a contribution towards your work. If it doesn't happen today I will see you on World MoveIt Day 2022! |
This sounds more like a request for an enhancement. Why block merging useful code because we can imagine even more useful code? |
@bostoncleek could you fix the conflict? |
I shortly looked into this PR and I was surprised by the many unrelated commits. @bostoncleek, it would be great if you could rebase and cleanup the history. |
bdb2552
to
7717231
Compare
a8ae45f
to
ae17d5c
Compare
any updates? |
@bostoncleek Could you rebase this PR? There is some upstream change that makes this PR unable to compile. |
There is some upstream change that makes this PR unable to compile.
Like add this 437cc55
Hongzhuo, I stated above that I will fix this up and merge it, and so I will do that.
If I wouldn't spend some of my time fixing other bugs you cannot find yourself in our setups, I also would have more time for things like this.
(And there are numerous other current issues/patches active in MoveIt/MTC).
In the meanwhile feel free to use the PR branch if you need the stage.
|
@lianghongzhuo yes I will rebase |
03e6f24
to
ef0082a
Compare
This is failing because of clang-tidy.
I don't see where Can a maintainer provide help? |
ef0082a
to
ae376b6
Compare
I rebased. #274 (which was not included here yet) recently made the CI configuration quite a bit stricter and addressed this particular error. |
Hello! @rhaschke 3.Update the demo to use grasping_msgs::GraspPlanningAction, all related .cpp and .h files have been modified, of course, here I refer to @marcpujol-leitat: Now the compilation can pass, but when I run roslaunch moveit_task_constructor_gpd gpd_demo.launch, the terminal has been stuck in the following stages, and the terminal information prompt is as follows: [INFO] [1626318339.260666630]: Loading task parameters I don't know how to solve it. Is there any solution? |
9cd3fe0
to
3c03a32
Compare
WMD 2022! I made some changes and ready for a review. I would really like to get this PR merged. @rhaschke @v4hn @JafarAbdi The demo in this PR PickNikRobotics/deep_grasp_demo#14 has been updated to show the changed message type works. |
Thanks for revitalizing this! Possible reviewers: @henningkayser @mamoll @vatanaksoytezer |
If this can get in I will update the tutorial as well. |
void GraspProvider::feedbackCallback(const grasping_msgs::GraspPlanningFeedbackConstPtr& feedback) { | ||
found_candidates_ = true; | ||
|
||
// Protect grasp candidate incase feedback is sent asynchronously | ||
const std::lock_guard<std::mutex> lock(grasp_mutex_); | ||
grasp_candidates_ = feedback->grasps; | ||
} | ||
|
||
void GraspProvider::doneCallback(const actionlib::SimpleClientGoalState& state, | ||
const grasping_msgs::GraspPlanningResultConstPtr& result) { | ||
if (state == actionlib::SimpleClientGoalState::SUCCEEDED) { | ||
ROS_DEBUG_STREAM_NAMED(LOGNAME, "Found grasp candidates"); | ||
} else { | ||
ROS_ERROR_NAMED(LOGNAME, "No grasp candidates found (state): %s", clientPtr_->getState().toString().c_str()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only use the first feedback message? Why not moving found_candidates_ = true;
to doneCallback
and use the grasps from the goal result? We could remove the mutex if we do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason the mutex is here is to handle multiple feedback messages. After discussing with @rhaschke he was concerned there could be many feedback messages containing grasp samples. The flag is used to indicate that at least one message was received.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But as soon as we enter the if statement if (monitorGoal()) {
in void GraspProvider::compute() {
we will not update the grasp_candidates_
since the mutex is locked, and it will get unlocked just before we exit the function which mean next compute will send a new goal, and we only get the chance to handle the first feedback, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that would simply this by removing the mutex. Yeah this does only handle the first feedback message if compute()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like it to be able to handle multiple feedback messages. Do you see a way that could work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about storing all the grasps from the feedback and results fields into a container. Then after the done callback flags success the compute()
function operates over all those grasp candidates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you see any issues with thread safety?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See bostoncleek#2 for a proposal 😬
This stage uses action messages to communicate with an action server external to MTC. The action server can use machine learning pipelines to sample grasps given a point cloud/depth image. This removes complex dependencies from MTC. The stage sends a request for grasps. If a time out is reached or no grasps are found then planning fails. This stage uses a template parameter which is the action message and inherits from an action base class. This allows other stages to inherit these properties and use action messages.
The action base class can only be used with the action msg GraspPlanning.action from grasping_msgs.
The grasp detection flag is an atomic bool. The scope of the grasp candidate's mutex has been moved.
1667ea7
to
7c47532
Compare
This PR introduces a new stage called
GraspProvider
. This stage uses grasping_msgs::GraspPlanningAction to communicate with an action server external to MTC. The action server is used to provide grasp candidates to MTC. For example the action server can use machine learning pipelines to sample grasps given a point cloud or depth image. This feature removes complex dependencies from MTC that would otherwise be required to generate grasp candidates.The
GraspProvider
stage sends a request for grasps. If a time out is reached or no grasps are found then planning fails. Otherwise the provided grasps will be used by MTC.Closes #188