Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ bodies.
RobotWorkspaceCfg
Gizmo
GizmoCfg
create_robot_ik_gizmo_controller
RigidConstraint

.. currentmodule:: embodichain.lab.sim.objects
Expand Down Expand Up @@ -186,6 +187,8 @@ Gizmo
:show-inheritance:
:exclude-members: __init__, copy, replace, to_dict, validate

.. autofunction:: create_robot_ik_gizmo_controller

Rigid Constraint
----------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ action/solver adaptation.
action_utils
atom_action_utils
cfg_utils
gizmo_utils
import_utils
io_utils
keyboard_utils
Expand Down Expand Up @@ -46,12 +45,6 @@ Configuration Utilities
.. automodule:: embodichain.lab.sim.utility.cfg_utils
:members:

Gizmo Utilities
~~~~~~~~~~~~~~~

.. automodule:: embodichain.lab.sim.utility.gizmo_utils
:members:

Import Utilities
~~~~~~~~~~~~~~~~

Expand Down
43 changes: 43 additions & 0 deletions docs/source/features/interaction/window.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,49 @@ Recording hotkey registration is controlled by `SimConfig.window_record.enable_h

The camera-pose hotkey is controlled by `SimulationManagerCfg.window_camera_pose.enable_hotkey` and prints look-at form by default. Set `SimulationManagerCfg.window_camera_pose.convert_to_look_at=False` to print the raw 4x4 pose matrix instead. The same output can be requested programmatically with `SimulationManager.print_window_camera_pose()`.

### Entity Gizmo Control

DexSim owns native entity selection and manipulation. Enable it explicitly after
opening a native window:

```python
import dexsim

gizmo_config = dexsim.interaction.EntityGizmoConfig()
gizmo_config.max_gizmos = 0 # Unlimited simultaneous bindings.
sim.open_window()
sim.enable_entity_gizmo(gizmo_config)
```

While enabled, left-click a render mesh, dynamic/kinematic rigid body, or
articulation link and press **G** to attach or detach its root gizmo. The
controller supports multiple simultaneous bindings and owns selection,
temporary physics-state changes, and cleanup. No `sim.update_gizmos()` call is
needed for this world-level controller.

EmbodiChain's built-in `default_plane` is registered as an immovable target and
cannot receive an entity gizmo. Other supported scene entities remain
selectable normally.

`sim.enable_entity_gizmo(config)` is a thin helper that also excludes
EmbodiChain's render-only default plane. All other lifecycle operations stay on
DexSim's world object:

```python
world = sim.get_world()
controller = world.get_entity_gizmo()
world.disable_entity_gizmo()
```

This controller is distinct from DexSim's target-specific Robot TCP IK
controller. When both are active, **G** controls entity roots and **I** shows or
hides the Robot TCP target.

The entity gizmo is native-window only. The Viser backend offers an analogous
**click-to-pick** flow (an *Enable click-to-pick Gizmo* checkbox instead of the
**G** hotkey, since browsers do not expose keyboard events); see
:doc:`tutorial/gizmo` for details.

## Customizing Window Events

Users can create their own custom window interaction controls by subclassing the `ObjectManipulator` class (provided by `dexsim`). This allows for the implementation of specific behaviors and responses to user inputs.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/overview/sim/viser_visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ each Gizmo through `SimulationManager.enable_gizmo`; a pure browser process can
omit the DexSim handle:

```python
sim.enable_gizmo("cube", enable_native=False)
sim.enable_gizmo("cube")
```

Viser and DexSim use the same deferred target-control path:
Expand Down
Loading
Loading