Cancel
Showing results for 
Search instead for 
Did you mean: 

Index error when using a custom simulation object that derives from store

Experimenter
Experimenter

Hello everyone

 

I am using a PickAndPlace robot to put tires from a conveyor on a pallet.

The pallet is a custom simulation object which derives from the store object.

 

The problem I have is that I cannot tell the PickAndPlace robot to put the tire on a specific place in the store.

I always get an error saying that i can use indices only on lists, arrays and objects with a capacity with more than 1.

 

This is where i get the error inside the method where i set the robot's target.

?.setDestination(root.palletA[1,1]);

 

It works fine when I use a store object. But with my custom simulation object which derives from the store it doesn't work.

 

Hope you can help me.

 

Greetings Johnny Camenzind

7 REPLIES

Re: Index error when using a custom simulation object that derives from store

Phenom
Phenom
I assume the pallet is a MU therefore cannot be directly placed in /the ( root) frame.

so the question to you:

on which object in your Frame is the pallet located on ?

Furthermore I am not quite sure if you can directly place a mu via ?.setdestination on a mu (=pallet) which is located on

another object.

Re: Index error when using a custom simulation object that derives from store

Experimenter
Experimenter

Hello simulator

 

Thanks for your fast reply.

 

No it's not an MU, it's a custom simulation object.

I created it according to the Plant Simulation help page (Step-by-Step Help > Modeling in the 3D Viewer > Creating an Animatable Object > Create the Required Simulation Object)

 

Since it's a simulation object I can place it anywhere (like a conveyor or a pick and place robot).

The only difference is that it's not a built in simulation object.

It's custom and based on the Store object.

 

Greetings Johnny

Re: Index error when using a custom simulation object that derives from store

Phenom
Phenom

o.k.

 

to make things easier to understand could you please post a copy of your model.

Re: Index error when using a custom simulation object that derives from store

Experimenter
Experimenter

I added the model to the attachements.

Be aware that the palletizing process starts as soon as a stock contains more than 50 tires.

 

In the model I am currently using a pallet is based on a PickAndPlace robot.

This is because at first I thought that the PickAndPlace robot is the only simulation object where the exact positions for each MU can be specified.

 

You see my goal is to get the robot to move its arm exactly to the position where the tires will be placed on the pallet.

The problem with using a PickAndPlace as the base is that my palletizer robot isn't moving to the exact position where the tires should be placed.

 

Thanks in advance! Smiley Happy

 

Re: Index error when using a custom simulation object that derives from store

Phenom
Phenom
I had a first look at your model:

what I noticed is the following:

an object "palletA" does not exist in the Plant Frame -> probably should be "pallet1A..2B

The pallet1A ( root object = pallet_old) object is a frame with a P&P Robot object inside but not a store or something similiar

Again I am not sure, that the p&p Robot can dump a part on an object , rapped in a Frame.

Let me know your ideas






Re: Index error when using a custom simulation object that derives from store

Experimenter
Experimenter

Oh yes I'm sorry the code should ofcourse refer to pallet1a.

The model is maybe a little bit confusing since I tried a few things and didn't propperly cleanup before i sent it to you.

 

I made a new simple model which should make my question a little bit more clear.

In this model I can tell the P&P exactly where to place the elements by configuring the MU animations on the store.

 

Now how could I do something like that in my model with the tires?

The P&P should move the tires exactly to the position where they appear on the pallet.

 

I hope you can now better understand my question.

 

Thank you for your time Smiley Happy

Re: Index error when using a custom simulation object that derives from store

Phenom
Phenom

There is a sort of work around by using the store as a template

 

for placing the Mus and then copying the mus from the store to the pallet,

 

when the store is full. (s. attachment)

 

There are ways of letting PSI do exactly what you have in mind.

 

I'll get back to you as soon as I have a solution.