How to read values from external python script

Maybe you could use socket communication?

I attach couple of test models which demo TCP and UDP socket communications. In both layouts blue robot is the master. There are two box components (client and server) with python scripts. One box reads blue robot’s joint values and sends them with a socket to the other box component. This reads the values and sets them in the white robot so that it follows the blue robot.

Here you have two scripts communicating inside VC model but the other python script could be external and it should work the same.

-k

SocketTest_TCP.vcmx (588 KB)

SocketTest_UDP.vcmx (558 KB)

3 Likes