-
Notifications
You must be signed in to change notification settings - Fork 157
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
documenting instructions for the pick-and-place task #238
documenting instructions for the pick-and-place task #238
Conversation
Codecov Report
@@ Coverage Diff @@
## master #238 +/- ##
=======================================
Coverage 33.86% 33.86%
=======================================
Files 93 93
Lines 5491 5491
=======================================
Hits 1859 1859
Misses 3632 3632 Continue to review full report at Codecov.
|
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.
Sorry for the late review, and thanks for the PR. I think this demo deserves detailed comments, so I hope this doesn't come across the wrong way, but I would actually appreciate if you could make this text shorter and more concise. The comments are verbose in a way that often makes them confusing instead of clarifying.
Consider this sentence: "The GenerateGraspPose circles in AngleDelta increments along the object creating one target pose in each instance."
Is "instance" a class instance, or a stage instance, or just a word that could be eliminated? When you read "The GenerateGraspPose circles", is "circles" a verb or noun? It could be either, and the reader can't be sure until almost the end of the sentence. The reference "the GenerateGraspPose" without the word "stage" reads strangely, almost like writing "the cancer" instead of "the cancer patient".
Consider this alternative: "The GenerateGraspPose stage adds grasp pose candidates in angle increments around the z-axis."
I've had this review half-done in my tabs for a while, so I'd rather submit this potentially unhelpful comment before this gets stale. To reiterate, this doesn't need to win a literary nobel prize and it already makes the demo better, but I think it's unnecessarily confusing in many parts. Would be glad if you could try improving on some of those points and update the PR.
demo/src/pick_place_task.cpp
Outdated
// "high level" movements: Checking if the object to be picked is already attached to the robot arm, opening the robot's | ||
// hand, moving the robot to the pre-grasp position, grasping the object, moving the robot to a pre-place position, | ||
// placing the object, and finally, moving the robot to a standstill position. These six sequences are listed on the | ||
// least indented column of the "Motion Planning Tasks" widget in Rviz. These sequences are not planned or executed but |
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.
"least indented" --> "top-level", although since technically that's not true either I'd skip it altogether. "These sequences are shown in the widget..."
demo/src/pick_place_task.cpp
Outdated
// hand, moving the robot to the pre-grasp position, grasping the object, moving the robot to a pre-place position, | ||
// placing the object, and finally, moving the robot to a standstill position. These six sequences are listed on the | ||
// least indented column of the "Motion Planning Tasks" widget in Rviz. These sequences are not planned or executed but | ||
// defined as part of moveit's task constructor object below. The stages are be described in more detail below. |
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'd call it a Task
object.
demo/src/pick_place_task.cpp
Outdated
@@ -117,6 +126,7 @@ void PickPlaceTask::init() { | |||
* Current State * | |||
* * | |||
***************************************************/ | |||
// Before beginning with the operation, one needs to verify if the object is not already attached to the robot. |
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 try to keep it shorter, in general. E.g. "We verify that the object is not already attached to the robot."
- Does every task need to start with a state? Would help to say something about that here instead (otherwise there are 2 (3) comments within 10 lines about the verification).
demo/src/pick_place_task.cpp
Outdated
@@ -153,6 +163,9 @@ void PickPlaceTask::init() { | |||
* Move to Pick * | |||
* * | |||
***************************************************/ | |||
// This is the second major phase of picking the object. This phase moves to the start of the picking location. The |
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.
Would keep it shorter here, too. E.g. "Moves to a pre-grasp pose from where the gripper approaches the object. Generated by a stage::Connect object which does not plan a movement, but connects two stages that do."
Also, remove the comment in the next line
demo/src/pick_place_task.cpp
Outdated
auto stage = std::make_unique<stages::MoveRelative>("approach object", cartesian_planner); | ||
// This movement approaches the object and stops right before it through a MoveRelative stage. The stage | ||
// resembles the Connect because it does not define an end or starting point but move across space as defined | ||
// as a geometryMsgs. In contrast to the Connect stage, however, the planner does not have any flexibility in |
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.
geometry_msgs::Pose
?
demo/src/pick_place_task.cpp
Outdated
// This movement approaches the object and stops right before it through a MoveRelative stage. The stage | ||
// resembles the Connect because it does not define an end or starting point but move across space as defined | ||
// as a geometryMsgs. In contrast to the Connect stage, however, the planner does not have any flexibility in | ||
// the cartesian structure of the movement as this is precisely defined. |
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'm not sure what you mean by "cartesian structure of the movement"
demo/src/pick_place_task.cpp
Outdated
@@ -176,7 +193,11 @@ void PickPlaceTask::init() { | |||
---- * Approach Object * | |||
***************************************************/ | |||
{ | |||
auto stage = std::make_unique<stages::MoveRelative>("approach object", cartesian_planner); | |||
// This movement approaches the object and stops right before it through a MoveRelative stage. The stage |
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.
Misses a comment that this stage is inserted into the grasp
/PickObject
SerialContainer.
demo/src/pick_place_task.cpp
Outdated
stage->setMonitoredStage(current_state_ptr); // Hook into current state | ||
|
||
// Compute IK | ||
// The object grasp is defined by combining two stages, a GenerateGraspPose and a ComputeIK pose. The |
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.
"latches onto the object" implies a connection that I don't really see. "connects" seems to make more sense.
"The generateGraspPose" should be "The generateGraspPose stage" or "...container". The phrase "a ComputeIK pose" seems to be used to mean "a ComputeIKpose stage". This is confusing.
GenerateGraspPose
is written both with and without capital first letter.
Thank you so much, @felixvd for your detailed and very thoughtful comments to the PR. Your suggestions help me to improve the PR an I will update the it accordingly! |
Thank you again for your detailed and kind comments! I benefited a lot from them and hope the changed PR reflects this. I shortened the explanations and believe the text is more precise and succinct. I am curious to hear what you think of it and appreciate any feedback. Furthermore, should we maybe integrate these comments in a full tutorial for the moveit website as the current MTC tutorial is a bit short? |
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.
Thanks, it's a lot better. I made some suggestions, but I'm good with this overall.
demo/src/pick_place_task.cpp
Outdated
void PickPlaceTask::init() { | ||
ROS_INFO_NAMED(LOGNAME, "Initializing task pipeline"); | ||
const std::string object = object_name_; | ||
|
||
// Reset ROS introspection before constructing the new object | ||
// TODO(henningkayser): verify this is a bug, fix if possible | ||
// Movements are collected inside a Task object. |
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.
A bit confusing with the previous two lines. Make this a line-end comment (put it at the end of the next line with two separating spaces).
demo/src/pick_place_task.cpp
Outdated
@@ -82,20 +82,22 @@ void PickPlaceTask::loadParameters() { | |||
rosparam_shortcuts::shutdownIfError(LOGNAME, errors); | |||
} | |||
|
|||
// The init function declares all movements for the pick-and-place task. These movements are described below. |
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 init function declares all movements for the pick-and-place task. These movements are described below. | |
// The init function declares all movements for the pick-and-place task. |
demo/src/pick_place_task.cpp
Outdated
task_.reset(); | ||
task_.reset(new moveit::task_constructor::Task()); | ||
|
||
Task& t = *task_; | ||
t.stages()->setName(task_name_); | ||
t.loadRobotModel(); | ||
|
||
// Sampling planner | ||
// Different planners plan robot movement: a cartesian , pipeline, or joint interpolation planner. |
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.
// Different planners plan robot movement: a cartesian , pipeline, or joint interpolation planner. | |
// Different planners are available to plan robot motions, e.g. cartesian, pipeline, or joint interpolation. |
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.
Since you can choose any planner. These are just examples.
demo/src/pick_place_task.cpp
Outdated
auto stage = std::make_unique<stages::GenerateGraspPose>("generate grasp pose"); | ||
stage->properties().configureInitFrom(Stage::PARENT); | ||
stage->properties().set("marker_ns", "grasp_pose"); | ||
stage->setPreGraspPose(hand_open_pose_); | ||
stage->setObject(object); | ||
stage->setAngleDelta(M_PI / 12); | ||
stage->setAngleDelta(M_PI / 4); |
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.
Why did this value change?
If it was up to me, I would change this to M_TAU/24
as per this PR of mine, but let's not open that discussion.
demo/src/pick_place_task.cpp
Outdated
stage->setMonitoredStage(current_state_ptr); // Hook into current state | ||
|
||
// Compute IK | ||
// Compute joint parameters for a target frame of the end effector. Each target frame equals a grasp pose | ||
// from the previous stage times the inverse of the user-defined grasp_frame_tansform. |
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 is the grasp_frame_transform
? Why times the inverse?
demo/src/pick_place_task.cpp
Outdated
@@ -217,6 +225,7 @@ void PickPlaceTask::init() { | |||
---- * Allow Collision (hand object) * | |||
***************************************************/ | |||
{ | |||
// Modify the planning scene (does not alter the robot's position) to permit picking up the object. |
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.
// Modify the planning scene (does not alter the robot's position) to permit picking up the object. | |
// Modify the planning scene (does not alter the robot's position) to allow collision between hand and object. Otherwise, the robot would not be able to move after picking the object. |
demo/src/pick_place_task.cpp
Outdated
// Attaching the object to the hand and lifting the object while guaranteeing that it does not touch the | ||
// ground happens in the next four stages. |
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.
// Attaching the object to the hand and lifting the object while guaranteeing that it does not touch the | |
// ground happens in the next four stages. | |
// The next four stages attach the object to the hand and lift it while ensuring that it does not touch the ground. |
demo/src/pick_place_task.cpp
Outdated
@@ -153,7 +156,8 @@ void PickPlaceTask::init() { | |||
* Move to Pick * | |||
* * | |||
***************************************************/ | |||
{ // Move-to pre-grasp | |||
// Move to a pre-grasp pose. The Connect stage does not declare any movements but connects two stages that do. |
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.
// Move to a pre-grasp pose. The Connect stage does not declare any movements but connects two stages that do. | |
// Move to the pre-grasp pose. The Connect stage connects two other stages with a motion. |
Not perfectly happy with this, but it sounded too much like there's no robot motion going on in this stage
demo/src/pick_place_task.cpp
Outdated
@@ -290,6 +301,7 @@ void PickPlaceTask::init() { | |||
* * | |||
*****************************************************/ | |||
{ | |||
// Fourth, define the `move to place` (as the `move to pick`) stage as a Connect object. |
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.
// Fourth, define the `move to place` (as the `move to pick`) stage as a Connect object. | |
// Fourth, define the `move to place` stage as a Connect stage connecting the end of the pick to the start of the place phase (like the `move to pick` stage further up) |
Oh, and yes, an actual MTC tutorial page based on this example is certainly welcome. AFAIK there's no reason that it doesn't exist yet, except that no one has the time to write it. It would probably fit best on the current page. |
Thank you very much indeed, Felix, for your comments and your help. Your assistance made the PR much better and working on it very enjoyable. I will try to find a new moveit issue to work on (a |
Hello to all, I am working on the I think moving / duplicating the demo into the |
Hi @cpetersmeier - it is great to hear you are working on a tutorial for the MTC! I do not understand what you mean by saying:
However, if I were you, I would try to write a tutorial and select all the parts that you need for it as you see it fit. Please ping me if you have a PR ready - I am excited to read it! |
Dear @FabianSchuetze , @felixvd , I have created a first draft of an improved Moveit Task Constructor tutorial here. I would love some feedback from you that I could incorporate in the text! |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #238 +/- ##
==========================================
- Coverage 58.82% 57.31% -1.50%
==========================================
Files 91 131 +40
Lines 8623 10684 +2061
Branches 0 954 +954
==========================================
+ Hits 5072 6123 +1051
- Misses 3551 4514 +963
- Partials 0 47 +47 ☔ View full report in Codecov by Sentry. |
This PR attempts to embellish the pick-place demo by adding comments to several sections of the task construction.
I have been trying to understand the pick-place demo in the last few days and had benefited from a bit more verbose description. In particular, I did not comprehend how the
grasp_frame_transform
, specified in the panda config file, influence the outcome. I asked the same question on ros anwers but failed to garner an answer. @felixvd encouraged me via Discord to try to understand it myself and submit a PR with code comments.I do not know if my comments are helpful or whether the PR has the appropriate structure. If there is anything you think I can improve, I'd happily do that.