CoppeliaSim zmqRemoteApi Python client
Python client for the zmqRemoteApi, protocol verison 2 (note: starting from pip package version 2.x, the major version number (e.g. 2) matches with the protocol version used by CoppeliaSim).
Installing:
python3 -m pip install coppeliasim-zmqremoteapi-client
Usage
from coppeliasim_zmqremoteapi_client import *
# create a client to connect to zmqRemoteApi server:
# (creation arguments can specify different host/port,
# defaults are host='localhost', port=23000)
client = RemoteAPIClient()
# get a remote object:
sim = client.require('sim')
# call API function:
h = sim.getObject('/Floor')
print(h)
There is also an asyncio version of the client. Normal asyncio principles apply, and all methods are async:
from coppeliasim_zmqremoteapi_client.asyncio import *
client = RemoteAPIClient()
async def main():
async with RemoteAPIClient() as client:
sim = await client.require('sim')
h = await sim.getObject('/Floor')
print(h)
asyncio.run(main())
on Windows, if it doesn't work properly, before calling asyncio.run(...) call:
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
A note about performance of sequential requests: if performing many commands in one shot, and results will be used later, consider using asyncio.gather for improved throughput.
E.g. getting the handles of 100 objects:
handles = await asyncio.gather(*[sim.getObject(f'/Object{i+1}') for i in range(100)])
Also check out the examples in clients/python.
Release files for coppeliasim-zmqremoteapi-client 2.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| coppeliasim_zmqremoteapi_client-2.0.4.tar.gz | 12.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:21.9 kB
Release files / coppeliasim_zmqremoteapi_client-2.0.4.tar.gz
| Download URL | coppeliasim_zmqremoteapi_client-2.0.4.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a97cfe1510e1a41cdabe829efb6e0e0aa58f0612938c839bc3780e0f9c794f7a
|
|
BLAKE2b-256 checksum How to use checksums |
23691014369f1d6b14d39a0337d14029fbdf60bd24ced24aaf1f7b971ba8f9a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl
| Download URL | coppeliasim_zmqremoteapi_client-2.0.4-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b83119f713070f8f4507afca0cc0258f3ec5a498c54c207a70622d9d81d8c229
|
|
BLAKE2b-256 checksum How to use checksums |
43ef0346adebafcaf46166f2b3276d1c5368e0604351604891967c182bf28b68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|