question

Arun Kr avatar image
0 Likes"
Arun Kr asked Joerg Vogel commented

Not Able To Detach Trailer After AGV Custom Travel Activity

Hi Support,

I am not able to detach the trailer from the driver after the agv custom travel before the driver goes back to the home location using the normal travel activity.

Also attaching the sample model for reference. agv1.fsm

Regards,

Arun KR

FlexSim 20.1.3
agvflexsim 20.1.3
1595422411517.png (80.4 KiB)
agv1.fsm (36.0 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel commented

After you have detached a trailer, you must move the object into another container like the model.

following custom code activity source code.

treenode item = token.item;
Object itemObj = item;
treenode traveler = Model.find("TaskExecuter1");
Object travelerObj = traveler;
Vec3 curLoc =itemObj.location.project(traveler,model())
transfernode(item,model());
itemObj.location = curLoc;
· 3
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

attached modified file:

agv1_AK_JV.fsm


0 Likes 0 ·
agv1-ak-jv.fsm (37.6 KiB)
Arun Kr avatar image Arun Kr commented ·

Thanks for the quick reply and it's working.

But if we have the item first placed on the model, then perform an attach followed by a detach. The item will be placed on the new location as per the trailer's offset position. How is the item transfer taking place in this case, without using the above-mentioned custom code? Is this a bug? Pls, see the attached model.

agv1.fsm

Regards,

Arun KR


0 Likes 0 ·
agv1.fsm (38.9 KiB)
Joerg Vogel avatar image Joerg Vogel Arun Kr commented ·

It is more a matter of the container for the item. In your second example the attached item stays as a subnode at the control point 3. While you inserts the item inside a taskexecuter, the items stays as a subnode at the taskexecuter. The detach method has got parts included which keeps the current location in model and project it to the current container. If you want to check the behavior yourself, look into the tree where the item is a subnode of.

2 Likes 2 ·