Metadata-Version: 2.4
Name: qhsim
Version: 0.1.0
Summary: Mock-backend Python SDK for simulation-carema.
Author: Qunhe
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# qhsim SDK

Mock-backend Python SDK for the simulation-carema v1 API.

## Install

```bash
python -m pip install -e sdk
```

## Example

```python
from qhsim import SimulationApp
from qhsim.core.api import World
from qhsim.core.math import Position, Target
from qhsim.sensors.camera import Camera

simulation_app = SimulationApp(user_id="3FO4KV8SHSLV")

world = World(simulation_app)
world.load_scene(design_id="3FO3BK4HCD6O")

camera = Camera(
    name="camera",
    position=Position(0.0, 0.0, 1600.0),
    target=Target(0.0, 1938.0, 1300.0),
    fov=80.0,
    clarity=1,
)

world.scene.add(camera)

camera.set_world_pose(
    position=Position(1090.0, 0.0, 1600.0),
    target=Target(100.0, 1938.0, 1300.0),
)

render_data = world.render()
print(render_data.image_urls)
print(world.result[render_data.task_id])
print(camera.get_history_pose())
print(world.scene.get_object(object_name=camera.name))

simulation_app.close()
```

The default backend is in-process and deterministic. To swap it out, pass a backend object with `load_scene()` and `render()` methods:

```python
simulation_app = SimulationApp(config={"backend": custom_backend})
```
