Jump to content

continuously export joint angles in the background


---
 Share

Recommended Posts

Hi,

 

i would like to continuously export the current positions of the kinematics used for measurement with Atos Q to another computer in the network in order to create a digital shadow of the system. The idea is that this export runs in the background while the Atos Q and Zeiss Inspect are used usually. 

Currently I am using the command:

gom.app.sys_automation_controller_current_position

However, as far as i know Zeiss Inspect is not thread-safe and this command can only be executed in the main thread. Because of this, I cannot access the joint positions from a background thread that handles the network communication.

My questions are:

1. Is there another way to access the Atos Q joint positions (e.g. via another API or interface)?
2. Is there a recommended workaround to continuously read these values without blocking the main thread?

Any suggestions or experience with similar setups would be greatly appreciated.

Thanks!

 

I am using Inspect 2025

Link to comment
Share on other sites

Hi Dominik,

I am not sure if this a viable solution, but you could try the following:

You set up an external Python interpreter which connects to ZEISS INSPECT via WebSocket interface and uses the GOM API to read the measured components' coordinates.

1. Start with the sections "Python installation" and "ZEISS INSPECT configuration" from Using Visual Studio Code as App editor — App Development Documentation

2. Set the environment variable `TOM_PYTHON_API_URL` to according to your ZEISS INSPECT configuration, e.g. in PowerShell

$env:TOM_PYTHON_API_URL = "ws://localhost:55000?0123456789ABCDEF"

(with your API port and key, of course)

3. Create a Python script which reads components' coordinates

Minimal example:

import gom

if __name__ == "__main__":

    while True:
        print(f"{gom.app.project.actual_elements['Bucket'].coordinate[0]}")
        time.sleep(0.1)

You should only read token values from ZEISS INSPECT (as in the example above) and not call any gom API commands to prevent resource conflicts. 

4. Run this Python script in your external Python interpreter

This Python interpreter must have the `zeiss-inspect-api` wheel installed (step 1). Its version must match your ZEISS INSPECT version, otherwise the `import gom` will fail.

The Python interpreter must be started where you set the environment variable (step 2).

Hope this helps!

Best regards,

Matthias

image.thumb.png.3fc14e6e0a2a96f6a9b3ea926f6afa86.png
 

Edited
Link to comment
Share on other sites

Caution!
Please note that reading multiple components' positions is done sequentially - it is not ensured that you get data of the same time frame.
To get at least an indication of the inherent delays, you can read the corresponding time information:

print(
f"""
{gom.app.project.actual_elements['Bucket'].coordinate[0]},
{gom.app.project.actual_elements['Bucket'].get ('stage.relative_time')},
{gom.app.project.actual_elements['Extension arm'].coordinate[0]},
{gom.app.project.actual_elements['Bucket'].get ('stage.relative_time')}
""")

Another idea is to use the `in-stage` accessor (see Working with stages — App Development Documentation), but I don't know if this works during a live measurement.

 

Edited
Link to comment
Share on other sites

 Share

×
×
  • Create New...