You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/reference/viewers.rst
+140-5Lines changed: 140 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,22 +62,156 @@ PyrenderViewer
62
62
--------------
63
63
64
64
**Description:**
65
-
The ``PyrenderViewer`` utilizes the Pyrender library for advanced 3D rendering, ideal for creating realistic visual simulations. This viewer is particularly suited for complex rendering tasks in robotics, including detailed lighting and shading effects.
65
+
The ``PyrenderViewer`` utilizes the Pyrender library for advanced 3D rendering, ideal for creating realistic visual simulations. This viewer is implemented as a Singleton to ensure only one instance exists throughout the program. It's particularly suited for complex rendering tasks in robotics, including detailed lighting, shading effects, and collision visualization.
66
66
67
67
**Key Functionalities:**
68
68
69
69
- **Initialization and Configuration:**
70
-
The viewer is initialized with specified resolution and rendering flags, creating a scene managed by Pyrender. It supports high-quality rendering features like raymond lighting.
70
+
The viewer is initialized with specified resolution, update interval, and rendering flags. Key parameters include:
- ``title``: Window title (default: ``'scikit-robot PyrenderViewer'``)
71
76
72
77
- **Rendering Control:**
73
-
Handles real-time scene updates triggered by user interactions such as mouse events and keyboard inputs, ensuring the scene remains interactive and up-to-date.
78
+
Handles real-time scene updates triggered by user interactions. The viewer automatically manages OpenGL compatibility with fallback support from OpenGL 4.1 → 4.0 → 3.3, ensuring robust operation across different systems including WSL2.
74
79
75
80
- **Scene Management:**
76
-
Similar to ``TrimeshSceneViewer``, it allows for the addition and removal of visual meshes linked to robotic models, supporting dynamic updates to the scene as robotic configurations change.
81
+
Supports dynamic addition and removal of visual and collision meshes linked to robotic models. The viewer maintains real-time synchronization with robot configurations through the ``redraw()`` method.
77
82
78
83
- **Camera Management:**
79
-
Offers detailed camera setup options, including angle adjustments, distance settings, center positioning, and field of view configuration, providing flexibility in viewing angles for complex scenes.
84
+
Offers detailed camera setup options through the ``set_camera()`` method:
85
+
86
+
- Angle-based positioning with Euler angles
87
+
- Distance and center point configuration
88
+
- Field of view (FOV) adjustment
89
+
- Direct Coordinates object support for precise camera placement
90
+
91
+
- **Collision/Visual Mesh Toggle:**
92
+
When ``enable_collision_toggle=True``, press the ``v`` key to switch between:
93
+
94
+
- **Visual meshes**: Default appearance meshes for rendering (left in figure below)
95
+
- **Collision meshes**: Simplified meshes used for collision detection (displayed in orange/transparent, right in figure below)
:alt:Visual mesh (left) vs Collision mesh (right) comparison
101
+
102
+
**Visual mesh (left) vs Collision mesh (right).** The visual mesh shows the detailed appearance of the robot with textured wheels. The collision mesh on the right uses simplified cylinder representations for the wheels, which are computationally more efficient for collision detection algorithms.
103
+
104
+
- **360-Degree Image Capture:**
105
+
The ``capture_360_images()`` method enables automated scene capture from multiple angles:
106
+
107
+
- Configurable number of frames and camera elevation
108
+
- Automatic GIF animation generation
109
+
- Transparent background support
110
+
- Custom lighting configuration options
111
+
112
+
113
+
**Keyboard Controls:**
114
+
115
+
The PyrenderViewer provides extensive keyboard controls for interactive manipulation:
0 commit comments