Robot won't pick up part & continually goes up and down

Hey all not sure what I am doing wrong, wrote some code to do a simple pick up but cannot seem to get the product to be picked up can anyone assist or explain why this may happen.


Thanks

If the robot is moving up and down, then probably it’s just looping the JointMoveToComponent and moveAway commands. You need to figure out why the graspComponent method fails. It could be that there is no component with the name “Assembly1”. Try printing the part, and see if it is None.

In general, I don’t think it’s a good idea to use the findComponent for grasping parts, since there could be multiple dynamic components with the name “Assembly1” and in this case, the robot does not know which instance it should pick up.

Like previously mentioned, most likely a looping issue if you are relying on the signal value since that might change from true to false several times when component is moving through sensor. Try printing vcSimulation.SimTime to check that.

Having a component name as “Assembly1” sounds complicated. If you are trying to pick an assembly, I think the ActionScript has a template or example on how to do this better. If you need to do something quick then using bound box info is one approach to get the right visual. However, there is probably a much better way to pick and place assemblies or specific slots via API.