G1¶
G1 is a rigid articulated Unitree G1 model with STL link meshes attached to the Kimodo 34-joint skeleton.
Setup¶
G1 downloads automatically on first use. To prefetch and save the path:
# Download the Unitree G1 XML and link meshes.
body-models download g1
When passed manually, model_path should contain xml/g1.xml and meshes/g1/*.STL.
Notes¶
G1 is a rigid articulated model, so it does not define skin_weights. Use forward_links, link_mesh, or joint_meshes when rendering or inspecting individual STL links.
API¶
body_models.robots.g1.numpy.G1
¶
G1(model_path=None, *, rotation_type='rotmat', convention='soma')
Bases: BodyModel
Unitree G1 as rigid STL links attached to the Kimodo 34-joint skeleton.
Initialize the G1 model.
| PARAMETER | DESCRIPTION |
|---|---|
model_path
|
Path to model assets, or the default assets when omitted.
TYPE:
|
rotation_type
|
Rotation representation expected by pose inputs.
TYPE:
|
convention
|
Skeleton convention used when loading rigid model data.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
forward_skeleton |
Compute posed joint transforms. |
forward_vertices |
Compute posed mesh vertices. |
joint_index |
Resolve a standard joint to this model's native joint index. |
prepare_skinning |
Pack prepared model state into renderer-ready skinning inputs. |
| ATTRIBUTE | DESCRIPTION |
|---|---|
common_joints |
Common anatomical joints mapped to this model's native joint names.
TYPE:
|
Source code in src/body_models/robots/g1/numpy.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
common_joints
property
¶
common_joints
Common anatomical joints mapped to this model's native joint names.
forward_skeleton
¶
forward_skeleton(
body_pose,
global_translation=None,
*,
global_rotation=None,
joint_indices=None,
)
Compute posed joint transforms.
| PARAMETER | DESCRIPTION |
|---|---|
body_pose
|
Local body joint rotations.
TYPE:
|
global_translation
|
Global model translation.
TYPE:
|
global_rotation
|
Global model rotation.
TYPE:
|
joint_indices
|
Optional subset of joints to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[ndarray, 'B J 4 4']
|
Joint transforms in the model hierarchy. |
Source code in src/body_models/robots/g1/numpy.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
forward_vertices
¶
forward_vertices(
body_pose,
global_translation=None,
*,
global_rotation=None,
vertex_indices=None,
)
Compute posed mesh vertices.
| PARAMETER | DESCRIPTION |
|---|---|
body_pose
|
Local body joint rotations.
TYPE:
|
global_translation
|
Global model translation.
TYPE:
|
global_rotation
|
Global model rotation.
TYPE:
|
vertex_indices
|
Optional subset of vertices to return.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Float[ndarray, 'B V 3']
|
Posed vertex positions. |
Source code in src/body_models/robots/g1/numpy.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | |
joint_index
¶
joint_index(joint)
Resolve a standard joint to this model's native joint index.
Source code in src/body_models/base.py
77 78 79 80 81 82 83 84 85 | |
prepare_skinning
¶
prepare_skinning(*, identity, pose)
Pack prepared model state into renderer-ready skinning inputs.
Source code in src/body_models/base.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 | |