i dont like to be negative, so i thought i would try and add something constructive.
what is the gripper for? by this i mean does it have a purpose? if so is it picking up one object of fixed size only,or is it for picking up objects of differing size?
is that the final prototype of the gripper design? or just a test bed?
I know little of engineering as such but i am a scientist by training and have many experiments under my belt, i mention this because there is often detail lacking in your posts. Detail is everything in experiments and prototypes, for example if your gripper is only picking up a fixed sized object then the solution to the problem is very simple.....you just adjust the angle that the servo needs to travel too. if its going to be picking up different sized objects then you need to use something like current sensing to stop once the grip is enough to hold but no more than that.
Also it needs to operate a little slower in my opinion unless speed of grip matters alot. simply because it will grasp better if you slow down the speed of closure, at the moment it just grabs full speed and the object jumps a little, with a slower speed you can have more control with the current sensing.
Slowing down the speed is easy you just move a fraction......small delay move a little more.....small delay and so on until you reach final position, we are not talking creeping kind of slow but more a steady controlled closure instead of a rapid grab.
fix the gripper so it doesn't fall apart!! what exactly is it for picking up anyway? if it's tubs like on the video then in my opinion the gripper needs to be thicker at the ends and maybe have some kind of rubber lining to improve grip.
you need to post much more detail rather than just ask for code, people are really trying to help you but you are not making it easy, mistakes in advice happen because you cant be bothered to outline properly the object you wish to achieve.
the way it stands at the moment it's getting very close to a situation like the LED sign, where you are given a task i assume being paid for? then come here and get the solution and dev work done for free. that is a little unfair, asking for help is no problem, but you need to show you are the one doing the work.
you are being given heaps of help but showing little progress in learning so time to ask yourself if this kind of work is for you. if its just fun projects for the sake of learning then read the replies more carefully and take time to understand what you are being told. and if its paid work your doing then give up until you at least have the minimum basic equipment to be able to develop the products you are asked too.
just a few thoughts and ideas not having a go at you but i am concerned that your current attitude will affect others ability to get help in the future. please think about this.
so lets see how much you read, please answer the questions i have asked and also list the equipment you have for development
best regards
Jason