Pick plan tutorial - #182
Conversation
…t_tutorials into pick_plan_tutorial
|
Include descriptions with your PR's |
davetcoleman
left a comment
There was a problem hiding this comment.
This is such an awesome tutorial, thanks!
| Pick and Place Tutorial | ||
| ============================ | ||
|
|
||
| In MoveIt!, grasping is done using the move group interface. In order to grasp an object we need to create ``moveit_msgs::Grasp`` msg which will allow defining the various poses and postures involved in a grasping operation. |
|
|
||
| <div style="position: relative; padding-bottom: 5%; height: 0; overflow: hidden; max-width: 100%; height: auto;"> | ||
| <iframe width="700px" height="400px" src="https://www.youtube.com/embed/cHxkQwSyrgY?rel=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> | ||
| </div> |
|
|
||
| Running The Demo | ||
| ---------------- | ||
| Open two shells. In the first shell start RViz and wait for everything to finish loading: :: |
| * POSSIBILITY OF SUCH DAMAGE. | ||
| *********************************************************************/ | ||
|
|
||
| /* Author: Ioan Sucan */ |
There was a problem hiding this comment.
You must keep the BSD license! Add your name next to Ioan
mlautman
left a comment
There was a problem hiding this comment.
This is really good! I'm excited about this
|
|
||
| .. raw:: html | ||
|
|
||
| <div style="position: relative; padding-bottom: 5%; height: 0; overflow: hidden; max-width: 100%; height: auto;"> |
|
|
||
| In the second shell run the pick and place tutorial: :: | ||
|
|
||
| rosrun moveit_tutorials pick_place_tutotrial |
There was a problem hiding this comment.
You need a roslaunch for this
There was a problem hiding this comment.
i had initially created a launch but the problem is that we need to wait for everything to load before running this node.
So this seemed better than a hacky launch
| @@ -1,244 +1,215 @@ | |||
| /********************************************************************* | |||
| co.primitive_poses[0].position.y = -0.7; | ||
| co.primitive_poses[0].position.z = 0.5; | ||
| pub_co.publish(co); | ||
| // BEGIN_SUB_TUTORIAL table1 |
There was a problem hiding this comment.
This should be in it's own method not main
|
|
||
| collision_objects[0].operation = collision_objects[0].ADD; | ||
|
|
||
| // BEGIN_SUB_TUTORIAL table2 |
There was a problem hiding this comment.
Are you suggesting that the collision objects addition to be done in separate functions?
| doc/visualizing_collisions/visualizing_collisions_tutorial | ||
| doc/time_parameterization/time_parameterization_tutorial | ||
| doc/planning_with_approximated_constraint_manifolds/planning_with_approximated_constraint_manifolds_tutorial | ||
| doc/pick_place/pick_place_tutorial |
There was a problem hiding this comment.
This makes me really happy :)
| // END_SUB_TUTORIAL | ||
| } | ||
|
|
||
| void place(moveit::planning_interface::MoveGroupInterface& group) |
There was a problem hiding this comment.
When I run locally place fails with "All supplied place locations failed. Retrying last location in verbose mode."
There was a problem hiding this comment.
It happens here also rarely. I am guessing its because there is only one grasp given and it only tries to plan once.
There was a problem hiding this comment.
Add a comment that the "All supplied place locations failed. Retrying last location in verbose mode." error is a known issue with a TODO to fix.
There was a problem hiding this comment.
Would generating multiple grasps fix this?
|
|
||
| Understanding ``moveit_msgs::Grasp`` | ||
| ------------------------------------ | ||
| For complete documentation refer to `this. <http://docs.ros.org/kinetic/api/moveit_msgs/html/msg/Grasp.html>`_ |
There was a problem hiding this comment.
Replace this with moveit_msgs/Grasp.msg
| // Setting the grasp pose | ||
| grasps[0].grasp_pose.header.frame_id = "panda_link0"; | ||
| grasps[0].grasp_pose.pose.orientation = | ||
| tf::createQuaternionMsgFromRollPitchYaw(-1.5707963267948966, -0.7853981633974483, -1.5707963267948966); |
| grasps[0].grasp_pose.pose.orientation = | ||
| tf::createQuaternionMsgFromRollPitchYaw(-1.5707963267948966, -0.7853981633974483, -1.5707963267948966); | ||
| // This is the pose of panda_link8. | ||
| // From panda_link8 to the palm of the eef the distance is 0.058, the cube starts 0.01 before 5.0 (half of the length |
|
|
||
| // Setting the place location pose. | ||
| loc[0].place_pose.header.frame_id = "panda_link0"; | ||
| loc[0].place_pose.pose.orientation = tf::createQuaternionMsgFromRollPitchYaw(0, 0, 1.5707963267948966); |
|
|
||
| // Setting the pre_place_approach with direction as -ve z-axis. | ||
| loc[0].pre_place_approach.direction.vector.z = -1.0; | ||
| loc[0].pre_place_approach.direction.header.frame_id = "panda_link0"; |
There was a problem hiding this comment.
Should frame_id be moved to one line above to keep it consistent with others?
|
@Ridhwanluthra Ping us when this is ready for another review |
* making sections for better explaination * using M_PI * separate function for adding collision objects * using /**/ comments to not break flow * other minor fixes
|
@mlautman could you please review this again. |
| /* This is the pose of panda_link8. */ | ||
| /* From panda_link8 to the palm of the eef the distance is 0.058, the cube starts 0.01 before 5.0 (half of the length */ | ||
| /* of the cube). */ | ||
| /* Therfore, the posotion for panda_link8 = 5 - (length of cube/2 - distance b/w panda_link8 and palm of eef - some */ |
There was a problem hiding this comment.
position
You should use a spell checker to catch typos like this.
| // END_SUB_TUTORIAL | ||
| } | ||
|
|
||
| void place(moveit::planning_interface::MoveGroupInterface& group) |
There was a problem hiding this comment.
Add a comment that the "All supplied place locations failed. Retrying last location in verbose mode." error is a known issue with a TODO to fix.
mlautman
left a comment
There was a problem hiding this comment.
+1 after addressing my two additional comments
Great job!
fc6cad9 to
8665f8c
Compare
| // ^^^^^^^^^^^^^^ | ||
| // CALL_SUB_TUTORIAL place | ||
| // END_TUTORIAL No newline at end of file | ||
| // END_TUTORIAL |
| /* of the cube). */ | ||
| /* Therefore, the position for panda_link8 = 5 - (length of cube/2 - distance b/w panda_link8 and palm of eef - some | ||
| */ | ||
| /* extra padding) */ |
There was a problem hiding this comment.
these comments have weird line breaks. please cleanup and consider just using //
| void place(moveit::planning_interface::MoveGroupInterface& group) | ||
| { | ||
| // BEGIN_SUB_TUTORIAL place | ||
| // Note(TODO) - Calling place function may lead to "All supplied place locations failed. Retrying last location in |
There was a problem hiding this comment.
todo format is:
// TODO(githubname): blah...
per GStyle C++
| // Note(TODO) - Calling place function may lead to "All supplied place locations failed. Retrying last location in | ||
| // verbose mode." This is a known issue and we are working on fixing it. | ||
| // Create a vector of placings to be attempted, currently only creating single place location. | ||
| std::vector<moveit_msgs::PlaceLocation> loc; |
There was a problem hiding this comment.
better var name: loc -> "place_location"
|
|
||
| // Setting posture of eef after placing object | ||
| // +++++++++++++++++++++++++++++++++++++++++++ | ||
| /* similar to the pick case */ |
|
|
||
| collision_objects[0].operation = collision_objects[0].ADD; | ||
|
|
||
| // BEGIN_SUB_TUTORIAL table2 |
| // wait a bit for ros things to initialize | ||
| addCollisionObjects(planning_scene_interface); | ||
|
|
||
| // wait a bit for ROS things to initialize |
| The entire code can be seen :codedir:`here <pick_place>` in the moveit_tutorials GitHub project. | ||
|
|
||
| .. tutorial-formatter:: ./src/pick_place_tutorial.cpp No newline at end of file | ||
| .. |br| raw:: html |
There was a problem hiding this comment.
Is this just for a line break? Seems like overkill
There was a problem hiding this comment.
I couldn't find a better way to do this and it looks real shabby without it.
|
Congrats @Ridhwanluthra! |
No description provided.