How to Pick and Place an Object with Custom 6-axis Robot using MoveIt and simulate in Gazebo

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi Robo assist uh today we're going to learn another method to make a pick and place application uh I know that we have already discussed about this topic in another video I'm going to put uh the link in the top right corner uh but I have seen that some of you had some problems in replicating uh with their robots and and so I decided to show you another method uh which in my opinion is more straightforward and we're going to use uh the move group interface for Grier as well and you're going to figure it out what I'm what I'm telling you in the upcoming um minutes so before to start make sure to subscribe uh to the channel if you like this kind of video and if you want to become a robotic software engineer don't forget to uh check uh my uh my course um as for the moment I have done uh only uh the course for beginner uh which I will say that is the first step to starting to start to uh make some practice with this kind uh of application where you are going to make your hand dirty uh in uh the uh robotics application in the real world or better in the industrial uh word um okay so uh that's all for this introduction and let's jump directly to the topic of today okay so uh what we have uh done uh in the last uh video where we dealt with pick and place is to create this pick and place application uh where uh basically uh what we had uh is composed by the the main section we add the Collision object and then uh we call this function H pick and place um which are described here um and then in each pick and place function we are calling the open gripper so um and the Clos gripper uh so um the key point to bear in mind is that with this method uh we are going to make an extensive use of uh this uh this mve it message called grasp uh which has uh a very uh very good structure in my opinion uh because it has already built in some function like uh grasp pose prasp approach and so on and so forth I already discussed about this topic in the last video so they want to make it make it again uh so uh before to start and the another uh method uh well just um just see let's let's see uh what is going on uh in in the simulation with the move it uh we can open the H demo launch uh file of the cobot movid configuration package so Ross loue cobot move it configuration okay this file is automatically generated when you are creating a move it setup uh assistant uh uh we already done this video but okay this here there is our uh our robots and then we are going to run the pick and place application that I have just shown you so Ross run I have built uh this code in this package here don't worry about that I'm going to provide uh the link uh in the description down below uh for my GitHub uh repository and so this is going to be pick and place uh node okay let's see what's happened and so here uh you can see that you have uh our uh our Collision object which is composed by um the the table uh to pick table table to place and the object where is uh is picked uh and then is placed in this uh position uh okay you can see that in uh if you use the grasp uh move it message uh the pick and place is very structured so you're going to have the pre pose the approaching and and then uh when uh is placed you have uh the function to to release and so it goes in for example in in this direction once that is uh released okay so uh this is an introduction of what we have already created and uh what you are going to do now is to create another uh another um CP C++ code uh step by step so let's uh let's create this one and call it pick and place simple do CPP okay uh I think that is better to have this uh as as a reference okay so let's start um well first of all this we can just copy and paste nothing new then uh for a good structure let's go to directly to the main okay so uh let's create the main section okay so here we can copy and paste so we can copy and paste also this one and the main difference here is that what we're going to do we're going to create another move group interface object uh that commands the hands or better the gripper that I remember you that is composed by the the the the two uh yeah the gripper right and the gripper left so uh I'm going to copy and paste I'm going to create so another object and I'm going to call it gripper gripper and this is referred to H the hand this is the name of uh the the the the group uh move it interface that we have set up in our uh move with the setup assistant um okay uh uh so um now what we are going to do is to um okay just uh create a pre grasp uh pick position so pre pick uh position and we are going to uh pass into it the H move group interface a group uh then we will wait uh 1 seconds uh then what we're going to do we are going to uh call the pick function R then let's wait another uh Second and then what we will need to do is to close the gripper and this time we are going to pass inside this function the object move group interface that we have created gripper and then let's wait again uh then once that the object will be uh picked so the goup are Clos we just need to bring our end factor to the place position so we're going to call another function which is place of course we are going to create all this function um here in a moment uh then let's Wait Another Second and then finally once that the end Factor has reached this position let's open the gripper and of course we need to pass the move group interface object called gripper that is referred to the group hands okay and then just uh wait for shutdown okay this is the structure uh of uh the main uh the main function and what we need to do H now is to H create this function the prep Peck uh the pick close gripper place and open gripper so basically we uh each function is representative of the position of where the end Factor uh needs to uh needs to uh achieve so let's start uh with the prep Peck uh position so um the function will be a void uh prep then the object that we will need to pass is uh uh has the structure of this object so it's going to be this one and then we are going to uh uh to call it uh move group what uh we need uh to do is to create a a geometry message pose um object and we are going to call it uh pick position or better prep Peck position then we are need to set up the orientation of uh the uh end factor and we're going to use the quaternion uh object now we're going to set up the angle in term of R pitch Y and set up the orientation here we are uh now we have set up the orientation we need to set up the position very easy so it's going to be prep pick position dot position where in x y and Zed so the position will be uh x one then I remember you that position will be y z but let's uh give it some clearance okay and then the H will be always the same 0.5 then we need to set the post Target so move group and we need to pass the pre pick position and finally before to finish this function we need to ask the object to move okay that's all um so if we follow the the main we need to create the pick uh which basically it's uh it will be very similar to the prep Peck at least it has the same structure so we can just copy and paste but now we're going to call pick and let's change the position also okay so now that uh the robot will be in position is ready to close the gripper and grasp the object so we need to create the close gripper function again here it has the same structure let's call this object move gripper and this will be very easy because we just need to H call the function or better the method set joint value Target so move gripper set joint value Target and then if you have intellisense you have uh different or or better R Snippets in the extension of your uh Visual Studio code you have a different way to call uh this to to give an input to this method uh we are going to use H this one so we are we will needed to have the string as the name of the joint joint which is going to be a gripper right joint and then uh the the value so let's do it and then the value for closing I remember that is going to be 0.55 okay and then we just need to ask to move okay then since that we are here we can and create our uh open gripper this will be the same with the exception that we need to adjust the the value uh I remember you that I'm going to uh control only the H grip right joint because it's a mimic gripper so the gripper left joint will move accordingly as a mirror okay so let's come back to the main and there's the place function to uh uh to to create uh but here it will be very similar to uh the pick we just need to change the orientation uh value in row uh pitch and Y angle and of course the position so um this will be the place then this will be move Group Place uh then let's just change this object and then let's call it Place position then uh the orientation here will be this one F to practice with the row pitch and yall so the place Position will be on y0 on x0 y1 and let's release slightly uh up uh upwards for the moment so and then we just needed to call the H move function belonging to the H move group interface um class okay I think that uh is everything just uh give it a try so first we will need to build the package and update the cake list nothing new I'm going to do it now okay uh let's see uh what is going on uh with the RVs let's run the uh application okay uh okay we have not created the Collision object we are going to do in a moment but as you can see this is the um pre Peck uh position where the um the uh end the factory is going to reach and then it's done he will go to the pick position done and then he will close the gripper done and then he will go to the place position that will be somewhere here and once uh that the position uh of place will be reached the gripper will open here we go the gripper has been opened and the application has been completed successfully okay so uh for for B to avoid any collision with the real world let's uh create uh our uh Collision object so we are sure that the robot will not Collide the T the peak table and the place ER table so the um the planning uh will be uh done accordingly okay okay here we are so in this case uh we don't need uh to have the the object because uh of course it will need to collide with the object that needs to be picked uh and uh okay let's build the package and test it again okay now you can see that the table of picking and the table of placing now is correctly show up in the uh RVs let's see the behavior and it should not change okay the um Place position is reached correctly and we don't have any Collision here as you can see and the gripper release uh uh accordingly and now we can test in the real world so uh how to do that uh we can uh test in in gazebo so uh what we can do now is to test uh this application in a simulated environment in gazebo where um we uh pass the uh robot urdf file uh the word we are spawned our controller in the real world uh and but but I we have already uh done this launch file uh when we have interfaced move it um with uh gazebo so uh at the moment nothing new okay we have gazebo that is running parall with uh move it uh plug-in in our Vis so uh now what we need to do is to run our pick and place application uh with a simple method what we have just coded okay the robot is approaching to the pre picking po position uh I remember you that for all the joint we are going to have a position controller follow joint trajectory uh controller and for the gripper we are going to have eort controller uh follow joint trajectory uh controller so the end Factor has reached the pre picking position then is go going to grasp the object then the gripper is closing the object is correctly picked and we have used the grasp um fix a plugin for gazebo uh we have done another video for that and now you can see that the robot is going to the place position with the object attached to the gripper as we want okay you can see that the robot is approaching the place position in the position where we have a set up in the pick and place code okay it's reached and now the gripper are opened correctly and the application has finished okay uh that's all uh for today I hope that you enjoyed this video uh I hope hope that this content will be uh useful for you and solve uh some issue that you made you you might fac uh using the move it message grasp uh class uh don't worry uh I'm going to provide all the code in another repository that I will create for this video and I'm going to provide the link in the description down below if uh this video added value to your robotics software uh Journey let me know in the comments uh down below and make sure to subscribe to the channel and hit the notification Bell and see you in the next video and as always keep learning robotics withraw
Info
Channel: Learn robotics with ROS
Views: 931
Rating: undefined out of 5
Keywords: robotics, ros, learn robotics with ros, python, c++, technology, robot operating system, ubuntu, noetic, node, coding, learning ROS, engineering, computer science, learn robotics, robot, high-tech, programming, ros launch file, gazebo, simulation, 3D visualization, 3D simulation, urdf, UR5, ROS cotrol, 6 axis robot, rqt_gui, Forward Kinematics, automation, manufacturing, industry, pick and place, path planning, Flexible Collision Library, MoveIt, Allowed Collision Matrix, Pick and Place
Id: VbKAoNiLCYI
Channel Id: undefined
Length: 31min 25sec (1885 seconds)
Published: Wed Apr 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.