Trigger when kinematics is added in Object kinematics and obtain its info?

Trigger when kinematics is added in Object kinematics and obtain its info?

jouky_d
Not applicable
38 Views
9 Replies
Message 1 of 10

Trigger when kinematics is added in Object kinematics and obtain its info?

jouky_d
Not applicable

[ FlexSim 23.1.2 ]

Hello everyone,

After @Felix Möhlmann answered me this question (AGV: How to trigger when kinematics is added): https://answers.flexsim.com/questions/148025/agv-how-to-trigger-when-kinematics-is-added.html.

I was searching a similar thing for an object kinematics. However, I can't obtain or see the kinematics information as in the AGV: acc1, acc2, peakSpeed, peakTime, time, etc.

Is there a way to obtain it if the kinematics needed is not from AGV?

Thank you.

0 Likes
Accepted solutions (1)
39 Views
9 Replies
Replies (9)
Message 2 of 10

jouky_d
Not applicable

On the previous question (AGV), the trigger is activated when a message with a parameter is received by the AGV when a kinematics is added (AGVNetwork > customizationDelegate > addKinematics > edit the code to send a message to the AGV). And when it activates, we use commands as:

double totalDistMove = getkinematics(kinematics, KINEMATIC_TOTALDIST, 1);

double startTimeMove = getkinematics(kinematics, KINEMATIC_STARTTIME, 1);

double endTimeMove = getkinematics(kinematics, KINEMATIC_ENDTIME, 1);

double peakSpeedMove = getkinematics(kinematics, KINEMATIC_PEAKSPEED, 1);

double peakTimeMove = getkinematics(kinematics, KINEMATIC_PEAKTIME, 1) + startTimeMove;

double acc = getkinematics(kinematics, KINEMATIC_ACC1, 1);

double dec = getkinematics(kinematics, KINEMATIC_ACC2, 1);

However, if we use the Create kinematics, Travel with kinematics and finish kinematics with a normal 3D Object, I cannot see where are all of these options on the treenode and how do I call them.

0 Likes
Message 3 of 10

joerg_vogel_HsH
Mentor
Mentor

@Jouky D, "kinematics" is a node reference. There you find the data!

0 Likes
Message 4 of 10

jouky_d
Not applicable
I stopped the simulation when the Apply Kinematics is running, however, there are not information about it on the node Object. Do you have an example image to see it and how do you call it on flexscript?
0 Likes
Message 5 of 10

moehlmann_fe
Observer
Observer
Accepted solution

You can react to tokens entering the "Apply Kinematics" activity, since that is when the kinematic is added. (Place a "Breathe" after the source so the kinematics are added before you try to do anything else)

capture2.png

You specify where the kinematic data is stored in the activities (by default in a label "kinematics" on the token), so that is where you can read the information from using getkinematics().

capture1.png

0 Likes
Message 6 of 10

jouky_d
Not applicable

Thank you for your response! However, if I have to apply it onto 50 Apply Kinematics (because of different instances), it means a problem building that because I cannot put all the Apply kinematics into a new group and apply the trigger Source to that "Apply Kinematic's group".


Maybe FlexSim internally knows the same kinematics information as AGV's case but we cannot call it?

0 Likes
Message 7 of 10

moehlmann_fe
Observer
Observer

You can do exactly that, though?

capture1.png

0 Likes
Message 8 of 10

jouky_d
Not applicable
Yep, I didn't know that! Thank you Felix!
0 Likes
Message 9 of 10

jason_lightfootVL7B4
Autodesk
Autodesk

Or maybe you should be using Object Process Flows with 50 member instances and then you sample just the one activity.

0 Likes
Message 10 of 10

jouky_d
Not applicable
Yes! Thank you Jason!
0 Likes