How I pick up components

Hi! I am modeling a process station and I want the claw to pick up the part. Movements are done via PythonScript.
Any suggestions on how to do this?

Detect the part with sensor and component signal or grab it from from the container where it is.
Then grab the part on to the Component Container of the gripper.
When you move to the conveyor you grab the part into the path behaviour of conveyor.

Hello @Unnahi! Thanks for the help.

I created sensor, and ComponentSignal, but it can’t detect the piece by PythonScript. I tried several things, but I don’t know where I did something wrong… Anyone can look my layout and help me?

The sensor you chose only detects components on the path it’s attached to and since it isn’t attached to any path it won’t detect anything. Furthermore the path is on you conveyor component so it wouldn’t work anyway using that behaviour.

What you could do is getting a reference to the SensorComponentSignal behaviour of the Conveyor Sensor component.

conv_sensor = app.findComponent("Conveyor Sensor")
comp_signal = conv_sensor.findBehaviour("SensorComponentSignal")
part  = comp_signal.Value

Also the origin of those products was way off in my case so I would look into that as well.

Hi @barismungan! Thanks for the help! The product origin was really crazy, I already fixed this.
I can’t use reference from other components because this Conveyour is just for tests. The intention will be the component be attached with other stations or a Conveyour, the user will select which component will use.
I will try to use different sensor (volume Sensor) or some way to use your instruction. Thanks again.

You could use the raycast sensor to detect components at specific points. If you have problems detecting components (I had this issue) create a component specifically for the raycast sensor and then reference that component if you can.
Otherwise I would if possible attach a conveyor to your component with a path and connect that path with the chosen conveyor so that you only have to sense components on that path.