How can I obtain the coordinates of the tool currently used by the robot in real time?
Why does my use of the getSelectedRobotsData() method cause severe lag when the robot runs the program?
Firstly, after reviewing and testing getSelectedRobotsData, it can be seen that it should fetch a static data, which means that every time it is used, it resets the robot state and fetches the data at the first state.
If you want to get the TOOL_NAME of the current segment on the run, you can check the four events of vcExecutor in the help file, they mean triggered when the running segment is transformed, from which you can choose the triggering method you need, and then, look at the CurrentStatement function in vcExecutor, it’s You can use “robot_exe.CurrentStatement.Tool.Name” (robot_exe gets it from “findBehaviour(‘Executor’)”) to get the name of the tool used by the current statement. The name of the tool currently used by the ordinance.
The tool coordinate information currently used by the robot has been obtained. Thank you very much!