Picking part from conveyor with random position

Hi

I have some issue which I have been trying to get solution. I have parts coming at random position from conveyor and now I would need to pick those up with robot and even possibly know the part rotation in Z axis (it is turned at random direction in conveyor). Is this possible without using python at all?

Hi,

don’t know what you’d like to do after picking up, but until that point you can use the Pick And Place library. Supports articulated robot as well as the delta in this tutorial:

http://academy.visualcomponents.com/lessons/use-a-delta-robot-with-the-pick-and-place-library/

Getting the rotation around Z axis can be accomplished only via the APIs.

Try out that pick and place library first!

I tried that, but it did not do what I wanted so I went ahead and started controlling robot with python. I guess this will be “easiest” way to do it.

So I got second issue as I have now set up second robot (cartesian) which suppose to pick and place parts as pattern on pallet and I used the example code provided by site. Now however I have issue as I have other robot output connected to cartesian input (to input port 2) and I should read this status in Python, but can’t get it to work for some reason. The code is as follows:

 

Is <<Inputs_Port_0>> a signal connected to the script? If no, it is not a trigger in the script.

In Python API reference for vcHelpers.Robot, I believe there is a method that can be used to wait for a robot input of a certain value.

I have inputs of the mentioned cartesian robot connected to pythonsript (listener) and I tried different code this time robot.SignalMapIn.input(0) actually prints the curent value that is on the mentioned port (true or false depending what I set in beginning of simulation, but it still won’t work at trigger condition for some reason. I think it is already getting close, but there must be something that prevents the trigger event to happen

Because the input is not a trigger and listener is not the same thing as a connection.

vcBooleanSignalMap has an event that can be used to listen for port value change. vcHelpers.Robot does have a method that allows you to wait for an input port connected to a signal to have a defined value, and it is the same as using a Wait Binary Input Statement in robot program.

A signal has a Connections property. And your script needs to be listed as a connection of that signal in order for the signal to be a trigger in the script. An input port is not a signal. So the expression in your triggerCondition returns a false value.

You have a few options.

Option 1 - Script behavior is added as connection to the signal connected to the input port, and then that signal is used as trigger NOT the port.

Option 2 - Refactor and use vcBooleanSignalMap event to listen for port value change.

Option 3 - Refactor and use the vcHelpers.Robot object to call the wait() method.

Option 4 - Refactor and create a loop that checks the value of the signal connected to the input port at a certain hertz, thereby delaying the script.

Personally, I would do option 3. I think there is a tutorial in academy that shows how to do option 2, but I don’t remember the lesson offhand.

请问可以将模型上传吗?我也有同样的需求,想学习一下

Could you please upload and share your completed model?I also have the same needs (single axis), want to refer to learn.Thank you!