I am working on a custom made Robot made by a set of entities. I am trying to evaluate its Center of Gravity and Zero Moment Point for which i need Center of Gravity of every entity and then apply General Rule for Center of Gravity:
(X-coordinate of Center of Gravity of Body)*(Total Mass of Body)
(X-coordinate of center of gravity of entity 1)(mass of entity 1) +...+ (X-coordinate of center of gravity of entity n)(mass of entity n)
(Same goes for other coordinates of the Center of Gravity) but for that i need GPS sensors notifying position of Centers of Gravity of every entity and a way to incorporate all of them in the above calculation performed in the "Calculate" block. But the problem is that as i try to "Join" values from different instances of GPS Sensors, following error pops up: "The Join is connected to independent data sources. It will never complete. Try revising your connections." (Attached is the image of the VPL Diagram). https://docs.google.com/file/d/0B2w3mmBOvQsIWHBiR2NvUmxHUnc/edit?usp=sharing Someone please help me out.
The problem
Because VPL cannot know the expected data rate for the two data sources, and the join will only fire when there are items on all branches (and then consumes the items) there are two problems, one is that it may never fire, the other is that the data may be out of sync (imagine if the two data sources fire at 1Hz and 2Hz, the first element on each branch of the join will drift apart in time)
A solution
In your diagram use the data sources to set variables with their values (which it appears that you already do)
Use one of the data sources (or some other periodic notification) to trigger the computation using the most recent values that have been set into the state. While you may not always have the most recent data, it will always be fairly recent
Alternatively, you can put a merge where you currently have the join, and use a notification on either data source to trigger the computation (again, using the most recent values that have been set into the state)