Drive two joints simultaneously

Hi,

I’m currently working on a cartesian robot with a end of arm tool which has two grippers, each controlled by a separate servo controller. I can drive the two grippers independently. However, I’m trying to model a sequence where the two grippers need to be driven simultaneously.

My program currently can only drive one joint after the other because python executes each function in order. I want the joints to be driven at the same time, as well as the grab/release action. Can someone help me?

Thanks in advance,
Thom

nb: I tried using multithreading / multiprocessing in python but the program crashes each time i run the simulation.

Maybe use two Python scripts, each driving its own servo controller, and communicate between the scripts with e.g. signals.

Hi Thom,

I know 2 options to do this in a single python script that works for me

  • Assign the 2 link joints to a single servocontroller behaviour. Make sure you remember which link you assign first in your controller.
  • in Python:

servo = comp.getBehaviour(‘ServoController’)
servo.move(gripper1, gripper2) → the order of which gripper mentioned in python is the same order from the servo controller

This way both grippers can work at the same time and can work independent if needed.

The second way is:

  • assign 1 link joint to a servocontroller (gripper 1)
  • Use the Joint name for gripper one in the expression Joint box for Gripper 2.

Do your magic in python with controlling gripper 1 and voila! This way gripper 2 will always exactly behave like gripper 1.

I hope this helps!

1 Like

Arjan,

I have actually already tried your first method. However when I do that gripper1 is able to grab/release but gripper2 is not. I do not quite get why this is happening, do you have an idea?

As for your second method, I do not quite understand what you mean with “Use the Joint name for gripper one in the expression Joint box for Gripper 2.”

Thom

Hi Thom,

sorry for the confusing explanation, I made a quick model where I grab 2 parts with 2 grippers.

I mean that you use Translational followers in your link if they all have to behave the same. Take a look in the model where gripper 2 is controlled bij gripper1.

Hope this works for you

Conveyor with 2 grippers.vcmx (238.1 KB)

Thanks, this has helped me a lot