How to send value from Globel Tabel to Robot Motion Paths.

How to send value from Globel Tabel to Robot Motion Paths.

anutt_k
Not applicable
51 Views
2 Replies
Message 1 of 3

How to send value from Globel Tabel to Robot Motion Paths.

anutt_k
Not applicable

[ FlexSim 22.2.0 ]

Hello.

When I have some Globle Tabel for collect the value of Joint. How i can use the value in Tabel to create a Motion paths. Than So much for guid me.1661335742383.png

0 Likes
Accepted solutions (1)
52 Views
2 Replies
Replies (2)
Message 2 of 3

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

You can copy the values from the Global Table over into the robot's attribute tree with code. (Replace RobotName and PathName with the respective names)

Table pathtable = Model.find("RobotName>variables/pathtables/PathName/table");
for(int row = 1; row <= pathtable.numRows; row++)
{
    for(int col = 1; col <= 6; col++)
    {
        pathtable[row][col] = Table("GlobalTable1")[row][col];
    }
}

I assume you want to do this to change the paths of many robots at once (because otherwise I don't see a reason to not make the changes directly in the path GUI).

For this, another way would be to copy the entire 'pathtables' node from one robot on which you do the changes to all others. To reference the robots you could put them in a group together.

The following code would copy the path data from the first robot in the group "Robots" to all others in the same group.

treenode pathtable_first = Group("Robots")[1].find(">variables/pathtables");
for(int i = 2; i <= Group("Robots").length; i++)
{
    treenode pathtable_current = Group("Robots").find(">variables/pathtables");
    createcopy(pathtable_first, pathtable_current, 1, 0, 0, 1);
}
0 Likes
Message 3 of 3

anutt_k
Not applicable

Thank You! I'll try to implement your advice.

0 Likes