Hello everyone,
Is there a way in FlexScript to obtain the current acceleration of an AGV? I want to know if it's accelerating, decelerating, in regime state, or idle.
Thank you!
Hello everyone,
Is there a way in FlexScript to obtain the current acceleration of an AGV? I want to know if it's accelerating, decelerating, in regime state, or idle.
Thank you!
You can iterate through the AGV's kinematics until you find the one that is currently active based on the start and end times of the kinematics.
You then further compare the current model time to the timespans the AGV spends accelerating in that kinematic. If you find that the AGV is currently accelerating, you can get the used acceleration value from the kinematic as well.
double curAccel = 0;
Object agvObj = Model.find("TaskExecuter1"); // As an example AGV agv = AGV(agvObj); treenode kinematics = agv.kinematics; int rank = 1; int numKinematics = getkinematics(kinematics, KINEMATIC_NR); while(rank <= numKinematics) { double kinEndTime = getkinematics(kinematics, KINEMATIC_ENDTIME, rank); double kinStartTime = getkinematics(kinematics, KINEMATIC_STARTTIME, rank); if(kinEndTime >= Model.time && kinStartTime <= Model.time) { double accTime1 = getkinematics(kinematics, KINEMATIC_ACC1TIME, rank); if(Model.time < kinStartTime + accTime1) { curAccel = getkinematics(kinematics, KINEMATIC_ACC1, rank); break; } double accTime2 = getkinematics(kinematics, KINEMATIC_ACC2TIME, rank); if(Model.time > kinEndTime - accTime2) { curAccel = getkinematics(kinematics, KINEMATIC_ACC2, rank); break; } } rank++; } return curAccel;
Thank you for your answer @Felix Möhlmann ! I saw there was a "acceleration" state. However, the AGV never is on that state and my trigger doesn't activate. Do you know why? Or another way to activate a ProcessFlow when the AGV starts accelerating or decelerating? (I accept your answer, however I still have this problem :( ).
The "accelerate" state is not used by task executers (I can't actually tell you any object that does).
There is no event associated with the AGV starting to accelerate. You would have to extract those times from the kinematics node as is done in the code above. New kinematics are generally added when an AGV allocates the next control point (or fails to do so). So if you react to those events, you should be able to extract all accelation times from the kinematics. (As long as you don't use accumulation behaviour, then you would also have to react to events corresponding to that).
16 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved